This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[Fwd: [PATCH] Fix boehm-gc build on Cygwin]
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Sun, 17 May 2009 06:43:09 +0100
- Subject: [Fwd: [PATCH] Fix boehm-gc build on Cygwin]
Originally sent this to gcc-patches@, but it occurs to me I should maybe
send it to the java list. Ping?
-------- Original Message --------
Subject: [PATCH] Fix boehm-gc build on Cygwin
Date: Sat, 09 May 2009 18:06:59 +0100
From: Dave Korn <dave.korn.cygwin@googlemail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Hi all,
Boehm-gc doesn't currently build correctly on Cygwin; it's ok for objc, but
libjava wants to use an interface that isn't currently fully implemented:
../boehm-gc/.libs/libgcjgc_convenience.a(misc.o): In function `GC_init_inner':
/gnu/gcc/gcc/boehm-gc/misc.c:680: undefined reference to
`_GC_get_thread_stack_base'
collect2: ld returned 1 exit status
make[3]: *** [libgcj.la] Error 1
With the attached patch (which I've had in my local tree for some time now),
it not only builds (and allows libjava to build) but passes its tests:
Completed 3 tests
Allocated 5694334 collectable objects
Allocated 306 uncollectable objects
Allocated 3557803 atomic objects
Allocated 34418 stubborn objects
Finalized 6603/6603 objects - finalization is probably ok
Total number of bytes allocated is 192747548
Final heap size is 16338944 bytes
Collector appears to work
Completed 137 collections
PASS: gctest
==================
All 1 tests passed
==================
Tested by building (non-bootstrap, since this is a target lib) with
--enable-languages=c,c++,java, and running check-target-boehm-gc.
boehm-gc/ChangeLog:
* win32_threads.c (GC_get_thread_stack_base): Implement for Cygwin.
Ok?
cheers,
DaveK
Index: boehm-gc/win32_threads.c
===================================================================
--- boehm-gc/win32_threads.c (revision 147215)
+++ boehm-gc/win32_threads.c (working copy)
@@ -753,6 +753,12 @@
return result;
}
+GC_PTR GC_get_thread_stack_base()
+{
+ extern GC_PTR _tlsbase __asm__ ("%fs:4");
+ return _tlsbase;
+}
+
#else /* !CYGWIN32 */
/*