Skip to content

[mini] double quote linker path in defined(LD_NAME) case #74451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -12737,7 +12737,12 @@ compile_asm (MonoAotCompile *acfg)
if (ld_binary_name == NULL) {
ld_binary_name = LD_NAME;
}
g_string_append_printf (str, "%s%s %s", tool_prefix, ld_binary_name, LD_OPTIONS);
if (acfg->aot_opts.tool_prefix)
g_string_append_printf (str, "\"%s%s\" %s", tool_prefix, ld_binary_name, LD_OPTIONS);
else if (acfg->aot_opts.llvm_only)
g_string_append_printf (str, "%s", acfg->aot_opts.clangxx);
else
g_string_append_printf (str, "\"%s%s\" %s", tool_prefix, ld_binary_name, LD_OPTIONS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the other version we're not adding LD_OPTIONS in the else case

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to preserve the old behavior of the defined(LD_NAME) case - if a tool prefix option isn't set, it uses the ld_binary_name (ie LD_NAME by default) and LD_OPTIONS

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but I'm more worried about the previous behavior of Android x86, we care more about that than Desktop Linux x86

Copy link
Member Author

@lambdageek lambdageek Aug 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android sets acfg->aot_opts.tool_prefix, so it's in the "cross compiling" branch, below, not the final "else" branch. So it adds LD_OPTIONS

#else
if (ld_binary_name == NULL) {
ld_binary_name = "ld";
Expand Down