This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to remove USE_GNULIBC_1
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 5 Aug 2004 00:31:03 +0000 (UTC)
- Subject: Patch to remove USE_GNULIBC_1
Since all *-linux-gnulibc1 targets were obsoleted and support removed,
the USE_GNULIBC_1 conditionals in gcc/config/ can also be removed.
This patch does that.
(There is some duplication because sparc-*-linux* doesn't use
config/linux.h so config/sparc/linux.h duplicates some definitions
from config/linux.h.)
Bootstrapped with no regressions on i686-pc-linux-gnu. OK to commit?
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)
2004-08-05 Joseph S. Myers <jsm@polyomino.org.uk>
* config/linux.h, config/i386/linux.h, config/sparc/linux.h:
Remove definitions conditioned on USE_GNULIBC_1 or conditioned
out, and associated obsolete comments.
diff -rupN GCC.orig/gcc/config/i386/linux.h GCC/gcc/config/i386/linux.h
--- GCC.orig/gcc/config/i386/linux.h 2004-06-24 08:28:35.000000000 +0000
+++ GCC/gcc/config/i386/linux.h 2004-08-04 15:48:11.000000000 +0000
@@ -83,11 +83,7 @@ Boston, MA 02111-1307, USA. */
while (0)
#undef CPP_SPEC
-#ifdef USE_GNULIBC_1
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
-#else
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
-#endif
#undef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
@@ -109,11 +105,7 @@ Boston, MA 02111-1307, USA. */
/* If ELF is the default format, we should not use /lib/elf. */
#define LINK_EMULATION "elf_i386"
-#ifdef USE_GNULIBC_1
-# define DYNAMIC_LINKER "/lib/ld-linux.so.1"
-#else
-# define DYNAMIC_LINKER "/lib/ld-linux.so.2"
-#endif
+#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
@@ -153,24 +145,6 @@ Boston, MA 02111-1307, USA. */
} while (0)
#endif
-#if defined(__PIC__) && defined (USE_GNULIBC_1)
-/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
- __environ and atexit. We have to make sure they are in the .dynsym
- section. We do this by forcing the assembler to create undefined
- references to these symbols in the object file. */
-#undef CRT_CALL_STATIC_FUNCTION
-#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
- asm (SECTION_OP "\n\t" \
- "call " USER_LABEL_PREFIX #FUNC "\n" \
- TEXT_SECTION_ASM_OP "\n\t" \
- ".extern ___brk_addr\n\t" \
- ".type ___brk_addr,@object\n\t" \
- ".extern __environ\n\t" \
- ".type __environ,@object\n\t" \
- ".extern atexit\n\t" \
- ".type atexit,@function");
-#endif
-
/* Handle special EH pointer encodings. Absolute, pc-relative, and
indirect are handled automatically. */
#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
@@ -211,11 +185,11 @@ Boston, MA 02111-1307, USA. */
state data appropriately. See unwind-dw2.c for the structs. */
#ifdef IN_LIBGCC2
-/* There's no sys/ucontext.h for some (all?) libc1, so no
+/* There's no sys/ucontext.h for glibc 2.0, so no
signal-turned-exceptions for them. There's also no configure-run for
the target, so we can't check on (e.g.) HAVE_SYS_UCONTEXT_H. Using the
- target libc1 macro should be enough. */
-#if !(defined (USE_GNULIBC_1) || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0))
+ target libc version macro should be enough. */
+#if !(__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
#include <signal.h>
#include <sys/ucontext.h>
@@ -274,5 +248,5 @@ Boston, MA 02111-1307, USA. */
(FS)->retaddr_column = 8; \
goto SUCCESS; \
} while (0)
-#endif /* not USE_GNULIBC_1 */
+#endif /* not glibc 2.0 */
#endif /* IN_LIBGCC2 */
diff -rupN GCC.orig/gcc/config/linux.h GCC/gcc/config/linux.h
--- GCC.orig/gcc/config/linux.h 2004-04-28 09:42:01.000000000 +0000
+++ GCC/gcc/config/linux.h 2004-08-04 15:45:50.000000000 +0000
@@ -39,14 +39,7 @@ Boston, MA 02111-1307, USA. */
object constructed before entering `main'. */
#undef STARTFILE_SPEC
-#ifdef USE_GNULIBC_1
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-#elif defined HAVE_LD_PIE
+#if defined HAVE_LD_PIE
#define STARTFILE_SPEC \
"%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
@@ -76,26 +69,10 @@ Boston, MA 02111-1307, USA. */
#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
#undef LIB_SPEC
-/* We no longer link with libc_p.a or libg.a by default. If you
- want to profile or debug the GNU/Linux C library, please add
- -profile or -ggdb to LDFLAGS at the link time, respectively. */
-#if 1
-#ifdef USE_GNULIBC_1
-#define LIB_SPEC \
- "%{!shared: %{p:-lgmon} %{pg:-lgmon} %{profile:-lgmon -lc_p} \
- %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}"
-#else
#define LIB_SPEC \
"%{pthread:-lpthread} \
%{shared:-lc} \
%{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
-#endif
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
#define LINUX_TARGET_OS_CPP_BUILTINS() \
do { \
@@ -107,7 +84,7 @@ Boston, MA 02111-1307, USA. */
builtin_assert ("system=posix"); \
} while (0)
-#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
+#if defined(HAVE_LD_EH_FRAME_HDR)
#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif
@@ -124,8 +101,6 @@ Boston, MA 02111-1307, USA. */
/* Determine whether the the entire c99 runtime
is present in the runtime library. */
-#ifndef USE_GNULIBC_1
#define TARGET_C99_FUNCTIONS 1
-#endif
#define TARGET_HAS_F_SETLKW
diff -rupN GCC.orig/gcc/config/sparc/linux.h GCC/gcc/config/sparc/linux.h
--- GCC.orig/gcc/config/sparc/linux.h 2004-06-06 15:17:10.000000000 +0000
+++ GCC/gcc/config/sparc/linux.h 2004-08-04 15:50:56.000000000 +0000
@@ -44,12 +44,7 @@ Boston, MA 02111-1307, USA. */
object constructed before entering `main'. */
#undef STARTFILE_SPEC
-#ifdef USE_GNULIBC_1
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-#elif defined HAVE_LD_PIE
+#if defined HAVE_LD_PIE
#define STARTFILE_SPEC \
"%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
@@ -104,37 +99,15 @@ Boston, MA 02111-1307, USA. */
#define WCHAR_TYPE_SIZE 32
#undef CPP_SUBTARGET_SPEC
-#ifdef USE_GNULIBC_1
-#define CPP_SUBTARGET_SPEC \
-"%{fPIC|fPIE|fpic|fpie:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} \
-%{mlong-double-128:-D__LONG_DOUBLE_128__}"
-#else
#define CPP_SUBTARGET_SPEC \
"%{fPIC|fPIE|fpic|fpie:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} \
%{pthread:-D_REENTRANT} %{mlong-double-128:-D__LONG_DOUBLE_128__}"
-#endif
#undef LIB_SPEC
-/* We no longer link with libc_p.a or libg.a by default. If you
- want to profile or debug the GNU/Linux C library, please add
- -lc_p or -ggdb to LDFLAGS at the link time, respectively. */
-#if 1
-#ifdef USE_GNULIBC_1
-#define LIB_SPEC \
- "%{!shared: %{p:-lgmon} %{pg:-lgmon} %{profile:-lgmon -lc_p} \
- %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}"
-#else
#define LIB_SPEC \
"%{pthread:-lpthread} \
%{shared:-lc} \
%{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
-#endif
-#else
-#define LIB_SPEC \
- "%{!shared: \
- %{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
- %{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
-#endif
/* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support
for the special GCC options -static and -shared, which allow us to
@@ -153,15 +126,6 @@ Boston, MA 02111-1307, USA. */
/* If ELF is the default format, we should not use /lib/elf. */
#undef LINK_SPEC
-#ifdef USE_GNULIBC_1
-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
- %{!shared: \
- %{!ibcs: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
- %{static:-static}}}"
-#else
#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
@@ -170,7 +134,6 @@ Boston, MA 02111-1307, USA. */
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
%{static:-static}}}"
-#endif
/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
It's safe to pass -s always, even if -g is not used. */
@@ -230,7 +193,7 @@ do { \
#undef DITF_CONVERSION_LIBFUNCS
#define DITF_CONVERSION_LIBFUNCS 1
-#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
+#if defined(HAVE_LD_EH_FRAME_HDR)
#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif