This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix linking C executables/shared libraries which use__attribute__((cleanup ()))
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Alan Modra <amodra at bigpond dot net dot au>, mark at codesourcery dot com, Gabriel Dos Reis <gdr at integrable-solutions dot net>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Apr 2004 22:23:12 +0100
- Subject: Re: [PATCH] Fix linking C executables/shared libraries which use__attribute__((cleanup ()))
- References: <20040327135002.GV15946@sunsite.ms.mff.cuni.cz><87vfk245k2.fsf@redhat.com>
Richard Sandiford <rsandifo@redhat.com> writes:
> I've verified that the check still passes on i686-pc-linux-gnu after
> this patch. Testing mips-sgi-irix6.5 bootstraps overnight.
> [...]
Tests went OK, so here's a properly-changelogged version.
Bootstrapped & regression tested on mips-sgi-irix6.5, both with
MIPSpro and binutils 2.15. OK for HEAD? How about 3.4?
Richard
* configure.ac (gcc_cv_ld_as_needed): Use AC_CACHE_CHECK.
* configure: Regenerate.
Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.6.2.12
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r2.6.2.12 configure.ac
--- configure.ac 1 Apr 2004 16:47:54 -0000 2.6.2.12
+++ configure.ac 14 Apr 2004 20:22:12 -0000
@@ -2627,8 +2627,9 @@ if test x"$gcc_cv_ld_pie" = xyes; then
fi
AC_MSG_RESULT($gcc_cv_ld_pie)
-AC_MSG_CHECKING(linker --as-needed support)
-gcc_cv_ld_as_needed=no
+AC_CACHE_CHECK(linker --as-needed support,
+gcc_cv_ld_as_needed,
+[gcc_cv_ld_as_needed=no
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
&& test $in_tree_ld_is_elf = yes; then
@@ -2640,11 +2641,11 @@ elif test x$gcc_cv_ld != x; then
gcc_cv_ld_as_needed=yes
fi
fi
+])
if test x"$gcc_cv_ld_as_needed" = xyes; then
AC_DEFINE(HAVE_LD_AS_NEEDED, 1,
[Define if your linker supports --as-needed and --no-as-needed options.])
fi
-AC_MSG_RESULT($gcc_cv_ld_as_needed)
if test x$with_sysroot = x && test x$host = x$target \
&& test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then