This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] compile libgomp.c++/pr30703.C with -shared-libgcc
The issue was handled here, at least the preconditions.
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00082.html
But it has never been discussed to an end.
I have a patch pending for darwin which should solve this, but as long
as it is not clear on how to go on with the ILP32 issue I did not submit it.
Another part is the shared lib only build. Here I already got an ok from
RTH. But I did not submit due to the above reasons.
It was a private ack.
So maybe we can find now a decision or a way top go.
The attached patch lives since jan in my repos on darwin*, linux-ppc,
sparc-solaris and HPUX PA-32-bit.
Andreas
Index: testsuite/libgomp.c++/c++.exp
===================================================================
--- testsuite/libgomp.c++/c++.exp (revision 122945)
+++ testsuite/libgomp.c++/c++.exp (working copy)
@@ -1,14 +1,34 @@
-set lang_library_path "../libstdc++-v3/src/.libs"
-set lang_test_file "${lang_library_path}/libstdc++.a"
-set lang_link_flags "-lstdc++"
-
load_lib libgomp-dg.exp
+load_gcc_lib target-supports.exp
+load_gcc_lib target-libpath.exp
+global shlib_ext
+
+set shlib_ext [get_shlib_extension]
+set lang_link_flags "-lstdc++"
+set lang_test_file_found 0
+set lang_library_path "../libstdc++-v3/src/.libs"
+
# Initialize dg.
dg-init
+
+set blddir [lookfor_file [get_multilibs] libgomp]
-if [file exists "${blddir}/${lang_test_file}"] {
+# Look for a static libstdc++ first.
+if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
+ set lang_test_file "${lang_library_path}/libstdc++.a"
+ set lang_test_file_found 1
+# We may have a shared only build, so look for a shared libstdc++.
+} elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
+ set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
+ set lang_test_file_found 1
+} else {
+ puts "No libstdc++ library found, will not execute c++ tests"
+}
+libgomp_init
+
+if { $lang_test_file_found } {
# Gather a list of all tests.
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
Index: testsuite/libgomp.fortran/fortran.exp
===================================================================
--- testsuite/libgomp.fortran/fortran.exp (revision 122945)
+++ testsuite/libgomp.fortran/fortran.exp (working copy)
@@ -6,6 +6,7 @@
# Initialize dg.
dg-init
+libgomp_init
if [file exists "${blddir}/${lang_test_file}"] {
Index: testsuite/lib/libgomp-dg.exp
===================================================================
--- testsuite/lib/libgomp-dg.exp (revision 122945)
+++ testsuite/lib/libgomp-dg.exp (working copy)
@@ -130,9 +130,12 @@
}
# We use atomic operations in the testcases to validate results.
- if [istarget i?86-*-*] {
+ if { [istarget "i?86-*-*"] && [is-effective-target ilp32] } {
lappend ALWAYS_CFLAGS "additional_flags=-march=i486"
}
+ if [istarget *-*-darwin*] {
+ lappend ALWAYS_CFLAGS "additional_flags=-shared-libgcc"
+ }
if [istarget sparc*-*-*] {
lappend ALWAYS_CFLAGS "additional_flags=-mcpu=v9"
}
@@ -160,8 +163,6 @@
global ALWAYS_CFLAGS
global GCC_UNDER_TEST
- libgomp_init
-
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
lappend options "libs=${gluefile}"
lappend options "ldflags=${wrap_flags}"
Index: testsuite/libgomp.c/c.exp
===================================================================
--- testsuite/libgomp.c/c.exp (revision 122945)
+++ testsuite/libgomp.c/c.exp (working copy)
@@ -13,6 +13,7 @@
# Initialize dg.
dg-init
+libgomp_init
# Gather a list of all tests.
set tests [lsort [find $srcdir/$subdir *.c]]