* Problem with compiling and linking separately
@ 1999-07-19 18:07 Ringeman, Tim
1999-07-19 18:27 ` David Edelsohn
0 siblings, 1 reply; 2+ messages in thread
From: Ringeman, Tim @ 1999-07-19 18:07 UTC (permalink / raw)
I am running the embedded-2.2.5 kernel on a MBX860 board and using
http://members.home.net/mmporter/binutils-powerpc-linux-2.9.1.0.15-2.i386.rp
m
http://members.home.net/mmporter/egcs-powerpc-linux-1.1.1-2.i386.rpm
ftp://sourceware.cygnus.com/pub/glibc/glibc-2.1.tar.gz
ftp://sourceware.cygnus.com/pub/glibc/glibc-linuxthreads-2.1.tar.gz
ftp://ftp.funet.fi/pub/gnu/funet/glibc-crypt-2.1.tar.gz
When I try to compile and link seperately I get the following errors:
[root@ngdtst06 bin]# powerpc-linux-gcc -c hello.c
[root@ngdtst06 bin]# powerpc-linux-ld hello.o
powerpc-linux-ld: warning: cannot find entry symbol _start; defaulting to
01800074
hello.o: In function `main':
hello.o(.text+0x20): undefined reference to `printf'
[root@ngdtst06 bin]# powerpc-linux-ld hello.o -lc
powerpc-linux-ld: warning: cannot find entry symbol _start; defaulting to
01800188
[root@ngdtst06 bin]# powerpc-linux-ld hello.o -lc -static
powerpc-linux-ld: warning: cannot find entry symbol _start; defaulting to
01800188
When I link against the shared libraries as such:
[root@ngdtst06 bin]# powerpc-linux-ld hello.o -lc -shared
it links but when I try to run it on the board, it hangs.
Any idea how I could get this to work?
Thanks,
Tim
Tim Ringeman
Gilbarco Inc.
Telephone 336-547-5946
e-mail: tim_ringeman@gilbarco.com
http://www.gilbarco.com
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problem with compiling and linking separately
1999-07-19 18:07 Problem with compiling and linking separately Ringeman, Tim
@ 1999-07-19 18:27 ` David Edelsohn
0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 1999-07-19 18:27 UTC (permalink / raw)
To: Ringeman, Tim; +Cc: linuxppc-dev
You should be using the compiler, powerpc-linux-gcc, to perform
the link regardless of whether you are performing the link in a separate
step. The link step involves more than just -lc. You are omitting
important, additional commands to the linker by trying to invoke the
linker directly. Either use GCC for the link or look at the verbose
output of GCC and learn the additional flags and libraries and object
files that must be passed to the linker. For instance, you are omitting
the crt0 start files.
David
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-07-19 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-07-19 18:07 Problem with compiling and linking separately Ringeman, Tim
1999-07-19 18:27 ` David Edelsohn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).