public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH RFA: Build system: Check for -static-libstdc++
@ 2010-11-03  4:39 Ian Lance Taylor
  2010-11-03  6:12 ` Ralf Wildenhues
  2010-11-03 17:36 ` Mike Stump
  0 siblings, 2 replies; 12+ messages in thread
From: Ian Lance Taylor @ 2010-11-03  4:39 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

The -static-libstdc++ option was added to g++ in the gcc 4.5 release.
The Go frontend wants to use it when linking, so that the Go frontend is
independent of the installed libstdc++.so.  This is particularly useful
when bootstrapping, and is generally desirable as it permits moving the
compiler around.

This patch to gcc/configure.ac checks whether $(CXX) supports
-static-libstdc++, and sets a variable in Makefile.in.  This is not used
yet, but it will be used by the Go frontend when it goes in.

Bootstrapped on x86_64-unknown-linux-gnu.  OK for mainline?

Ian


2010-11-02  Ian Lance Taylor  <iant@google.com>

	* configure.ac: Set and substitute STATIC_LIBSTDCXX.
	* Makefile.in (STATIC_LIBSTDCXX): New variable.
	* configure: Rebuild.



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: static --]
[-- Type: text/x-diff, Size: 1285 bytes --]

Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 166230)
+++ gcc/configure.ac	(working copy)
@@ -4497,6 +4497,22 @@ done
 # UNSORTED
 # --------
 
+# Test whether $CXX supports -static-libstdc++
+AC_CACHE_CHECK([whether $CXX supports -static-libstdc++],
+	gcc_cv_cxx_supports_static_libstdcxx,
+	[if $CXX -static-libstdc++ 2>&1 >/dev/null | 
+	    grep 'unrecognized option' >/dev/null; then
+	   gcc_cv_cxx_supports_static_libstdcxx=no
+	 else
+	   gcc_cv_cxx_supports_static_libstdcxx=yes
+	 fi])
+if test "$gcc_cv_cxx_supports_static_libstdcxx" = yes; then
+  STATIC_LIBSTDCXX=-static-libstdc++
+else
+  STATIC_LIBSTDCXX=
+fi
+AC_SUBST(STATIC_LIBSTDCXX)
+
 # Create .gdbinit.
 
 echo "dir ." > .gdbinit
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 166230)
+++ gcc/Makefile.in	(working copy)
@@ -233,6 +233,10 @@ LINKER_FLAGS = $(CFLAGS)
 endif
 endif
 
+# This is set by the configure script to be -static-libstdc++ if
+# $(CXX) supports the option.
+STATIC_LIBSTDCXX = @STATIC_LIBSTDCXX@
+
 # -------------------------------------------
 # Programs which operate on the build machine
 # -------------------------------------------

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-11-03 21:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-03  4:39 PATCH RFA: Build system: Check for -static-libstdc++ Ian Lance Taylor
2010-11-03  6:12 ` Ralf Wildenhues
2010-11-03 14:31   ` Ian Lance Taylor
2010-11-03 19:26     ` Ralf Wildenhues
2010-11-03 17:36 ` Mike Stump
2010-11-03 17:44   ` Ian Lance Taylor
2010-11-03 18:32     ` H.J. Lu
2010-11-03 18:56       ` Ian Lance Taylor
2010-11-03 21:10         ` Richard Guenther
2010-11-03 21:37           ` Ian Lance Taylor
2010-11-03 21:30         ` Dave Korn
2010-11-03 21:52           ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).