[llvm-dev] Linker Option support for ELF

Rafael Avila de Espindola via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 8 16:39:36 PST 2018

Cary Coutant via llvm-dev <llvm-dev at lists.llvm.org> writes:

>> I think we all agree that blindly allowing the linker to honor the options
>> would be scary.  I agree that we should whitelist the options, and am of the
>> opinion that we should force validation on the linker side (use of any
>> option which the linker doesn't support in this form can be fatal).
>> Starting small is the best way, with `-l` and `-L` as a starting point.  I
>> want to retain the ability to add additional options which may not be
>> available in all linkers.  However, whitelisting obviously requires working
>> with the linker as would adding such options, so that could be handled at
>> that time.
> This is actually why I'd prefer a new "language" over just
> whitelisting options. With "lib", "file", and "path", as I suggested,
> there's no question whether an option like "-no-pie" is supported, and
> no temptation to even try. The new language should be tailored for
> process-to-process communication, rather than user-to-shell
> communication.

I agree. This seems to have the two main desirable features

* The compiler/llvm can handle the name/value pairs as black boxes.
* There is no risk of blindly adding an option to the whitelist.


More information about the llvm-dev mailing list