Commit dc316086 by Peter S. Mazinger Committed by Zack Weinberg

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
parent 8ef36086
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.
2004-11-11 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Save PIC
......
......@@ -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
......
......@@ -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) \
......
......@@ -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"
......
......@@ -56,8 +56,11 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
LINUX_TARGET_OS_CPP_BUILTINS(); \
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. */
......
......@@ -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 \
......
......@@ -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
......
......@@ -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} \
"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment