Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Apr 1998 21:20:11 -0800 (PST)
From:      "Jason K. Fritcher" <fritcher@calweb.com>
To:        John Birrell <jb@cimlogic.com.au>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: pthread question
Message-ID:  <Pine.BSF.3.95q.980402203921.16255A-100000@web2.calweb.com>
In-Reply-To: <199804030315.NAA15959@cimlogic.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.980402203921.16255A-100000>