This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[4.2 PATCH]: PRs 6123 & 18382, centralize defining __PIC__/__pic__
- From: "Kaveh R. Ghazi" <ghazi at caipclassic dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Sep 2005 22:26:46 -0400 (EDT)
- Subject: [4.2 PATCH]: PRs 6123 & 18382, centralize defining __PIC__/__pic__
Following the recent discussion about darwin and defining __PIC__:
http://gcc.gnu.org/ml/gcc-patches/2005-08/msg01410.html
I've updated my patch for mainline which centralizes where and how we
define __pic__ and __PIC__. This corresponds to PRs 6123 and 18382.
I've also documented the behavior in the manual.
The original patch and discussion was here:
http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00168.html
I believe the objections or issues raised in the above threads were
addressed as noted here:
http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00373.html
http://gcc.gnu.org/ml/gcc-patches/2005-08/msg01428.html
(Note, since the original patch, several other targets besides Darwin
have found it necessary to add their own definitions. Clearly we have
a problem and everybody seems to have to solve it over and over again
separately for each target.)
Bootstrapped on x86_64-unknown-linux-gnu, no regressions. This is a
definite stage 1 kind of change, so okay for 4.2?
Thanks,
--Kaveh
2005-09-05 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-cppbuiltin.c (c_cpp_builtins): Define __pic__ and __PIC__ when
flag_pic is set.
* config/alpha/freebsd.h, config/alpha/linux.h,
config/arm/linux-elf.h, config/cris/linux.h, config/darwin.h,
config/freebsd-spec.h, config/i386/beos-elf.h, config/i386/gnu.h,
config/i386/linux.h, config/i386/linux64.h, config/i386/nto.h,
config/i386/sco5.h, config/m32r/m32r.h, config/m68k/linux.h,
config/m68k/m68k.h, config/mips/linux.h, config/pa/pa-linux.h,
config/rs6000/linux64.h, config/rs6000/sysv4.h,
config/rs6000/vxworks.h, config/s390/linux.h, config/s390/tpf.h,
config/sh/linux.h, config/sh/sh.h, config/sol2.h,
config/sparc/linux.h, config/sparc/linux64.h,
config/xtensa/xtensa.h: Don't define __pic__ or __PIC__.
* doc/invoke.texi: Document that the macros __pic__ and __PIC__
are both defined when either flag -fpic or -fPIC are used.
diff -rup orig/egcc-CVS20050904/gcc/c-cppbuiltin.c egcc-CVS20050904/gcc/c-cppbuiltin.c
--- orig/egcc-CVS20050904/gcc/c-cppbuiltin.c 2005-08-13 22:52:21.000000000 -0400
+++ egcc-CVS20050904/gcc/c-cppbuiltin.c 2005-09-05 09:14:49.000000000 -0400
@@ -419,6 +419,11 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__FINITE_MATH_ONLY__=1");
else
cpp_define (pfile, "__FINITE_MATH_ONLY__=0");
+ if (flag_pic)
+ {
+ builtin_define_with_int_value ("__pic__", flag_pic);
+ builtin_define_with_int_value ("__PIC__", flag_pic);
+ }
if (flag_iso)
cpp_define (pfile, "__STRICT_ANSI__");
diff -rup orig/egcc-CVS20050904/gcc/config/alpha/freebsd.h egcc-CVS20050904/gcc/config/alpha/freebsd.h
--- orig/egcc-CVS20050904/gcc/config/alpha/freebsd.h 2005-06-25 22:37:29.000000000 -0400
+++ egcc-CVS20050904/gcc/config/alpha/freebsd.h 2005-09-05 09:14:49.000000000 -0400
@@ -24,22 +24,9 @@ Boston, MA 02110-1301, USA. */
#define SUBTARGET_EXTRA_SPECS \
{ "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
-/* Provide a FBSD_TARGET_CPU_CPP_BUILTINS and CPP_SPEC appropriate for
- FreeBSD/alpha. Besides the dealing with
- the GCC option `-posix', and PIC issues as on all FreeBSD platforms, we must
- deal with the Alpha's FP issues. */
-
-#undef FBSD_TARGET_CPU_CPP_BUILTINS
-#define FBSD_TARGET_CPU_CPP_BUILTINS() \
- do \
- { \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
- } \
- while (0)
+/* Provide a CPP_SPEC appropriate for FreeBSD/alpha. Besides the
+ dealing with the GCC option `-posix', we must deal with the Alpha's
+ FP issues. */
#undef CPP_SPEC
#define CPP_SPEC "%(cpp_subtarget) %{posix:-D_POSIX_SOURCE}"
diff -rup orig/egcc-CVS20050904/gcc/config/alpha/linux.h egcc-CVS20050904/gcc/config/alpha/linux.h
--- orig/egcc-CVS20050904/gcc/config/alpha/linux.h 2005-08-06 21:09:43.000000000 -0400
+++ egcc-CVS20050904/gcc/config/alpha/linux.h 2005-09-05 09:29:31.000000000 -0400
@@ -36,11 +36,6 @@ Boston, MA 02110-1301, 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 -rup orig/egcc-CVS20050904/gcc/config/arm/linux-elf.h egcc-CVS20050904/gcc/config/arm/linux-elf.h
--- orig/egcc-CVS20050904/gcc/config/arm/linux-elf.h 2005-08-05 21:55:58.000000000 -0400
+++ egcc-CVS20050904/gcc/config/arm/linux-elf.h 2005-09-05 09:29:45.000000000 -0400
@@ -97,11 +97,6 @@
do \
{ \
LINUX_TARGET_OS_CPP_BUILTINS(); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/cris/linux.h egcc-CVS20050904/gcc/config/cris/linux.h
--- orig/egcc-CVS20050904/gcc/config/cris/linux.h 2005-06-25 22:37:37.000000000 -0400
+++ egcc-CVS20050904/gcc/config/cris/linux.h 2005-09-05 09:14:55.000000000 -0400
@@ -96,11 +96,6 @@ Boston, MA 02110-1301, USA. */
do \
{ \
LINUX_TARGET_OS_CPP_BUILTINS(); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
if (flag_leading_underscore <= 0) \
builtin_define ("__NO_UNDERSCORES__"); \
} \
diff -rup orig/egcc-CVS20050904/gcc/config/darwin.h egcc-CVS20050904/gcc/config/darwin.h
--- orig/egcc-CVS20050904/gcc/config/darwin.h 2005-08-31 21:40:10.000000000 -0400
+++ egcc-CVS20050904/gcc/config/darwin.h 2005-09-05 09:29:06.000000000 -0400
@@ -140,14 +140,6 @@ Boston, MA 02110-1301, USA. */
{ "-unexported_symbols_list", "-Zunexported_symbols_list" }, \
SUBTARGET_OPTION_TRANSLATE_TABLE
-#define SUBTARGET_OS_CPP_BUILTINS() \
- do \
- { \
- if (flag_pic) \
- builtin_define ("__PIC__"); \
- } \
- while (0)
-
/* These compiler options take n arguments. */
#undef WORD_SWITCH_TAKES_ARG
diff -rup orig/egcc-CVS20050904/gcc/config/freebsd-spec.h egcc-CVS20050904/gcc/config/freebsd-spec.h
--- orig/egcc-CVS20050904/gcc/config/freebsd-spec.h 2005-07-19 21:40:55.000000000 -0400
+++ egcc-CVS20050904/gcc/config/freebsd-spec.h 2005-09-05 09:22:22.000000000 -0400
@@ -85,7 +85,6 @@ Boston, MA 02110-1301, USA. */
#define FBSD_CPP_SPEC " \
%(cpp_cpu) \
%(cpp_arch) \
- %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \
%{posix:-D_POSIX_SOURCE}"
/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
diff -rup orig/egcc-CVS20050904/gcc/config/i386/beos-elf.h egcc-CVS20050904/gcc/config/i386/beos-elf.h
--- orig/egcc-CVS20050904/gcc/config/i386/beos-elf.h 2005-06-25 22:37:40.000000000 -0400
+++ egcc-CVS20050904/gcc/config/i386/beos-elf.h 2005-09-05 09:14:55.000000000 -0400
@@ -67,11 +67,6 @@ Boston, MA 02110-1301, USA. */
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_assert ("system=beos"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/i386/gnu.h egcc-CVS20050904/gcc/config/i386/gnu.h
--- orig/egcc-CVS20050904/gcc/config/i386/gnu.h 2004-09-07 20:17:13.000000000 -0400
+++ egcc-CVS20050904/gcc/config/i386/gnu.h 2005-09-05 09:14:55.000000000 -0400
@@ -8,11 +8,6 @@
do \
{ \
HURD_TARGET_OS_CPP_BUILTINS(); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/i386/linux.h egcc-CVS20050904/gcc/config/i386/linux.h
--- orig/egcc-CVS20050904/gcc/config/i386/linux.h 2005-08-10 22:04:45.000000000 -0400
+++ egcc-CVS20050904/gcc/config/i386/linux.h 2005-09-05 09:14:55.000000000 -0400
@@ -74,11 +74,6 @@ Boston, MA 02110-1301, USA. */
do \
{ \
LINUX_TARGET_OS_CPP_BUILTINS(); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/i386/linux64.h egcc-CVS20050904/gcc/config/i386/linux64.h
--- orig/egcc-CVS20050904/gcc/config/i386/linux64.h 2005-08-10 22:04:45.000000000 -0400
+++ egcc-CVS20050904/gcc/config/i386/linux64.h 2005-09-05 09:14:55.000000000 -0400
@@ -25,11 +25,6 @@ Boston, MA 02110-1301, USA. */
do \
{ \
LINUX_TARGET_OS_CPP_BUILTINS(); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/i386/nto.h egcc-CVS20050904/gcc/config/i386/nto.h
--- orig/egcc-CVS20050904/gcc/config/i386/nto.h 2005-06-25 22:37:44.000000000 -0400
+++ egcc-CVS20050904/gcc/config/i386/nto.h 2005-09-05 09:14:55.000000000 -0400
@@ -37,11 +37,6 @@ Boston, MA 02110-1301, USA. */
builtin_assert ("system=qnxnto"); \
builtin_assert ("system=nto"); \
builtin_assert ("system=unix"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/i386/sco5.h egcc-CVS20050904/gcc/config/i386/sco5.h
--- orig/egcc-CVS20050904/gcc/config/i386/sco5.h 2005-08-05 21:55:59.000000000 -0400
+++ egcc-CVS20050904/gcc/config/i386/sco5.h 2005-09-05 09:14:55.000000000 -0400
@@ -221,11 +221,6 @@ Boston, MA 02110-1301, USA. */
builtin_assert ("system=svr3"); \
if (flag_iso) \
cpp_define (pfile, "_STRICT_ANSI"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/m32r/m32r.h egcc-CVS20050904/gcc/config/m32r/m32r.h
--- orig/egcc-CVS20050904/gcc/config/m32r/m32r.h 2005-07-08 21:19:08.000000000 -0400
+++ egcc-CVS20050904/gcc/config/m32r/m32r.h 2005-09-05 09:14:55.000000000 -0400
@@ -112,11 +112,6 @@
builtin_assert ("machine=m32r"); \
builtin_define (TARGET_BIG_ENDIAN \
? "__BIG_ENDIAN__" : "__LITTLE_ENDIAN__"); \
- if (flag_pic) \
- { \
- builtin_define ("__pic__"); \
- builtin_define ("__PIC__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/m68k/linux.h egcc-CVS20050904/gcc/config/m68k/linux.h
--- orig/egcc-CVS20050904/gcc/config/m68k/linux.h 2005-06-25 22:37:48.000000000 -0400
+++ egcc-CVS20050904/gcc/config/m68k/linux.h 2005-09-05 09:14:55.000000000 -0400
@@ -94,10 +94,10 @@ Boston, MA 02110-1301, USA. */
#undef CPP_SPEC
#if TARGET_DEFAULT & MASK_68881
#define CPP_SPEC \
- "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+ "%{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#else
#define CPP_SPEC \
- "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+ "%{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
#endif
/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down
diff -rup orig/egcc-CVS20050904/gcc/config/m68k/m68k.h egcc-CVS20050904/gcc/config/m68k/m68k.h
--- orig/egcc-CVS20050904/gcc/config/m68k/m68k.h 2005-07-11 20:42:42.000000000 -0400
+++ egcc-CVS20050904/gcc/config/m68k/m68k.h 2005-09-05 09:14:55.000000000 -0400
@@ -92,12 +92,6 @@ Boston, MA 02110-1301, USA. */
} \
if (TARGET_CF_HWDIV) \
builtin_define ("__mcfhwdiv__"); \
- if (flag_pic) \
- { \
- builtin_define ("__pic__"); \
- if (flag_pic > 1) \
- builtin_define ("__PIC__"); \
- } \
builtin_assert ("cpu=m68k"); \
builtin_assert ("machine=m68k"); \
} \
diff -rup orig/egcc-CVS20050904/gcc/config/mips/linux.h egcc-CVS20050904/gcc/config/mips/linux.h
--- orig/egcc-CVS20050904/gcc/config/mips/linux.h 2005-06-25 22:37:50.000000000 -0400
+++ egcc-CVS20050904/gcc/config/mips/linux.h 2005-09-05 09:19:12.000000000 -0400
@@ -56,11 +56,6 @@ Boston, MA 02110-1301, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
LINUX_TARGET_OS_CPP_BUILTINS(); \
- if (TARGET_ABICALLS) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
/* The GNU C++ standard library requires this. */ \
if (c_dialect_cxx ()) \
builtin_define ("_GNU_SOURCE"); \
diff -rup orig/egcc-CVS20050904/gcc/config/pa/pa-linux.h egcc-CVS20050904/gcc/config/pa/pa-linux.h
--- orig/egcc-CVS20050904/gcc/config/pa/pa-linux.h 2005-06-25 22:37:53.000000000 -0400
+++ egcc-CVS20050904/gcc/config/pa/pa-linux.h 2005-09-05 09:16:26.000000000 -0400
@@ -58,11 +58,6 @@ Boston, MA 02110-1301, USA. */
{ \
LINUX_TARGET_OS_CPP_BUILTINS(); \
builtin_assert ("machine=bigendian"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/rs6000/linux64.h egcc-CVS20050904/gcc/config/rs6000/linux64.h
--- orig/egcc-CVS20050904/gcc/config/rs6000/linux64.h 2005-07-13 21:43:24.000000000 -0400
+++ egcc-CVS20050904/gcc/config/rs6000/linux64.h 2005-09-05 09:14:58.000000000 -0400
@@ -289,7 +289,6 @@ extern int dot_symbols;
builtin_define ("__PPC64__"); \
builtin_define ("__powerpc__"); \
builtin_define ("__powerpc64__"); \
- builtin_define ("__PIC__"); \
builtin_assert ("cpu=powerpc64"); \
builtin_assert ("machine=powerpc64"); \
} \
diff -rup orig/egcc-CVS20050904/gcc/config/rs6000/sysv4.h egcc-CVS20050904/gcc/config/rs6000/sysv4.h
--- orig/egcc-CVS20050904/gcc/config/rs6000/sysv4.h 2005-08-05 21:55:59.000000000 -0400
+++ egcc-CVS20050904/gcc/config/rs6000/sysv4.h 2005-09-05 09:18:02.000000000 -0400
@@ -685,16 +685,6 @@ extern int fixuplabelno;
#define TARGET_OS_SYSV_CPP_BUILTINS() \
do \
{ \
- if (flag_pic == 1) \
- { \
- builtin_define ("__pic__=1"); \
- builtin_define ("__PIC__=1"); \
- } \
- else if (flag_pic == 2) \
- { \
- builtin_define ("__pic__=2"); \
- builtin_define ("__PIC__=2"); \
- } \
if (target_flags_explicit \
& MASK_RELOCATABLE) \
builtin_define ("_RELOCATABLE"); \
diff -rup orig/egcc-CVS20050904/gcc/config/rs6000/vxworks.h egcc-CVS20050904/gcc/config/rs6000/vxworks.h
--- orig/egcc-CVS20050904/gcc/config/rs6000/vxworks.h 2005-08-24 21:09:11.000000000 -0400
+++ egcc-CVS20050904/gcc/config/rs6000/vxworks.h 2005-09-05 09:18:37.000000000 -0400
@@ -41,16 +41,6 @@ Software Foundation, 51 Franklin Street,
builtin_define ("__VXWORKS__"); \
if (!TARGET_SOFT_FLOAT) \
builtin_define ("__hardfp"); \
- if (flag_pic == 2) \
- { \
- builtin_define ("__PIC__=2"); \
- builtin_define ("__pic__=2"); \
- } \
- else if (flag_pic == 1) \
- { \
- builtin_define ("__PIC__=1"); \
- builtin_define ("__pic__=1"); \
- } \
\
/* C89 namespace violation! */ \
builtin_define ("CPU_FAMILY=PPC"); \
diff -rup orig/egcc-CVS20050904/gcc/config/s390/linux.h egcc-CVS20050904/gcc/config/s390/linux.h
--- orig/egcc-CVS20050904/gcc/config/s390/linux.h 2005-08-12 22:53:41.000000000 -0400
+++ egcc-CVS20050904/gcc/config/s390/linux.h 2005-09-05 09:14:58.000000000 -0400
@@ -54,11 +54,6 @@ Software Foundation, 51 Franklin Street,
do \
{ \
LINUX_TARGET_OS_CPP_BUILTINS(); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/s390/tpf.h egcc-CVS20050904/gcc/config/s390/tpf.h
--- orig/egcc-CVS20050904/gcc/config/s390/tpf.h 2005-07-13 21:43:25.000000000 -0400
+++ egcc-CVS20050904/gcc/config/s390/tpf.h 2005-09-05 09:14:58.000000000 -0400
@@ -72,11 +72,6 @@ Software Foundation, 51 Franklin Street,
builtin_define_std ("tpf"); \
builtin_assert ("system=tpf"); \
builtin_define ("__ELF__"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/sh/linux.h egcc-CVS20050904/gcc/config/sh/linux.h
--- orig/egcc-CVS20050904/gcc/config/sh/linux.h 2005-06-25 22:38:00.000000000 -0400
+++ egcc-CVS20050904/gcc/config/sh/linux.h 2005-09-05 09:26:07.000000000 -0400
@@ -38,11 +38,6 @@ Boston, MA 02110-1301, USA. */
do \
{ \
LINUX_TARGET_OS_CPP_BUILTINS(); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/sh/sh.h egcc-CVS20050904/gcc/config/sh/sh.h
--- orig/egcc-CVS20050904/gcc/config/sh/sh.h 2005-08-06 21:09:48.000000000 -0400
+++ egcc-CVS20050904/gcc/config/sh/sh.h 2005-09-05 09:14:58.000000000 -0400
@@ -92,11 +92,6 @@ do { \
builtin_define ("__HITACHI__"); \
builtin_define (TARGET_LITTLE_ENDIAN \
? "__LITTLE_ENDIAN__" : "__BIG_ENDIAN__"); \
- if (flag_pic) \
- { \
- builtin_define ("__pic__"); \
- builtin_define ("__PIC__"); \
- } \
} while (0)
/* We can not debug without a frame pointer. */
diff -rup orig/egcc-CVS20050904/gcc/config/sol2.h egcc-CVS20050904/gcc/config/sol2.h
--- orig/egcc-CVS20050904/gcc/config/sol2.h 2005-08-05 21:55:58.000000000 -0400
+++ egcc-CVS20050904/gcc/config/sol2.h 2005-09-05 09:29:17.000000000 -0400
@@ -72,11 +72,6 @@ Boston, MA 02110-1301, USA. */
builtin_define ("_LARGEFILE64_SOURCE=1"); \
builtin_define ("__EXTENSIONS__"); \
} \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
TARGET_SUB_OS_CPP_BUILTINS(); \
} while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/sparc/linux.h egcc-CVS20050904/gcc/config/sparc/linux.h
--- orig/egcc-CVS20050904/gcc/config/sparc/linux.h 2005-08-06 21:09:48.000000000 -0400
+++ egcc-CVS20050904/gcc/config/sparc/linux.h 2005-09-05 09:20:14.000000000 -0400
@@ -29,11 +29,6 @@ Boston, MA 02110-1301, USA. */
builtin_assert ("system=linux"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/sparc/linux64.h egcc-CVS20050904/gcc/config/sparc/linux64.h
--- orig/egcc-CVS20050904/gcc/config/sparc/linux64.h 2005-08-06 21:09:48.000000000 -0400
+++ egcc-CVS20050904/gcc/config/sparc/linux64.h 2005-09-05 09:21:58.000000000 -0400
@@ -30,11 +30,6 @@ Boston, MA 02110-1301, USA. */
builtin_assert ("system=linux"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} \
while (0)
diff -rup orig/egcc-CVS20050904/gcc/config/xtensa/xtensa.h egcc-CVS20050904/gcc/config/xtensa/xtensa.h
--- orig/egcc-CVS20050904/gcc/config/xtensa/xtensa.h 2005-06-25 22:38:05.000000000 -0400
+++ egcc-CVS20050904/gcc/config/xtensa/xtensa.h 2005-09-05 09:15:00.000000000 -0400
@@ -90,11 +90,6 @@ extern unsigned xtensa_current_frame_siz
builtin_define (TARGET_BIG_ENDIAN ? "__XTENSA_EB__" : "__XTENSA_EL__"); \
if (!TARGET_HARD_FLOAT) \
builtin_define ("__XTENSA_SOFT_FLOAT__"); \
- if (flag_pic) \
- { \
- builtin_define ("__PIC__"); \
- builtin_define ("__pic__"); \
- } \
} while (0)
#define CPP_SPEC " %(subtarget_cpp_spec) "
diff -rup orig/egcc-CVS20050904/gcc/doc/invoke.texi egcc-CVS20050904/gcc/doc/invoke.texi
--- orig/egcc-CVS20050904/gcc/doc/invoke.texi 2005-09-01 21:53:14.000000000 -0400
+++ egcc-CVS20050904/gcc/doc/invoke.texi 2005-09-05 09:37:58.000000000 -0400
@@ -12748,6 +12748,9 @@ only on certain machines. For the 386,
but not for the Sun 386i. Code generated for the IBM RS/6000 is always
position-independent.
+When this flag is set, the macros @code{__pic__} and @code{__PIC__}
+are defined to 1.
+
@item -fPIC
@opindex fPIC
If supported for the target machine, emit position-independent code,
@@ -12758,6 +12761,9 @@ PowerPC and SPARC@.
Position-independent code requires special support, and therefore works
only on certain machines.
+When this flag is set, the macros @code{__pic__} and @code{__PIC__}
+are defined to 2.
+
@item -fpie
@itemx -fPIE
@opindex fpie