aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2004-11-11 03:18:02 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-11-11 03:18:02 +0000
commitdc3160863a1cdc9c015ae2b8690d91e2b83cf4db (patch)
treea54f2bc0212c863a4196ecc6fcaaa57d680d48d7 /gcc/config
parent8ef36086c65ab47220e159ef34e90907836775e0 (diff)
downloadgcc-dc3160863a1cdc9c015ae2b8690d91e2b83cf4db.zip
gcc-dc3160863a1cdc9c015ae2b8690d91e2b83cf4db.tar.gz
gcc-dc3160863a1cdc9c015ae2b8690d91e2b83cf4db.tar.bz2
linux.h (LINUX_TARGET_OS_CPP_BUILTINS): Define __PIC__ and __pic__ only if TARGET_ABICALLS.
2004-11-10 Peter S. Mazinger <ps.m@gmx.net> * config/mips/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): Define __PIC__ and __pic__ only if TARGET_ABICALLS. (SUBTARGET_CPP_SPECS): Don't define or undefine __PIC__ and __pic__. (SUBTARGET_ASM_SPECS): Don't pass -non_shared to assembler; pass -KPIC only if not -mno-abicalls. * config/alpha/linux.h, config/arm/linux-elf.h, config/pa/pa-linux.h * config/sparc/linux.h, config/sparc/linux64.h (TARGET_OS_CPP_BUILTINS): Define __PIC__ and __pic__ if flag_pic. * config/arm/linux-gas.h (CPP_SPEC): Don't define __PIC__ or __pic__. * config/pa/pa/linux.h (CPP_SPEC): Likewise. * config/sparc/linux.h (CPP_SUBTARGET_SPEC): Likewise. * config/sparc/linux64.h (CPP_SUBTARGET_SPEC): Likewise. From-SVN: r90470
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/linux.h5
-rw-r--r--gcc/config/arm/linux-elf.h12
-rw-r--r--gcc/config/arm/linux-gas.h2
-rw-r--r--gcc/config/mips/linux.h17
-rw-r--r--gcc/config/pa/pa-linux.h7
-rw-r--r--gcc/config/sparc/linux.h7
-rw-r--r--gcc/config/sparc/linux64.h6
7 files changed, 41 insertions, 15 deletions
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index e9a0e90..a64529f 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 616921b..892acf2 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 f9f70b2..85ae98a 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 be5c8d4..de3f0cd 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 c3808f1..fa86715 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 788b143..2116cb4 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 daf1653..0b91659 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} \
"