[ARM/FDPIC v6 03/24] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is...
authorChristophe Lyon <christophe.lyon@st.com>
Tue, 10 Sep 2019 07:39:47 +0000 (09:39 +0200)
committerChristophe Lyon <clyon@gcc.gnu.org>
Tue, 10 Sep 2019 07:39:47 +0000 (09:39 +0200)
commit45d53c679a5de20410818d1de40a09542fa1387e
tree4d1bb02b7859eb9487b0c2129cec522d9c7a8ca3
parentb1e21e5a5d19b436f948710e09157c5b3244f541
[ARM/FDPIC v6 03/24] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided

In FDPIC mode, we set -fPIE unless the user provides -fno-PIE, -fpie,
-fPIC or -fpic: indeed FDPIC code is PIC, but we want to generate code
for executables rather than shared libraries by default.

We also make sure to use the --fdpic assembler option, and select the
appropriate linker emulation.

At link time, we also default to -pie, unless we are generating a
shared library or a relocatable file (-r). Note that static link is
not supported as it requires specifying the dynamic linker because the
executable still has to relocate itself at startup.

We also force 'now' binding since lazy binding is not supported.

We should also apply the same behavior for -Wl,-Ur as for -r, but I
couldn't find how to describe that in the specs fragment.

2019-09-10  Christophe Lyon  <christophe.lyon@st.com>
Mickaël Guêné <mickael.guene@st.com>

gcc/
* config.gcc: Handle arm*-*-uclinuxfdpiceabi.
* config/arm/bpabi.h (TARGET_FDPIC_ASM_SPEC): New.
(SUBTARGET_EXTRA_ASM_SPEC): Use TARGET_FDPIC_ASM_SPEC.
* config/arm/linux-eabi.h (FDPIC_CC1_SPEC): New.
(CC1_SPEC): Use FDPIC_CC1_SPEC.
(MUSL_DYNAMIC_LINKER): Add -fdpic suffix when needed.
* config/arm/uclinuxfdpiceabi.h: New file.

libsanitizer/
* configure.tgt (arm*-*-*fdpiceabi): Sanitizers are
unsupported in this configuration.

Co-Authored-By: Mickaël Guêné <mickael.guene@st.com>
From-SVN: r275565
gcc/ChangeLog
gcc/config.gcc
gcc/config/arm/bpabi.h
gcc/config/arm/linux-eabi.h
gcc/config/arm/uclinuxfdpiceabi.h [new file with mode: 0644]
libsanitizer/ChangeLog
libsanitizer/configure.tgt