This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Don't handle libgcc_s suffixes
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 23 Apr 2012 14:18:02 +0000 (UTC)
- Subject: Don't handle libgcc_s suffixes
In <http://sourceware.org/ml/libc-alpha/2012-03/msg00960.html>, Roland
suggested that libgcc_s should not be needed when configuring and
building glibc (only for later use of glibc, which includes running
the testsuite).
I hope it will indeed prove to be unneeded - for most platforms at
least - that is, the -Wl,--as-needed -lgcc_s -Wl,--no-as-needed will
not be needed when linking glibc libraries because any needed unwinder
functionality (or other functionality not in a minimal static libgcc
that's built without glibc headers) is present directly in glibc or
loaded as needed with dlopen.
I propose the following first incremental step, removing support for
suffixes on the name of libgcc_s. libgcc_s suffixes were an
arrangement that *used* to be used for installing multilib versions of
the shared libgcc (they would go under names such as libgcc_s_64.so.1,
all copies in a single directory). For GCC 4.0 this changed to naming
all copies as libgcc_s.so.1 and installing them in the same
directories (lib, lib64 etc.) as other libraries for each multilib
(see <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19525>). Since GCC
versions before 4.3 are definitely not supported for building glibc,
support for libgcc_s suffixes is no longer of use, and I propose this
patch to remove it. Tested x86_64.
2012-04-23 Joseph Myers <joseph@codesourcery.com>
* configure.in (libc_cv_libgcc_s_suffix): Remove test.
(libc_cv_as_needed): Don't use $libc_cv_libgcc_s_suffix.
* configure: Regenerated.
* Makeconfig [$(have-as-needed) = yes] (libgcc_eh): Don't use
$(libgcc_s_suffix).
* config.make.in (libgcc_s_suffix): Remove variable.
diff --git a/Makeconfig b/Makeconfig
index 4fc1141..4364296 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -537,7 +537,7 @@ endif
ifneq ($(have-as-needed),yes)
libgcc_eh := -lgcc_eh $(libunwind)
else
- libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) $(libunwind) -Wl,--no-as-needed
+ libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
endif
gnulib := -lgcc $(libgcc_eh)
static-gnulib := -lgcc -lgcc_eh $(libunwind)
diff --git a/config.make.in b/config.make.in
index 54e8393..0cea3a4 100644
--- a/config.make.in
+++ b/config.make.in
@@ -50,7 +50,6 @@ have-z-combreloc = @libc_cv_z_combreloc@
have-z-execstack = @libc_cv_z_execstack@
have-Bgroup = @libc_cv_Bgroup@
have-as-needed = @libc_cv_as_needed@
-libgcc_s_suffix = @libc_cv_libgcc_s_suffix@
with-fp = @with_fp@
old-glibc-headers = @old_glibc_headers@
unwind-find-fde = @libc_cv_gcc_unwind_find_fde@
diff --git a/configure.in b/configure.in
index d8c55b1..442f8eb 100644
--- a/configure.in
+++ b/configure.in
@@ -1519,20 +1519,6 @@ fi
rm -f conftest*])
AC_SUBST(libc_cv_Bgroup)
-AC_CACHE_CHECK(for libgcc_s suffix,
- libc_cv_libgcc_s_suffix, [dnl
-cat > conftest.c <<EOF
-int main (void) { return 0; }
-EOF
-changequote(,)dnl
-libc_cv_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
- -fPIC -shared -shared-libgcc -o conftest.so \
- conftest.c -v 2>&1 >/dev/null \
- | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
-changequote([,])dnl
-rm -f conftest*])
-AC_SUBST(libc_cv_libgcc_s_suffix)
-
AC_CACHE_CHECK(for --as-needed option,
libc_cv_as_needed, [dnl
cat > conftest.c <<EOF
@@ -1540,7 +1526,7 @@ int main (void) { return 0; }
EOF
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
-fPIC -shared -o conftest.so conftest.c
- -lgcc_s$libc_cv_libgcc_s_suffix -Wl,--as-needed
+ -lgcc_s -Wl,--as-needed
-nostdlib 1>&AS_MESSAGE_LOG_FD])
then
libc_cv_as_needed=yes
--
Joseph S. Myers
joseph@codesourcery.com