I.e., llvm/CodeGen/CommandFlags.h which in turn includes
llvm/MC/MCTargetOptionsCommandFlags.h.
This gets rid of a few duplicates on our side and includes about 35
(depending on LLVM version) new command-line options. LLVM provides a
helper function to set up the TargetOptions according to (most of) these
options.
Newer LLVM versions may add new options and we'll automatically inherit
them, including setting up the TargetOptions accordingly.
I did my best (TM) to remove a few unused/undesirable options and hide all
remaining new ones except for `-fp-contract`. The lists will need to be
tweaked from time to time.
Modern Linux distributions have their toolchain generate PIC code for
additional security features (like ASLR).
Since there is no (sane) way to detect whether the toolchain defaults to
PIC code, we simply default to PIC code on all Linux
distributions to avoid linking issues on these OSes.
The relocation model can be switched back to non-PIC code manually at
any time.
Sets ARM default relocation model to PIC for Darwin & Android and static
for rest. This is needed because LLVM picks default relocation model of
DynamicNoPIC for non-Darwin targets, which generates bad code at -O0.
Clang source code even states that DynamicNoPIC isn't valid on any OS
but Darwin.
The Gentoo CHOST triple differs from the normalized triple used by
LLVM. See https://wiki.gentoo.org/wiki/CHOST for details.
This results in a failure to detect the used float ABI. The vendor
field can be hardfloat or softfloat in order to indicate the float
ABI. This is the only way to specify the hardfloat ABI because the
C library value gnueabihf is not supported.
This commit adds a check for vendor names hardfloat and softfloat.
On OS X, the OS in Triple should be macosx, not darwin. This is not
comprehensive like clang which has a bunch of darwin to other OS
translation rules, but since only Darwin target currently supported is
OS X, this does the job.
This enables code generation for cmpxchg16b instruction which is
not available on very old 64bit CPUs.
The user can change this be choosing a different cpu (`-mcpu=...`)
or by explicitly disabling the attribute (`-mattr=-cx16`).
Adds a new command line option -mabi= and uses the value to compute
the ABI to use. Adds the ABI to linker and assembler invocation, too.
Allows consistent invocation of the whole tool chain.
A function attribute use-soft-float with values true or false is used instead.
This commi only ensures that LDC compiles with LLVM 3.7. The possible semantic
change needs to be evaluated.
Was always defaulting thumb to soft, now uses same rules for arm. The
end result is that thumbv7-apple-ios now defaults to softfp correctly.
(cherry picked from commit e0cf8e85c2e42f382742c326f8963b8bf779df8c)
Set versions ARM_SoftFP & D_HardFloat instead of ARM_SoftFloat &
D_SoftFloat for option -mfloat-abi=softfp (function calls use soft float
ABI but using hardware floating point instruction).
(cherry picked from commit 5a19080e04cc775fe94ea2ef74c850b26bb8a469)