Detect if the C++ toolchain does not support -static
diff mbox

Message ID
State New
Headers show

Commit Message

Florian Weimer Oct. 23, 2015, 9:34 p.m. UTC
On 10/23/2015 08:30 PM, Roland McGrath wrote:
>> On 10/23/2015 08:19 PM, Roland McGrath wrote:
>>> Why not just clear CXX and call this a "C++ not available" case?
>> I have no preference either way.
> Then let's keep it simpler for now.  Just change the criteria in the
> configure check, and don't add any new degrees of freedom.

What about this?

It results in the following failures without libstdc++-static:

UNSUPPORTED: debug/tst-chk4
UNSUPPORTED: debug/tst-chk5
UNSUPPORTED: debug/tst-chk6
UNSUPPORTED: debug/tst-lfschk4
UNSUPPORTED: debug/tst-lfschk5
UNSUPPORTED: debug/tst-lfschk6
UNSUPPORTED: dlfcn/bug-atexit3
UNSUPPORTED: nptl/tst-cancel24
UNSUPPORTED: nptl/tst-cancel24-static
UNSUPPORTED: nptl/tst-once5
UNSUPPORTED: nptl/tst-thread_local1



Roland McGrath Oct. 23, 2015, 10:58 p.m. UTC | #1
Looks OK.

diff mbox

2015-10-23  Florian Weimer  <>

	* (CXX): Clear the variable if the C++ toolchain does
	not support static linking.
	* configure: Regenerate.

diff --git a/ b/
index e502aa5..3c7f6c0 100644
--- a/
+++ b/
@@ -57,9 +57,26 @@  AC_PROG_CXX
 # It's useless to us if it can't link programs (e.g. missing -lstdc++).
 AC_CACHE_CHECK([whether $CXX can link programs], libc_cv_cxx_link_ok, [dnl
+# Default, dynamic case.
+# Static case.
+#include <iostream>
+  std::cout << "Hello, world!";
+  return 0;
+	       [],
+	       [libc_cv_cxx_link_ok=no])
 AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=])