From feca5e0be0d18ed2987fe714e1410673d62507db Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 3 Apr 2004 08:53:24 +0000 Subject: [PATCH] Update. 2004-03-30 H.J. Lu * Makeconfig (link-libc-static): Use $(static-gnulib) instead of $(gnulib). (libgcc_eh): New variable. (gnulib): Use it variable. (static-gnulib): New variable. * Makerules (LDLIBS-c.so): Use $(static-gnulib) instead of $(gnulib). * config.make.in (have-as-needed): New variable. * configure.in: Check if linker supports --as-needed. --- ChangeLog | 11 +++++++++++ Makeconfig | 15 +++++++++++---- Makerules | 4 ++-- config.make.in | 1 + configure.in | 16 ++++++++++++++++ nptl/ChangeLog | 5 +++++ nptl/Makefile | 3 ++- 7 files changed, 48 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a47c9f2..d546186 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-03-30 H.J. Lu + + * Makeconfig (link-libc-static): Use $(static-gnulib) instead + of $(gnulib). + (libgcc_eh): New variable. + (gnulib): Use it variable. + (static-gnulib): New variable. + * Makerules (LDLIBS-c.so): Use $(static-gnulib) instead of $(gnulib). + * config.make.in (have-as-needed): New variable. + * configure.in: Check if linker supports --as-needed. + 2004-04-02 Ulrich Drepper * sysdeps/unix/sysv/linux/internal_statvfs64.c: New file. diff --git a/Makeconfig b/Makeconfig index e0b3433..37bbb1d 100644 --- a/Makeconfig +++ b/Makeconfig @@ -504,12 +504,12 @@ endif # The static libraries. ifeq (yes,$(build-static)) -link-libc-static = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a +link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a link-extra-libs-static = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).a) else ifeq (yes,$(build-shared)) # We can try to link the programs with lib*_pic.a... -link-libc-static = $(gnulib) $(common-objpfx)libc_pic.a +link-libc-static = $(static-gnulib) $(common-objpfx)libc_pic.a link-extra-libs-static = $(link-extra-libs) endif endif @@ -517,10 +517,17 @@ link-libc-bounded = $(common-objpfx)libc_b.a $(gnulib) $(common-objpfx)libc_b.a link-extra-libs-bounded = $(foreach lib,$(LDLIBS-$(@F:%-bp=%)),$(common-objpfx)$(lib)_b.a) ifndef gnulib +ifneq ($(have-as-needed),yes) + libgcc_eh := -lgcc_eh +else + libgcc_eh := --as-needed -lgcc_s --no-as-needed +endif ifneq ($(have-cc-with-libunwind),yes) - gnulib := -lgcc -lgcc_eh + gnulib := -lgcc $(libgcc_eh) + static-gnulib := -lgcc -lgcc_eh else - gnulib := -lgcc -lgcc_eh -lunwind + gnulib := -lgcc $(libgcc_eh) -lunwind + static-gnulib := -lgcc -lgcc_eh -lunwind endif endif ifeq ($(elf),yes) diff --git a/Makerules b/Makerules index a0eb30a..72ce04a 100644 --- a/Makerules +++ b/Makerules @@ -581,8 +581,8 @@ build-shlib-objlist = $(build-module-helper-objlist) \ # Also omits crti.o and crtn.o, which we do not want # since we define our own `.init' section specially. LDFLAGS-c.so = -nostdlib -nostartfiles -# But we still want to link libc.so against $(gnulib). -LDLIBS-c.so += $(gnulib) +# But we still want to link libc.so against $(static-gnulib). +LDLIBS-c.so += $(static-gnulib) # Give libc.so an entry point and make it directly runnable itself. LDFLAGS-c.so += -e __libc_main # If lazy relocation is disabled add the -z now flag. diff --git a/config.make.in b/config.make.in index 9fd6555..e6fc6a1 100644 --- a/config.make.in +++ b/config.make.in @@ -46,6 +46,7 @@ have-z-execstack = @libc_cv_z_execstack@ have-initfini = @libc_cv_have_initfini@ have-z-relro = @libc_cv_z_relro@ have-Bgroup = @libc_cv_Bgroup@ +have-as-needed = @libc_cv_as_needed@ need-nopic-initfini = @nopic_initfini@ with-fp = @with_fp@ with-cvs = @with_cvs@ diff --git a/configure.in b/configure.in index 30cf012..1f03854 100644 --- a/configure.in +++ b/configure.in @@ -1315,6 +1315,22 @@ EOF rm -f conftest*]) AC_SUBST(libc_cv_Bgroup) + AC_CACHE_CHECK(for --as-needed option, + libc_cv_as_needed, [dnl + cat > conftest.c <&AS_MESSAGE_LOG_FD]) + then + libc_cv_as_needed=yes + else + libc_cv_as_needed=no + fi + rm -f conftest*]) + AC_SUBST(libc_cv_as_needed) + ASFLAGS_config= AC_CACHE_CHECK(whether --noexecstack is desirable for .S files, libc_cv_as_noexecstack, [dnl diff --git a/nptl/ChangeLog b/nptl/ChangeLog index ccbaef2..a441b5c 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2004-03-30 H.J. Lu + + * Makefile (link-libc-static): Use $(static-gnulib) instead of + $(gnulib). + 2004-03-30 Ulrich Drepper * sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd. diff --git a/nptl/Makefile b/nptl/Makefile index 484824f..a90c4ad 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -332,7 +332,8 @@ CFLAGS-flockfile.c = -D_IO_MTSAFE_IO CFLAGS-ftrylockfile.c = -D_IO_MTSAFE_IO CFLAGS-funlockfile.c = -D_IO_MTSAFE_IO -link-libc-static := $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a +link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \ + $(common-objpfx)libc.a ifeq ($(build-static),yes) tests-static += tst-locale1 tst-locale2 -- 2.7.4