[Gc] Re: [Fwd: [PATCH] Fix boehm-gc build on Cygwin]

Boehm, Hans hans.boehm at hp.com
Mon May 18 15:47:34 PDT 2009


Unles someone can think of a reason this is silly, I'll check the following into the upstream sources, so that
we at least don't lose the code.  I suspect that what we currently do is worse.

Note that this currently just removes some obsolete comments which appear to be inaccurate, and adds
ifdef'ed out code, which would need to be tested and enabled under the right conditions.

Hans.

Index: os_dep.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/os_dep.c,v
retrieving revision 1.36
diff -u -r1.36 os_dep.c
--- os_dep.c	16 Mar 2009 23:53:10 -0000	1.36
+++ os_dep.c	18 May 2009 22:40:45 -0000
@@ -621,12 +621,6 @@
 #   endif
 # endif
 
-/* 
- * Find the base of the stack. 
- * Used only in single-threaded environment.
- * With threads, GC_mark_roots needs to know how to do this.
- * Called with allocator lock held.
- */
 # if defined(MSWIN32) || defined(MSWINCE) \
        || (defined(CYGWIN32) && !defined(USE_MMAP))
 # define is_writable(prot) ((prot) == PAGE_READWRITE \
@@ -665,6 +659,19 @@
     return GC_SUCCESS;
 }
 
+#if 0
+
+/* An alternate version for Cygwin might be		*/
+/* (adapted from Dave Korn for gcc version, untested):  */
+GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb)
+{
+  extern GC_PTR _tlsbase __asm__ ("%fs:4");
+  sb -> mem_base = _tls_base;
+  return GC_SUCCESS;
+}
+
+#endif /* 0 */
+
 #define HAVE_GET_STACK_BASE
 
 /* This is always called from the main thread.	*/

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Dave Korn
> Sent: Sunday, May 17, 2009 5:13 AM
> To: Ivan Maidanski
> Cc: Andrew Haley; gc at napali.hpl.hp.com; Dave Korn
> Subject: [Gc] Re: [Fwd: [PATCH] Fix boehm-gc build on Cygwin]
> 
> Ivan Maidanski wrote:
> > Hi!
> 
>   Hi upstream!
> 
> > Andrew Haley <aph at redhat.com> wrote:
> >> OK to commit?
> > 
> >> Andrew.
> > 
> > Dave Korn <dave.korn.cygwin at googlemail.com> wrote:
> >> 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
> > 
> > What's GC version? I guess prior to 6.8 
> (GC_get_thread_stack_base is 
> > not used at present).
> 
>   Yes, it's the version in-tree in GCC.  I took a look at the 
> cvsweb at sourceforge (bdwgc) and it looked to me like the 
> function had been eliminated on your HEAD which is why I only 
> sent it to gcc lists.
> 
> > Not sure for CVS version but with my pending patches, it could be 
> > built for Cygwin and works
> 
>   Andrew, I'd much rather add this trivial patch to our 
> in-tree version than think about importing a new version and 
> disturbing every target under the sun, can we just fix it locally?
> 
>     cheers,
>       DaveK
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 


More information about the Gc mailing list