From owner-freebsd-ports Thu Dec 31 21:04:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA01436 for freebsd-ports-outgoing; Thu, 31 Dec 1998 21:04:20 -0800 (PST) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from terror.hungry.com (terror.hungry.com [199.181.107.40]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id VAA01431 for ; Thu, 31 Dec 1998 21:04:19 -0800 (PST) (envelope-from fn@hungry.com) Received: (qmail 15106 invoked by uid 0); 1 Jan 1999 05:03:58 -0000 Received: from siren.hungry.com (undead@199.181.107.129) by terror.hungry.com with SMTP; 1 Jan 1999 05:03:58 -0000 Received: (qmail 23016 invoked by uid 507); 1 Jan 1999 05:04:38 -0000 From: Faried Nawaz To: freebsd-ports@FreeBSD.ORG Subject: a patch for ports/devel/boehms-gc (on 3.0, against ports-current) Reply-To: Faried Nawaz Organization: Integral Domains. Date: Thu, 31 Dec 1998 21:04:38 -0800 (PST) Message-Id: <19981231210438.457102.FMU21180@siren.hungry.com> Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I see that this port is still broken in current. Here's a patch that gets it to build properly on 3.0. --- mach_dep.c_ORIG Thu Dec 31 12:30:05 1998 +++ mach_dep.c Thu Dec 31 12:45:03 1998 @@ -170,7 +170,7 @@ # if defined(I386) &&!defined(OS2) &&!defined(SVR4) &&!defined(MSWIN32) \ && !defined(SCO) && !(defined(LINUX) && defined(__ELF__)) \ - && !defined(DOS4GW) + && !defined(DOS4GW) && !(defined(FREEBSD) && defined(__ELF__)) /* I386 code, generic code does not appear to work */ /* It does appear to work under OS2, and asms dont */ /* This is used for some 38g UNIX variants and for CYGWIN32 */ @@ -183,7 +183,8 @@ asm("pushl %ebx"); asm("call _GC_push_one"); asm("addl $4,%esp"); # endif -# if defined(I386) && defined(LINUX) && defined(__ELF__) +# if defined(I386) && ((defined(LINUX) && defined(__ELF__)) || \ + (defined(FREEBSD) && defined(__ELF__))) /* This is modified for Linux with ELF (Note: _ELF_ only) */ asm("pushl %eax"); asm("call GC_push_one"); asm("addl $4,%esp"); asm("pushl %ecx"); asm("call GC_push_one"); asm("addl $4,%esp"); I believe it'll still build on 2.2.x with the above patch. On 3.0, it works, and passes the setjmp_test and gctest, but fails on the cordtest (coredump): knife# gdb -q cord/cordtest (gdb) r Starting program: /usr/ports/devel/boehm-gc/work/gc/cord/cordtest Program received signal SIGBUS, Bus error. 0x805274e in GC_find_limit (p=0xefbfd43c "\220!\005\bLô¿ï¡!\005\b", up=1) at os_dep.c:522 522 GC_noop1((word)(*result)); (gdb) where #0 0x805274e in GC_find_limit (p=0xefbfd43c "\220!\005\bLô¿ï¡!\005\b", #up=1) at os_dep.c:522 #1 0x8052795 in GC_get_stack_base () at os_dep.c:556 #2 0x80521a1 in GC_init_inner () at misc.c:444 #3 0x804ea2e in GC_generic_malloc_inner (lb=3, k=0) at malloc.c:61 #4 0x804eb7b in GC_generic_malloc (lb=3, k=0) at malloc.c:121 #5 0x804ebeb in GC_malloc_atomic (lb=3) at malloc.c:160 #6 0x804c392 in CORD_from_char_star (s=0x8055d36 "ab") at ./cord/cordxtra.c:241 #7 0x8048ced in test_basics () at ./cord/cordtest.c:51 #8 0x804a350 in main () at ./cord/cordtest.c:223 #9 0x8048b29 in _start () (gdb) This may have something to do with how boehm-gc is given values for DATAEND. Oh, another thing. I checked this exact port (for boehm-gc 4.12) on 2.2.6, and while it passed the setjmp_test and coredump test (the latter with a few leakage warnings), it leaked all over the place with the gc_test. I really really really would like this port to work, but I don't know or understand how I can find out about stacks, data segments and memory locations for them. Can someone recommend a good guide? Docs, preferably, though I can probably figure this stuff out from sources (if someone points me to the right areas). I've poked around src/lib/csu and, but am still lost. Thanks, faried. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message