From owner-freebsd-hackers Sun Sep 17 22:12: 7 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from iclub.nsu.ru (iclub.nsu.ru [193.124.222.66]) by hub.freebsd.org (Postfix) with ESMTP id CFF4137B424 for ; Sun, 17 Sep 2000 22:11:17 -0700 (PDT) Received: from localhost (fjoe@localhost) by iclub.nsu.ru (8.9.3/8.9.3) with ESMTP id MAA05195; Mon, 18 Sep 2000 12:10:46 +0700 (NSS) (envelope-from fjoe@iclub.nsu.ru) Date: Mon, 18 Sep 2000 12:10:46 +0700 (NSS) From: Max Khon To: John Polstra Cc: hackers@freebsd.org Subject: Re: Trouble with dynamic loading of C++ libs in PHP v4.02 on FreeBSD 4.1 In-Reply-To: <200009160037.RAA06418@vashon.polstra.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, there! On Fri, 15 Sep 2000, John Polstra wrote: > Here is another possibility: we could call _thread_init() from > crt1.o. The patch (untested) is below. It calls _thread_init() if > and only if that symbol is defined -- i.e., libc_r is linked in. > What do you think about this solution? > > Index: crt1.c > =================================================================== > RCS file: /home/ncvs/src/lib/csu/i386-elf/crt1.c,v > retrieving revision 1.4 > diff -u -r1.4 crt1.c > --- crt1.c 1999/08/27 23:57:57 1.4 > +++ crt1.c 2000/09/16 00:30:51 > @@ -48,6 +48,9 @@ > extern int _DYNAMIC; > #pragma weak _DYNAMIC > > +extern void _thread_init(void); > +#pragma weak _thread_init > + > #ifdef __i386__ > #define get_rtld_cleanup() \ > ({ fptr __value; \ > @@ -91,6 +94,8 @@ > #ifdef GCRT > monstartup(&eprol, &etext); > #endif > + if (&_thread_init != NULL) > + _thread_init(); > _init(); > exit( main(argc, argv, env) ); > } > seems ok to me but can we do this from `do_ctors' or `_init' -- they are located in common/ /fjoe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message