diff options
author | Olivier Hainque <hainque@adacore.com> | 2018-07-31 09:24:41 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@gcc.gnu.org> | 2018-07-31 09:24:41 +0000 |
commit | f37866e818ab839e0db68be23e5a339e5e7c19dc (patch) | |
tree | d0e676879f65f348b838125b8e4d9cf763c5e61e /gcc/config | |
parent | 1d4a51cf5079c11a44126bf7d5cf63fd9b202fbd (diff) | |
download | gcc-f37866e818ab839e0db68be23e5a339e5e7c19dc.zip gcc-f37866e818ab839e0db68be23e5a339e5e7c19dc.tar.gz gcc-f37866e818ab839e0db68be23e5a339e5e7c19dc.tar.bz2 |
Add support for -nolibc
2018-06-07 Olivier Hainque <hainque@adacore.com>
* common.opt (nolibc): New option.
* doc/invoke.texi (Link Options): Document it.
* gcc.c (LINK_GCC_C_SEQUENCE_SPEC): Honor nolibc.
* config/alpha/linux.h: Likewise.
* config/arc/elf.h: Likewise.
* config/arm/uclinux-elf.h: Likewise.
* config/arm/unknown-elf.h: Likewise.
* config/avr/avrlibc.h: Likewise.
* config/bfin/bfin.h: Likewise.
* config/bfin/linux.h: Likewise.
* config/bfin/uclinux.h: Likewise.
* config/darwin.h: Likewise.
* config/darwin10.h: Likewise.
* config/darwin12.h: Likewise.
* config/gnu-user.h: Likewise.
* config/lm32/uclinux-elf.h: Likewise.
* config/pa/pa-hpux11.h: Likewise.
* config/pa/pa64-hpux.h: Likewise.
* config/sparc/sparc.h: Likewise.
From-SVN: r263083
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/linux.h | 2 | ||||
-rw-r--r-- | gcc/config/arc/elf.h | 2 | ||||
-rw-r--r-- | gcc/config/arm/uclinux-elf.h | 4 | ||||
-rw-r--r-- | gcc/config/arm/unknown-elf.h | 2 | ||||
-rw-r--r-- | gcc/config/avr/avrlibc.h | 2 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.h | 2 | ||||
-rw-r--r-- | gcc/config/bfin/linux.h | 2 | ||||
-rw-r--r-- | gcc/config/bfin/uclinux.h | 2 | ||||
-rw-r--r-- | gcc/config/darwin.h | 2 | ||||
-rw-r--r-- | gcc/config/darwin10.h | 2 | ||||
-rw-r--r-- | gcc/config/darwin12.h | 2 | ||||
-rw-r--r-- | gcc/config/gnu-user.h | 2 | ||||
-rw-r--r-- | gcc/config/lm32/uclinux-elf.h | 2 | ||||
-rw-r--r-- | gcc/config/pa/pa-hpux11.h | 2 | ||||
-rw-r--r-- | gcc/config/pa/pa64-hpux.h | 2 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 2 |
16 files changed, 17 insertions, 17 deletions
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h index 2bf52fe..6d12d90 100644 --- a/gcc/config/alpha/linux.h +++ b/gcc/config/alpha/linux.h @@ -105,7 +105,7 @@ along with GCC; see the file COPYING3. If not see %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s" #define LINK_GCC_C_SEQUENCE_SPEC \ - "%{static|static-pie:--start-group} %G %L \ + "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" /* Use --as-needed -lgcc_s for eh support. */ diff --git a/gcc/config/arc/elf.h b/gcc/config/arc/elf.h index 66ee5b6..3472fd2 100644 --- a/gcc/config/arc/elf.h +++ b/gcc/config/arc/elf.h @@ -77,4 +77,4 @@ along with GCC; see the file COPYING3. If not see /* If no specs file is enforced, default to nosys libarary. */ #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC \ - "--start-group %G %{!specs=*:-lc -lnosys} --end-group" + "--start-group %G %{!specs=*:%{!nolibc:-lc -lnosys}} --end-group" diff --git a/gcc/config/arm/uclinux-elf.h b/gcc/config/arm/uclinux-elf.h index f78f279..5733983 100644 --- a/gcc/config/arm/uclinux-elf.h +++ b/gcc/config/arm/uclinux-elf.h @@ -67,8 +67,8 @@ #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC \ - "%{static|static-pie:--start-group} %G %L \ - %{static|static-pie:--end-group}%{!static:%{!static-pie:%G %L}}" + "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ + %{static|static-pie:--end-group}%{!static:%{!static-pie:%G %{!nolibc:%L}}}" /* Use --as-needed -lgcc_s for eh support. */ #ifdef HAVE_LD_AS_NEEDED diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h index 12dd093..6eeb0eb 100644 --- a/gcc/config/arm/unknown-elf.h +++ b/gcc/config/arm/unknown-elf.h @@ -93,4 +93,4 @@ udivmoddi4, which will depend on the exception unwind routines, which will depend on abort, which is defined in libc. */ #undef LINK_GCC_C_SEQUENCE_SPEC -#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group" +#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %{!nolibc:%L} --end-group" diff --git a/gcc/config/avr/avrlibc.h b/gcc/config/avr/avrlibc.h index 95a1d7c..f4a41a1 100644 --- a/gcc/config/avr/avrlibc.h +++ b/gcc/config/avr/avrlibc.h @@ -37,4 +37,4 @@ along with GCC; see the file COPYING3. If not see #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC \ - "--start-group %G %L --end-group" + "--start-group %G %{!nolibc:%L} --end-group" diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h index 4709282..a503d57 100644 --- a/gcc/config/bfin/bfin.h +++ b/gcc/config/bfin/bfin.h @@ -204,7 +204,7 @@ #endif #define LINK_GCC_C_SEQUENCE_SPEC "\ - %{mfast-fp:-lbffastfp} %G %L %{mfast-fp:-lbffastfp} %G \ + %{mfast-fp:-lbffastfp} %G %{!nolibc:%L} %{mfast-fp:-lbffastfp} %G \ " #undef ASM_SPEC diff --git a/gcc/config/bfin/linux.h b/gcc/config/bfin/linux.h index 9d317d1..b1592ee 100644 --- a/gcc/config/bfin/linux.h +++ b/gcc/config/bfin/linux.h @@ -35,7 +35,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC \ - "%{static|static-pie:--start-group} %{mfast-fp:-lbffastfp} %G %L \ + "%{static|static-pie:--start-group} %{mfast-fp:-lbffastfp} %G %{!nolibc:%L} \ %{static|static-pie:--end-group} \ %{!static:%{!static-pie:%{mfast-fp:-lbffastfp} %G}}" diff --git a/gcc/config/bfin/uclinux.h b/gcc/config/bfin/uclinux.h index 7ef3b16..beb6d45 100644 --- a/gcc/config/bfin/uclinux.h +++ b/gcc/config/bfin/uclinux.h @@ -29,7 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC "\ - %{mfast-fp:-lbffastfp} %G %L %{mfast-fp:-lbffastfp} %G \ + %{mfast-fp:-lbffastfp} %G %{!nolibc:%L} %{mfast-fp:-lbffastfp} %G \ " #undef TARGET_SUPPORTS_SYNC_CALLS diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 591188a..980ad9b 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -210,7 +210,7 @@ extern GTY(()) int darwin_ms_struct; /* We only want one instance of %G, since libSystem (Darwin's -lc) does not depend on libgcc. */ #undef LINK_GCC_C_SEQUENCE_SPEC -#define LINK_GCC_C_SEQUENCE_SPEC "%G %L" +#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L}" /* ld64 supports a sysroot, it just has a different name and there's no easy way to check for it at config time. */ diff --git a/gcc/config/darwin10.h b/gcc/config/darwin10.h index 7da3291..d61eb40 100644 --- a/gcc/config/darwin10.h +++ b/gcc/config/darwin10.h @@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see %{!static:%{!static-libgcc: \ %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } \ %{fno-pic|fno-PIC|fno-pie|fno-PIE|fapple-kext|mkernel|static|mdynamic-no-pic: \ - %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } %G %L" + %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } %G %{!nolibc:%L}" #undef DEF_MIN_OSX_VERSION #define DEF_MIN_OSX_VERSION "10.6" diff --git a/gcc/config/darwin12.h b/gcc/config/darwin12.h index f1562c5..e1e1eb0 100644 --- a/gcc/config/darwin12.h +++ b/gcc/config/darwin12.h @@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see %{!static:%{!static-libgcc: \ %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } \ %{fno-pic|fno-PIC|fno-pie|fno-PIE|fapple-kext|mkernel|static|mdynamic-no-pic: \ - %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } %G %L" + %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } %G %{!nolibc:%L}" #undef DEF_MIN_OSX_VERSION #define DEF_MIN_OSX_VERSION "10.8" diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h index b326cf0..5b48fb2 100644 --- a/gcc/config/gnu-user.h +++ b/gcc/config/gnu-user.h @@ -135,7 +135,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC \ - "%{static|static-pie:--start-group} %G %L \ + "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" /* Use --as-needed -lgcc_s for eh support. */ diff --git a/gcc/config/lm32/uclinux-elf.h b/gcc/config/lm32/uclinux-elf.h index cfaca37..ac51d97 100644 --- a/gcc/config/lm32/uclinux-elf.h +++ b/gcc/config/lm32/uclinux-elf.h @@ -68,7 +68,7 @@ #define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS() #define LINK_GCC_C_SEQUENCE_SPEC \ - "%{static|static-pie:--start-group} %G %L \ + "%{static|static-pie:--start-group} %G %{!nolibc:%L} \ %{static|static-pie:--end-group}%{!static:%{!static-pie:%G}}" #undef CC1_SPEC diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h index 8adfe18..0e960c3 100644 --- a/gcc/config/pa/pa-hpux11.h +++ b/gcc/config/pa/pa-hpux11.h @@ -157,7 +157,7 @@ along with GCC; see the file COPYING3. If not see /* The libgcc_stub.a library needs to come last. */ #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC \ - "%G %L %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}}}" + "%G %{!nolibc:%L} %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}}}" #undef STARTFILE_SPEC #define STARTFILE_SPEC \ diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h index 6f70767..2c24238 100644 --- a/gcc/config/pa/pa64-hpux.h +++ b/gcc/config/pa/pa64-hpux.h @@ -106,7 +106,7 @@ along with GCC; see the file COPYING3. If not see /* The libgcc_stub.a and milli.a libraries need to come last. */ #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC "\ - %G %L %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}\ + %G %{!nolibc:%L} %G %{!nostdlib:%{!nodefaultlibs:%{!shared:-lgcc_stub}\ milli.a%s}}" /* Under hpux11, the normal location of the `ld' and `as' programs is the diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 032a91d..87358c7 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -420,7 +420,7 @@ extern enum cmodel sparc_cmodel; /* Because libgcc can generate references back to libc (via .umul etc.) we have to list libc again after the second libgcc. */ -#define LINK_GCC_C_SEQUENCE_SPEC "%G %L %G %L" +#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L} %G %{!nolibc:%L}" #define PTRDIFF_TYPE (TARGET_ARCH64 ? "long int" : "int") |