From owner-freebsd-hackers Thu Apr 2 21:20:24 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA19019 for freebsd-hackers-outgoing; Thu, 2 Apr 1998 21:20:24 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from mail.calweb.com (mail.calweb.com [208.131.56.12]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA19013 for ; Thu, 2 Apr 1998 21:20:19 -0800 (PST) (envelope-from fritcher@calweb.com) Received: by mail.calweb.com (8.8.6/8.8.6) with SMTP id VAA26976; Thu, 2 Apr 1998 21:20:11 -0800 (PST) X-SMTP: helo web2.calweb.com from fritcher@calweb.com server fritcher@web2.calweb.com ip 208.131.56.52 Date: Thu, 2 Apr 1998 21:20:11 -0800 (PST) From: "Jason K. Fritcher" To: John Birrell cc: hackers@FreeBSD.ORG Subject: Re: pthread question In-Reply-To: <199804030315.NAA15959@cimlogic.com.au> 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 On Fri, 3 Apr 1998, John Birrell wrote: > Jason K. Fritcher wrote: > > [jkf@outreach:~/src/thread]$ gcc -g -D_THREAD_SAFE -o blah.o -c blah.c > > [jkf@outreach:~/src/thread]$ ld -Bstatic /usr/lib/crt0.o blah.o -lc_r > > blah.c:11: Undefined symbol `___main' referenced from text segment > > > > Does it normally look for ___main? I always thought it was just _main, or > > __main. Never seen it use three _'s for main before. > > That's because when you use gcc to run ld, it knows to add crt0.o (or > scrt0.o) and libgcc (which is where __main lives). When I said that I > issue the compile and link commands separately, I should have explained > that I still use gcc so that it adds the startfile and standard libraries. Acutally, that did it. I added -lgcc to the end of the ld line, and it linked perfectly. I don't know why gcc couldn't do this by itself, but it works this way. Thanx. :) -------------------------------------------------------------------------- Jason K. Fritcher Sr. Technical Support fritcher@calweb.com Calweb Internet Services http://www.calweb.com/ 916-641-9320 -------------------------------------------------------------------------- Bits/KeyID Date Fingerprint 2048/C6663B59 1997/07/11 D3678FFC53D4EA7E 19329F41812F0F58 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message