This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: C Start-Up shared vs static
On Dec 4, 2009, at 5:32 PM, Mike Frysinger wrote:
On Friday 04 December 2009 15:40:25 Charles Coldwell wrote:
Inspired by what I read in the linker script /usr/lib/libc.so.6, I
tried
replacing "-lc" in the command line above with
/Volumes/cross/arm-none-linux/lib/libc.so.6
/Volumes/cross/arm-none-linux/usr/lib/libc_nonshared.a
--as-needed
/Volumes/cross/arm-none-linux/lib/ld-linux.so.2
--no-as-needed
This works, and builds an executable that runs on my target
system. So it
would appear that all the binaries are in the right places, and
contain
the right bits, but the gcc driver routines aren't using them
correctly.
Could this be a problem in gcc specs?
more likely a problem with your install and/or configure. your
/Volumes/cross/arm-none-linux/ needs to be configured as the
toolchain's
sysroot.
Oh, but in the part of my message above that you snipped was the
complete command
$ arm-none-linux-gcc -v -march=armv5te -mtune=xscale -msoft-float -o
hello hello.o
[ ... ]
/Volumes/cross/usr/libexec/gcc/arm-none-linux/4.3.3/collect2
--sysroot=/Volumes/cross/arm-none-linux --eh-frame-hdr -dynamic-linker
/lib/ld-linux.so.2 -X -m armelf_linux -p -o hello
/Volumes/cross/usr/lib/gcc/arm-none-linux/4.3.3/../../../../arm-none-
linux/lib/crt1.o
/Volumes/cross/usr/lib/gcc/arm-none-linux/4.3.3/../../../../arm-none-
linux/lib/crti.o
/Volumes/cross/usr/lib/gcc/arm-none-linux/4.3.3/crtbegin.o
-L/Volumes/cross/usr/lib/gcc/arm-none-linux/4.3.3
-L/Volumes/cross/usr/lib/gcc/arm-none-linux/4.3.3/../../../../arm-
none-linux/lib
-L/Volumes/cross/arm-none-linux/lib
-L/Volumes/cross/arm-none-linux/usr/lib
hello.o -ldl -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-
needed -lgcc_s --no-as-needed
/Volumes/cross/usr/lib/gcc/arm-none-linux/4.3.3/crtend.o
/Volumes/cross/usr/lib/gcc/arm-none-linux/4.3.3/../../../../arm-none-
linux/lib/crtn.o
[ ... ]
And doesn't the "--sysroot=/Volumes/cross/arm-none-linux" switch on
the collect2 command above do what you recommend?
--
Charles M. Coldwell, W1CMC
"Turn on, log in, tune out"
Winchester, Massachusetts, New England (FN42kk)
GPG ID: 852E052F
GPG FPR: 77E5 2B51 4907 F08A 7E92 DE80 AFA9 9A8F 852E 052F