-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-codegenArea: Code generationArea: Code generationA-gccThings relevant to the [future] GCC backendThings relevant to the [future] GCC backendT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Hi.
I was testing cross-language LTO with rustc_codegen_gcc (using GCC as the linker) and I needed to add a leading dash to the flags in this code in order to make cross-language LTO working, so that it looks like this:
self.link_args(&[
&format!("-plugin-opt=-{opt_level}"),
&format!("-plugin-opt=-mcpu={}", self.target_cpu),
]);
Otherwise, GCC will error out with:
lto1: fatal error: open O3 failed: No such file or directory
compilation terminated.
lto-wrapper: fatal error: gcc returned 1 exit status
It would be nice to have the code working for both GCC and clang.
How would you support both?
Interestingly, clang
seems to support a leading dash in the case of -plugin-opt=-mcpu=x86-64
, but not -plugin-opt=-O3
.
Thanks.
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-gccThings relevant to the [future] GCC backendThings relevant to the [future] GCC backendT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.