unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Marion Hakanson <hakanson@easystreet.net>
To: bug-guile@gnu.org
Subject: Re: Undefined symbol _start first referenced in file .libs/libguile_la-g
Date: Sat, 17 Apr 2010 14:40:55 -0700	[thread overview]
Message-ID: <4BCA2AE7.4020901@easystreet.net> (raw)

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

Apologies for reviving an old topic.  There was no resolution posted, 
and the same problem is happening today with guile-1.8.7 on Solaris-10 
x86 platform, compiling with Sun Studio 12, all patches current as of
early March-2010.

The earlier response, archived here, gave a clue to solution:
   http://lists.gnu.org/archive/html/bug-guile/2009-03/msg00009.html

I was able to get past the problem by updating gc_os_dep.c's "#ifdef 
SUNOS5" sections with the same sections lifted out of a more recent
Boehme GC release (gc-6.8), file gcconfig.h.

Regards,

Marion

[-- Attachment #2: libguile.patch --]
[-- Type: text/x-patch, Size: 3397 bytes --]

--- libguile/gc_os_dep.c.1	Sat Apr 10 18:56:24 2010
+++ libguile/gc_os_dep.c	Sat Apr 17 13:35:43 2010
@@ -711,13 +711,17 @@
     extern int etext;
 #   ifdef SUNOS5
 #	define OS_TYPE "SUNOS5"
-	extern int _etext;
-	extern int _end;
-	extern char * GC_SysVGetDataStart();
-#       define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
-#	define DATAEND (&_end)
-#	ifndef USE_MMAP
+	extern int _etext[];
+	extern int _end[];
+	extern ptr_t GC_SysVGetDataStart();
+#       define DATASTART GC_SysVGetDataStart(0x10000, _etext)
+#	define DATAEND (_end)
+#	if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
 #	    define USE_MMAP
+	    /* Otherwise we now use calloc.  Mmap may result in the	*/
+	    /* heap interleaved with thread stacks, which can result in	*/
+	    /* excessive blacklisting.  Sbrk is unusable since it	*/
+	    /* doesn't interact correctly with the system malloc.	*/
 #	endif
 #       ifdef USE_MMAP
 #         define HEAP_START (ptr_t)0x40000000
@@ -725,10 +729,18 @@
 #	  define HEAP_START DATAEND
 #       endif
 #	define PROC_VDB
-/*	HEURISTIC1 reportedly no longer works under 2.7.  Thus we	*/
-/* 	switched to HEURISTIC2, eventhough it creates some debugging	*/
-/*	issues.								*/
-#	define HEURISTIC2
+/*	HEURISTIC1 reportedly no longer works under 2.7.  		*/
+/*  	HEURISTIC2 probably works, but this appears to be preferable.	*/
+/*	Apparently USRSTACK is defined to be USERLIMIT, but in some	*/
+/* 	installations that's undefined.  We work around this with a	*/
+/*	gross hack:							*/
+#       include <sys/vmparam.h>
+#	ifdef USERLIMIT
+	  /* This should work everywhere, but doesn't.	*/
+#	  define STACKBOTTOM USRSTACK
+#       else
+#	  define HEURISTIC2
+#       endif
 #	include <unistd.h>
 #       define GETPAGESIZE()  sysconf(_SC_PAGESIZE)
 		/* getpagesize() appeared to be missing from at least one */
@@ -802,15 +814,29 @@
 #   endif
 #   ifdef SUNOS5
 #	define OS_TYPE "SUNOS5"
-  	extern int etext, _start;
-  	extern char * GC_SysVGetDataStart();
-#       define DATASTART GC_SysVGetDataStart(0x1000, &etext)
-#	define STACKBOTTOM ((ptr_t)(&_start))
-/** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
-/*#	define PROC_VDB*/
+        extern int _etext[], _end[];
+  	extern ptr_t GC_SysVGetDataStart();
+#       define DATASTART GC_SysVGetDataStart(0x1000, _etext)
+#	define DATAEND (_end)
+/*	# define STACKBOTTOM ((ptr_t)(_start)) worked through 2.7,  	*/
+/*      but reportedly breaks under 2.8.  It appears that the stack	*/
+/* 	base is a property of the executable, so this should not break	*/
+/* 	old executables.						*/
+/*  	HEURISTIC2 probably works, but this appears to be preferable.	*/
+#       include <sys/vm.h>
+#	define STACKBOTTOM USRSTACK
+/* At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
+/* It appears to be fixed in 2.8 and 2.9.				*/
+#	ifdef SOLARIS25_PROC_VDB_BUG_FIXED
+#	  define PROC_VDB
+#	endif
 #	define DYNAMIC_LOADING
-#	ifndef USE_MMAP
+#	if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
 #	    define USE_MMAP
+	    /* Otherwise we now use calloc.  Mmap may result in the	*/
+	    /* heap interleaved with thread stacks, which can result in	*/
+	    /* excessive blacklisting.  Sbrk is unusable since it	*/
+	    /* doesn't interact correctly with the system malloc.	*/
 #	endif
 #       ifdef USE_MMAP
 #         define HEAP_START (ptr_t)0x40000000

             reply	other threads:[~2010-04-17 21:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-17 21:40 Marion Hakanson [this message]
2010-08-29 19:21 ` Undefined symbol _start first referenced in file .libs/libguile_la-g Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BCA2AE7.4020901@easystreet.net \
    --to=hakanson@easystreet.net \
    --cc=bug-guile@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).