+2004-03-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * 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 <drepper@redhat.com>
* sysdeps/unix/sysv/linux/internal_statvfs64.c: New file.
# 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
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)
# 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.
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@
rm -f conftest*])
AC_SUBST(libc_cv_Bgroup)
+ AC_CACHE_CHECK(for --as-needed option,
+ libc_cv_as_needed, [dnl
+ cat > conftest.c <<EOF
+int main (void) { return 0; }
+EOF
+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
+ -shared -o conftest.so conftest.c
+ -Wl,--as-needed -nostdlib 1>&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
+2004-03-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile (link-libc-static): Use $(static-gnulib) instead of
+ $(gnulib).
+
2004-03-30 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/pthread-functions.h: Add ptr__nptl_deallocate_tsd.
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