diff options
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/linux.h | 5 | ||||
-rw-r--r-- | gcc/config/arm/linux-elf.h | 12 | ||||
-rw-r--r-- | gcc/config/arm/linux-gas.h | 2 | ||||
-rw-r--r-- | gcc/config/mips/linux.h | 17 | ||||
-rw-r--r-- | gcc/config/pa/pa-linux.h | 7 | ||||
-rw-r--r-- | gcc/config/sparc/linux.h | 7 | ||||
-rw-r--r-- | gcc/config/sparc/linux64.h | 6 |
7 files changed, 41 insertions, 15 deletions
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h index e9a0e900580..a64529f6b93 100644 --- a/gcc/config/alpha/linux.h +++ b/gcc/config/alpha/linux.h @@ -36,6 +36,11 @@ Boston, MA 02111-1307, USA. */ /* The GNU C++ standard library requires this. */ \ if (c_dialect_cxx ()) \ builtin_define ("_GNU_SOURCE"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ } while (0) #undef LIB_SPEC diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index 616921b20c3..892acf2d86c 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -89,7 +89,17 @@ %{mbig-endian:-EB}" \ SUBTARGET_EXTRA_LINK_SPEC -#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS() +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ + } \ + while (0) /* This is how we tell the assembler that two symbols have the same value. */ #define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \ diff --git a/gcc/config/arm/linux-gas.h b/gcc/config/arm/linux-gas.h index f9f70b239fd..85ae98a5eff 100644 --- a/gcc/config/arm/linux-gas.h +++ b/gcc/config/arm/linux-gas.h @@ -28,7 +28,7 @@ #define DEFAULT_SIGNED_CHAR 0 #undef SUBTARGET_CPP_SPEC -#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{fPIC|fPIE:-D__PIC__ -D__pic__} %{fpic|fpie:-D__PIC__ -D__pic__}" +#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE}" #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index be5c8d4d219..de3f0cd8f14 100644 --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -56,8 +56,11 @@ Boston, MA 02111-1307, USA. */ #define TARGET_OS_CPP_BUILTINS() \ do { \ LINUX_TARGET_OS_CPP_BUILTINS(); \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ + if (TARGET_ABICALLS) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ builtin_assert ("machine=mips"); \ /* The GNU C++ standard library requires this. */ \ if (c_dialect_cxx ()) \ @@ -96,10 +99,7 @@ Boston, MA 02111-1307, USA. */ } while (0) #undef SUBTARGET_CPP_SPEC -#define SUBTARGET_CPP_SPEC "\ -%{fno-PIC:-U__PIC__ -U__pic__} %{fno-pic:-U__PIC__ -U__pic__} \ -%{fPIC|fPIE|fpic|fpie:-D__PIC__ -D__pic__} \ -%{pthread:-D_REENTRANT}" +#define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}" /* From iris5.h */ /* -G is incompatible with -KPIC which is the default, so only allow objects @@ -120,10 +120,7 @@ Boston, MA 02111-1307, USA. */ %{static:-static}}}" #undef SUBTARGET_ASM_SPEC -#define SUBTARGET_ASM_SPEC "\ -%{mabi=64: -64} \ -%{!fno-PIC:%{!fno-pic:-KPIC}} \ -%{fno-PIC:-non_shared} %{fno-pic:-non_shared}" +#define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}" /* The MIPS assembler has different syntax for .set. We set it to .dummy to trap any errors. */ diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h index c3808f1c34f..fa8671585cc 100644 --- a/gcc/config/pa/pa-linux.h +++ b/gcc/config/pa/pa-linux.h @@ -58,11 +58,16 @@ Boston, MA 02111-1307, USA. */ { \ LINUX_TARGET_OS_CPP_BUILTINS(); \ builtin_assert ("machine=bigendian"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ } \ while (0) #undef CPP_SPEC -#define CPP_SPEC "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}" +#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" #undef LIB_SPEC #define LIB_SPEC \ diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h index 788b1433dc3..2116cb4adbf 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h @@ -29,6 +29,11 @@ Boston, MA 02111-1307, USA. */ builtin_assert ("system=linux"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ } \ while (0) @@ -100,7 +105,7 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SUBTARGET_SPEC #define CPP_SUBTARGET_SPEC \ -"%{fPIC|fPIE|fpic|fpie:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} \ +"%{posix:-D_POSIX_SOURCE} \ %{pthread:-D_REENTRANT} %{mlong-double-128:-D__LONG_DOUBLE_128__}" #undef LIB_SPEC diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h index daf1653bfc7..0b91659abd2 100644 --- a/gcc/config/sparc/linux64.h +++ b/gcc/config/sparc/linux64.h @@ -30,6 +30,11 @@ Boston, MA 02111-1307, USA. */ builtin_assert ("system=linux"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ + if (flag_pic) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ } \ while (0) @@ -127,7 +132,6 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SUBTARGET_SPEC #define CPP_SUBTARGET_SPEC "\ -%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \ %{posix:-D_POSIX_SOURCE} \ %{pthread:-D_REENTRANT} \ " |