public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix libjava/cxxtest.cc testing on darwin
@ 2005-10-02 14:54 Andrew Pinski
  2005-10-02 22:24 ` Andrew Pinski
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Pinski @ 2005-10-02 14:54 UTC (permalink / raw)
  To: GCJ Patches, GCC Patches

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

Just like libffi, libjava needs the same change from -lgcc_s to
-shared-libgcc.


OK? Bootstrapped and tested on powerpc-darwin with no regressions,
plus cxxtest.cc now passes.

Thanks,
Andrew Pinski

:ADDPATCH libjava/testing:

ChangeLog:

	* testsuite/lib/jni.exp (gcj_jni_test_one): For
	darwin, use -shared-libgcc not -lgcc_s, and explain why.
	(gcj_jni_invocation_test_one): Likewise.


[-- Attachment #2: t.diff.txt --]
[-- Type: text/plain, Size: 1932 bytes --]

? t.diff.txt
Index: libjava.jni/jni.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.jni/jni.exp,v
retrieving revision 1.25
diff -u -p -r1.25 jni.exp
--- libjava.jni/jni.exp	17 Sep 2005 18:12:43 -0000	1.25
+++ libjava.jni/jni.exp	2 Oct 2005 14:50:48 -0000
@@ -131,11 +131,13 @@ proc gcj_jni_test_one {file} {
       lappend cxxflaglist "-L$cxxldlibflags"
     }
 
-    # Darwin does not yet have a libgcc_s.dylib library.
-    # So we add it here. If the libgcc_s is installed, the libstdc++
-    # would pick it up.
+    # If you're building the compiler with --prefix set to a place
+    # where it's not yet installed, then the linker won't be able to
+    # find the libgcc used by libffi.dylib.  We could pass the
+    # -dylib_file option, but that's complicated, and it's much easier
+    # to just make the linker find libgcc using -L options.
     if { [istarget "*-*-darwin*"] } {
-	lappend cxxflaglist "-lgcc_s -lstdc++"
+	lappend cxxflaglist "-shared-libgcc -lstdc++"
     } else {
 	lappend cxxflaglist "-lstdc++"
     }
@@ -243,10 +245,13 @@ proc gcj_jni_invocation_test_one {file} 
 
   set cfile [file rootname $file].c
   # Darwin needs -liconv linked, otherwise we get some unresolved.
-  # Also, like in the cxxtest we need to add -lgcc_s since Darwin
-  # has no libgcc_s.dylib installed yet.
+  # If you're building the compiler with --prefix set to a place
+  # where it's not yet installed, then the linker won't be able to
+  # find the libgcc used by libffi.dylib.  We could pass the
+  # -dylib_file option, but that's complicated, and it's much easier
+  # to just make the linker find libgcc using -L options.
   if { [istarget "*-*-darwin*"] } {
-      set cxxflags "-L../.libs -lgcc_s -lgcj -liconv"
+      set cxxflags "-L../.libs -shared-libgcc -lgcj -liconv"
   } else {
       global LIBJAVA
       if [info exists LIBJAVA] {

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

* Re: [PATCH] Fix libjava/cxxtest.cc testing on darwin
  2005-10-02 14:54 [PATCH] Fix libjava/cxxtest.cc testing on darwin Andrew Pinski
@ 2005-10-02 22:24 ` Andrew Pinski
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Pinski @ 2005-10-02 22:24 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCJ Patches, GCC Patches


On Oct 2, 2005, at 10:53 AM, Andrew Pinski wrote:

> Just like libffi, libjava needs the same change from -lgcc_s to
> -shared-libgcc.
>
>
> OK? Bootstrapped and tested on powerpc-darwin with no regressions,
> plus cxxtest.cc now passes.

I committed this after approval from Tom Tromey offline.


Thanks,
Andrew Pinski

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

end of thread, other threads:[~2005-10-02 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-02 14:54 [PATCH] Fix libjava/cxxtest.cc testing on darwin Andrew Pinski
2005-10-02 22:24 ` Andrew Pinski

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).