This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch ping


Could someone please take a look at patch for

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18153

> 
> PR18153 has a wrong AC_MSG_RESULT line, should be:
> 
> AC_MSG_RESULT($gcc_cv_ld_static_dynamic)

Thanks.  Here is an updated one.


H.J.
----
2004-12-10  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/18153
	* configure.ac: Define HAVE_LD_STATIC_DYNAMIC if linker supports
	-Bstatic/-Bdynamic option.
	* config.in: Regenerated.
	* configure: Likewise.

	* gcc.c (init_spec): Pass -Bstatic/-Bdynamic to ld for static
	-lunwind if possible.

--- gcc/config.in.static	2004-10-25 17:37:13.000000000 -0700
+++ gcc/config.in	2004-10-26 10:06:38.270754696 -0700
@@ -322,6 +322,9 @@
    a read-write section. */
 #undef HAVE_LD_RO_RW_SECTION_MIXING
 
+/* Define if your linker supports -Bstatic/-Bdynamic option. */
+#undef HAVE_LD_STATIC_DYNAMIC
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
--- gcc/configure.ac.static	2004-10-25 17:37:13.000000000 -0700
+++ gcc/configure.ac	2004-10-26 10:11:49.451512210 -0700
@@ -2645,6 +2645,25 @@ if test x"$gcc_cv_ld_pie" = xyes; then
 fi
 AC_MSG_RESULT($gcc_cv_ld_pie)
 
+AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option)
+gcc_cv_ld_static_dynamic=no
+if test $in_tree_ld = yes ; then
+  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10; then
+    gcc_cv_ld_static_dynamic=yes
+  fi
+elif test x$gcc_cv_ld != x; then
+	# Check if linker supports -Bstatic/-Bdynamic option
+	if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \
+	  && $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then
+		gcc_cv_ld_static_dynamic=yes
+	fi
+fi
+if test x"$gcc_cv_ld_static_dynamic" = xyes; then
+	AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1,
+[Define if your linker supports -Bstatic/-Bdynamic option.])
+fi
+AC_MSG_RESULT($gcc_cv_ld_static_dynamic)
+
 if test x"$demangler_in_ld" = xyes; then
   AC_MSG_CHECKING(linker --demangle support)
   gcc_cv_ld_demangle=no
--- gcc/gcc.c.static	2004-09-08 08:17:29.000000000 -0700
+++ gcc/gcc.c	2004-10-26 10:21:48.880992852 -0700
@@ -1647,7 +1647,11 @@ init_spec (void)
 			    "-lgcc",
 			    "-lgcc_eh"
 #ifdef USE_LIBUNWIND_EXCEPTIONS
+# ifdef HAVE_LD_STATIC_DYNAMIC
+			    " %{!static:-Bstatic} -lunwind %{!static:-Bdynamic}"
+# else
 			    " -lunwind"
+# endif
 #endif
 			    );
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]