aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorIain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>2009-12-22 22:11:27 +0000
committerJanis Johnson <janis@gcc.gnu.org>2009-12-22 22:11:27 +0000
commit1d32a77299d85c86579f55b6a211e27c9a7dd9d0 (patch)
tree276226950720312d163d3a137b5a15f95c8c7bd7 /libstdc++-v3
parent4e7caa34a2092e248a538e108689c8f4cfb03159 (diff)
downloadgcc-1d32a77299d85c86579f55b6a211e27c9a7dd9d0.zip
gcc-1d32a77299d85c86579f55b6a211e27c9a7dd9d0.tar.gz
gcc-1d32a77299d85c86579f55b6a211e27c9a7dd9d0.tar.bz2
re PR target/41605 (Static linking of libgcc/libgfortran/libstdc++ can cause inconsistent symbol resolution.)
2009-12-22 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk> gcc/ PR target/41605 * lib/g++.exp: Provide -B options to allow for link spec %s substitutions for static libraries. libstdc++-v3/ PR target/41605 * testsuite/libstdc++-abi/abi.exp: Provide -B options to allow for link spec %s substitutions for static libraries. * testsuite/lib/libstdc++.exp: Ditto libgomp/ PR target/41605 * testsuite/lib/libgomp.exp: Provide -B options to allow for link spec %s substitutions for static libraries. From-SVN: r155408
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp22
-rw-r--r--libstdc++-v3/testsuite/libstdc++-abi/abi.exp7
3 files changed, 32 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 217b297..117b204 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-22 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+
+ PR target/41605
+ * testsuite/libstdc++-abi/abi.exp: Provide -B options to allow for
+ link spec %s substitutions for static libraries.
+ * testsuite/lib/libstdc++.exp: Ditto
+
2009-12-22 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/std/mutex (call_once(once_flag&, _Callable, _Args&&...)):
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 9ae652f..ab4ab24 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -91,6 +91,8 @@ proc libstdc++_init { testfile } {
global target_triplet
global flags_file
global tool_timeout
+ global DEFAULT_CXXFLAGS
+ global STATIC_LIBCXXFLAGS
# We set LC_ALL and LANG to C so that we get the same error
# messages as expected.
@@ -106,6 +108,7 @@ proc libstdc++_init { testfile } {
set blddir [lookfor_file [get_multilibs] libstdc++-v3]
set flags_file "${blddir}/scripts/testsuite_flags"
+ set shlib_ext [get_shlib_extension]
v3track flags_file 2
# If a test doesn't have special options, use DEFAULT_CXXFLAGS.
@@ -114,7 +117,7 @@ proc libstdc++_init { testfile } {
# 2) might need to be negated
# In particular, some tests have to be run without precompiled
# headers, or without assertions.
- global DEFAULT_CXXFLAGS
+
if ![info exists DEFAULT_CXXFLAGS] then {
set DEFAULT_CXXFLAGS ""
# Host specific goo here.
@@ -145,7 +148,7 @@ proc libstdc++_init { testfile } {
# Locate libgomp. This is only required for parallel mode.
set v3-libgomp 0
- set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.so]
+ set libgompdir [lookfor_file $blddir/../libgomp .libs/libgomp.$shlib_ext]
if {$libgompdir != ""} {
set v3-libgomp 1
set libgompdir [file dirname $libgompdir]
@@ -156,7 +159,7 @@ proc libstdc++_init { testfile } {
# Locate libstdc++ shared library. (ie libstdc++.so.)
set v3-sharedlib 0
- set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.so]
+ set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.$shlib_ext]
if {$sharedlibdir != ""} {
if { [string match "*-*-linux*" $target_triplet] && [isnative] } {
set v3-sharedlib 1
@@ -165,6 +168,15 @@ proc libstdc++_init { testfile } {
}
v3track v3-sharedlib 3
+ set STATIC_LIBCXXFLAGS ""
+ set staticlibdir [lookfor_file $blddir src/.libs/libstdc++.a]
+ if {$staticlibdir != ""} {
+ set staticlibdir [file dirname $staticlibdir]
+ # Some targets use libstdc++.a%s in their specs, so they need a
+ # -B option for uninstalled testing.
+ set STATIC_LIBCXXFLAGS " -B${staticlibdir} "
+ }
+
# Compute what needs to be added to the existing LD_LIBRARY_PATH.
if {$gccdir != ""} {
set compiler ${gccdir}/g++
@@ -403,6 +415,7 @@ proc v3_target_compile { source dest type options } {
global cxxflags
global cxxldflags
global includes
+ global STATIC_LIBCXXFLAGS
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
lappend options "libs=${gluefile}"
@@ -412,6 +425,7 @@ proc v3_target_compile { source dest type options } {
set cxx_final $cxx
set cxxlibglossflags [libgloss_link_flags]
set cxx_final [concat $cxx_final $cxxlibglossflags]
+ set cxx_final [concat $cxx_final $STATIC_LIBCXXFLAGS]
set cxx_final [concat $cxx_final $cxxflags]
set cxx_final [concat $cxx_final $includes]
@@ -443,6 +457,7 @@ proc v3_target_compile_as_c { source dest type options } {
global blddir
global cc
global cxxflags
+ global STATIC_LIBCXXFLAGS
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
lappend options "libs=${gluefile}"
@@ -453,6 +468,7 @@ proc v3_target_compile_as_c { source dest type options } {
set cc_final $cc
set cxxlibglossflags [libgloss_link_flags]
set cc_final [concat $cc_final $cxxlibglossflags]
+ set cc_final [concat $cc_final $STATIC_LIBCXXFLAGS]
set cc_final [concat $cc_final $cxxflags]
set cc_final [concat $cc_final $includes]
regsub -all {\s[-]nostdinc[+][+]} $cc_final "" cc_final
diff --git a/libstdc++-v3/testsuite/libstdc++-abi/abi.exp b/libstdc++-v3/testsuite/libstdc++-abi/abi.exp
index ff12499..fd892a0 100644
--- a/libstdc++-v3/testsuite/libstdc++-abi/abi.exp
+++ b/libstdc++-v3/testsuite/libstdc++-abi/abi.exp
@@ -18,7 +18,12 @@
# this test. Or, hey, if we don't support this kind of symbol
# versioning test: don't run it.
-set lib $blddir/src/.libs/libstdc++.so
+if { [string match "*-*-darwin*" $target_triplet] } {
+ set lib $blddir/src/.libs/libstdc++.dylib
+} else {
+ set lib $blddir/src/.libs/libstdc++.so
+}
+
set baseline_subdir "[eval exec $cxx --print-multi-dir]"
# Build the support objects.