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] libgomp darwin & shared only support.


Hello,

the attached patch is twofold:

First we have to add -shared-libgcc when we test c++ on darwin.

Second, and this part was already approved by rth, when we build only with shared libs we have to extend the logic in the testsuite.

Ok for main?

And btw thanks to Uros who was able to clean up the core.

Thanks,
Andreas

2007-03-22 Andreas Tobler <a.tobler@schweiz.org>

	* testsuite/lib/libgomp.exp (libgomp_init): Add -shared-libgcc for
	*-*-darwin*.
	* testsuite/libgomp.c++/c++.exp: Look for shared libstdc++ library
	and use it if found.


Index: testsuite/lib/libgomp.exp
===================================================================
--- testsuite/lib/libgomp.exp	(revision 123134)
+++ testsuite/lib/libgomp.exp	(working copy)
@@ -124,6 +124,11 @@
 	 && [check_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"
     }
Index: testsuite/libgomp.c++/c++.exp
===================================================================
--- testsuite/libgomp.c++/c++.exp	(revision 123134)
+++ testsuite/libgomp.c++/c++.exp	(working copy)
@@ -1,14 +1,30 @@
-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
 
+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
 
-if [file exists "${blddir}/${lang_test_file}"] {
+set blddir [lookfor_file [get_multilibs] libgomp]
 
+# 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"
+}
+
+if { $lang_test_file_found } {
     # Gather a list of all tests.
     set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
 

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