[cfe-dev] Add -fbinutils-version=

Fāng-ruì Sòng via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 16 23:42:01 PST 2020


In August I proposed adding -fbinutils-version= to Clang
https://reviews.llvm.org/D85474
The main purpose is to condition various accumulated workarounds for the ELF
binary format (for GNU as and GNU ld bugs/unimplemented features in older
versions). When the user does not use GNU as or GNU ld, don't make
certain pessimized
MC/CodeGen decisions. See the patch's summary for details and various
hacks I've found for multiple targets
(X86/AArch/PowerPC/Mips). Now I recall the patch as I ponder on using
the option to enable better garbage collection for .gcc_except_table


>From the review:

jhenderson said: "This looks reasonable to me, but I don't know the
surrounding code well enough to be comfortable LGTM-ing it. Sorry!"
pcc said: "I agree with @MaskRay that this should be a binutils-specific option.
The flag -mlinker-version seems to have been designed around macOS-specific
assumptions i.e. there is a single linker (ld64) and that the linker and
assembler are not version coupled. Having this option be binutils-specific seems
like the best way to reflect the binutils-specific requirements."

Both responses seem like mild preference. I appreciate if folks can
continue reviewing the patch:)

(My last reply has addressed questions about why we do not reuse
-mlinker-version=.)


-- 
宋方睿


More information about the cfe-dev mailing list