Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2000 11:58:00 -0500
From:      Andrew Otwell <aotwell@iss.net>
To:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: porting Linux application to FreeBSD
Message-ID:  <3A229298.9B928795@iss.net>
References:  <200011271635.eARGZQw29552@troutmask.apl.washington.edu>

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



Steve Kargl wrote:

> 
> Andrew Otwell wrote:
> >
> > A couple of you answered my first query which gave me....
> >
> > gcc -nostdinc -I/includedir -nostdlib -L/libdir source.c
> >
> > This always failed with either....
> >
> > ld: No reference to __DYNAMIC
> > collect2: ld returned 1 exit status
> >
> 
> info gcc
> 
> gcc -v -static -nostdinc -I/includedir -nostdlib source.c \
>     -L/libdir -lfirstlib -lsecondlib .... -lc
> 
> The -v flag will show you all aspects of the linking of
> your program.  The -static flags make gcc use static linking.
> The -nostdlib suppress the normal linking of libraries
> usually supplied by the system.  This means you have to
> explicitly list all libraries on the command including the
> standard C library.
> 
> --
> Steve

--
 Andrew Otwell, MSS Special Ops Recon/Surveillance/Developer
 desk 678.443.6271, aotwell@iss.net, http://www.iss.net


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?3A229298.9B928795>