From owner-freebsd-commit Thu Feb 1 14:19:23 1996 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id OAA05640 for freebsd-commit-outgoing; Thu, 1 Feb 1996 14:19:23 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id OAA05626 for cvs-all-outgoing; Thu, 1 Feb 1996 14:19:09 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id OAA05614 for cvs-lib-outgoing; Thu, 1 Feb 1996 14:19:05 -0800 (PST) Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id OAA05589 Thu, 1 Feb 1996 14:18:12 -0800 (PST) Received: from YAZ-PISTACHIO.MIT.EDU by MIT.EDU with SMTP id AA22490; Thu, 1 Feb 96 17:17:33 EST Received: by yaz-pistachio.MIT.EDU (5.57/4.7) id AA07409; Thu, 1 Feb 96 17:17:42 -0500 Message-Id: <9602012217.AA07409@yaz-pistachio.MIT.EDU> To: Peter Wemm Cc: John Polstra , nate@sri.MT.net, CVS-committers@freebsd.org, cvs-lib@freebsd.org, proven@MIT.EDU Subject: Re: cvs commit: src/lib/csu/i386 crt0.c In-Reply-To: Your message of "Thu, 01 Feb 1996 17:30:23 +0800." <199602010930.RAA13154@jhome.DIALix.COM> Date: Thu, 01 Feb 1996 17:17:41 EST From: Christopher Provenzano Sender: owner-commit@freebsd.org Precedence: bulk Since the bootstrapping problem is a basic mess. Might I suggest using what pthreads has done. Make a c++ constructor in the library that is called when the program is initialized. It removes the problem of having to deal with crt0.o at all. Here is how pthreads does it. init.cc extern "C" void pthread_init (void); struct __pthread_init_hack_t { __pthread_init_hack_t () { pthread_init (); } }; __pthread_init_hack_t __pthread_init_hack_x; char __pthread_init_hack = 42; In any one file that is always linked in with the library eg signal.c /* This will force init.o to get dragged in; if you've got support for C++ initialization, that'll cause pthread_init to be called at program startup automatically, so the application won't need to call it explicitly. */ extern char __pthread_init_hack; char *__pthread_init_hack_2 = &__pthread_init_hack; CAP