Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2000 19:52:47 +0200 (SAST)
From:      Robert Nordier <rnordier@siri.nordier.com>
To:        aotwell@iss.net (Andrew Otwell)
Cc:        hackers@freebsd.org
Subject:   Re: porting Linux application to FreeBSD
Message-ID:  <200011271752.eARHqm801966@siri.nordier.com>
In-Reply-To: <3A229298.9B928795@iss.net> from "Andrew Otwell" at Nov 27, 2000 11:58:00 AM

next in thread | previous in thread | raw e-mail | index | archive | help
Andrew Otwell wrote:
 
> same problem. I'm trying though....
> 
> bash-2.03$ gcc -static -nostdlib -L/usr/lib \
> > -lalias -lalias_p -lc -lc_p -lc_pic -lcalendar -lcalendar_p -lcom_err -lcom_err_p \
> > -lcompat -lcompat_p -lcrypt -lcrypt_p -lcurses -lcurses_p \
> > -ldialog -ldialog_p -ldisk -ledit -ledit_p -lf2c -lf2c_p -lfl -lfl_p -lftpio \
> > -lftpio_p -lg++ -lg++_p -lgcc -lgcc_p -lgcc_pic -lgmp -lgmp_p \
> > -lgnuregex -lgnuregex_p -lipx -lipx_p -lkeycap -lkeycap_p -lkvm \
> > -lkvm_p -ll -ll_p -lln -lln_p -lm -lm_p -lmd -lmd_p -lmp -lmp_p -lmytinfo \
> > -lmytinfo_p -lncurses -lncurses_p -lobjc -lobjc_p -lopie -lopie_p \
> > -lpcap -lpcap_p -lreadline -lreadline_p -lrpcsvc -lrpcsvc_p -lscrypt \
> > -lscrypt_p -lscsi -lscsi_p -lskey -lskey_p -lss -lss_p -lstdc++ -lstdc++_p 
> > -ltelnet -ltelnet_p -ltermcap -ltermcap_p -ltermlib -ltermlib_p \
> > -lutil -lutil_p -lvgl -lvgl_p -lxpg4 -lxpg4_p -ly -ly_p -lz -lz_p \
> > test2.c
> >/var/tmp/ccaCTG6m.o: Undefined symbol `___main' referenced from text segment
> >/var/tmp/ccaCTG6m.o: Undefined symbol `_printf' referenced from text segment
> >/var/tmp/ccaCTG6m.o: Undefined symbol `_printf' referenced from text segment
> >collect2: ld returned 1 exit status
> bash-2.03$ 

From the look of it, either your toolchain is mis-configured or
you're generating the wrong object format.

You should be seeing something like this (note lack of underscore):

    /tmp/ccmb1952.o: In function `main':
    /tmp/ccmb1952.o(.text+0xf): undefined reference to `printf'

I think you mentioned somewhere you're generating ELF (not a.out);
if so, your compiler is not doing the right thing for external
symbols.  What appeared in FreeBSD a.out libraries as "_printf" is
plain "printf" in ELF.  There is no "_printf" symbol in the standard
FreeBSD libc, nowadays.

--
Robert Nordier

rnordier@nordier.com
rnordier@FreeBSD.org


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?200011271752.eARHqm801966>