This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linking Libraries?


On Thu, May 7, 2009 at 10:35 PM, Ian Lance Taylor <iant@google.com> wrote:
> You should link with m68k-elf-gcc, not with m68k-elf-ld.
>
> Try using that -v option with m68k-elf-gcc. ?That will show you
> precisely how it is invoking m68k-elf-ld. ?If you don't see -lc there,
> then add it at the end of the m68k-elf-gcc line. ?You may need to use
> -lc -lgcc -lc.

Looks like everything is in libc, so I put that one in. Adding in
libgcc didn't seem to help any. This gets me a lot closer, but there's
still 7 symbols not linking up. The strange thing is that all of those
are in libc. Why are they not linking?

Here's a dump:

m68k-elf-gcc.exe -m5200 -I../include -lc -T mcf5275.ld -v cdu.o main.o menu.o te
st.o uart.o mcf5xxx.o -o menu.elf
Using built-in specs.
Target: m68k-elf
Configured with: /scratch/maxim/fall-elf/src/gcc-4.3/configure --build=i686-pc-l
inux-gnu --host=i686-mingw32 --target=m68k-elf --enable-threads --disable-libmud
flap --disable-libssp --disable-libstdcxx-pch --with-arch=cf --disable-threads -
-with-gnu-as --with-gnu-ld --enable-languages=c,c++ --disable-shared --with-newl
ib --with-pkgversion='Sourcery G++ Lite 4.3-54' --with-bugurl=https://support.co
desourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/freescale/usr/local/gcc
-4.3.54-newlib-1.14.54/m68k-elf --with-headers=yes --with-sysroot=/opt/freescale
/usr/local/gcc-4.3.54-newlib-1.14.54/m68k-elf/m68k-elf --with-build-sysroot=/scr
atch/maxim/fall-elf/install-4.3-coldfire-elf-lite/host-i686-mingw32/m68k-elf --w
ith-libiconv-prefix=/scratch/maxim/fall-elf/obj-4.3-coldfire-elf-lite/host-libs-
4.3-54-m68k-elf-i686-mingw32/usr --with-gmp=/scratch/maxim/fall-elf/obj-4.3-cold
fire-elf-lite/host-libs-4.3-54-m68k-elf-i686-mingw32/usr --with-mpfr=/scratch/ma
xim/fall-elf/obj-4.3-coldfire-elf-lite/host-libs-4.3-54-m68k-elf-i686-mingw32/us
r --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/
scratch/maxim/fall-elf/obj-4.3-coldfire-elf-lite/tools-i686-pc-linux-gnu-4.3-54-
m68k-elf-i686-mingw32/m68k-elf/bin --with-build-time-tools=/scratch/maxim/fall-e
lf/obj-4.3-coldfire-elf-lite/tools-i686-pc-linux-gnu-4.3-54-m68k-elf-i686-mingw3
2/m68k-elf/bin
Thread model: single
gcc version 4.3.2 (Sourcery G++ Lite 4.3-54)
COMPILER_PATH=d:/program files/codesourcery/bin/../libexec/gcc/m68k-elf/4.3.2/;d
:/program files/codesourcery/bin/../libexec/gcc/;d:/program files/codesourcery/b
in/../lib/gcc/m68k-elf/4.3.2/../../../../m68k-elf/bin/
LIBRARY_PATH=d:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/;d:/pro
gram files/codesourcery/bin/../lib/gcc/;d:/program files/codesourcery/bin/../lib
/gcc/m68k-elf/4.3.2/../../../../m68k-elf/lib/;d:/program files/codesourcery/bin/
../m68k-elf/lib/
COLLECT_GCC_OPTIONS='-m5200' '-I../include' '-T' 'mcf5275.ld' '-v' '-o' 'menu.el
f'
 d:/program files/codesourcery/bin/../libexec/gcc/m68k-elf/4.3.2/collect2.exe --
sysroot=d:\program files\codesourcery\bin\../m68k-elf -o menu.elf d:/program fil
es/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/crtbegin.o -Ld:/program files/code
sourcery/bin/../lib/gcc/m68k-elf/4.3.2 -Ld:/program files/codesourcery/bin/../li
b/gcc -Ld:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/../../../../
m68k-elf/lib -Ld:/program files/codesourcery/bin/../m68k-elf/lib -lc cdu.o main.
o menu.o test.o uart.o mcf5xxx.o -lgcc -lc -lgcc d:/program files/codesourcery/b
in/../lib/gcc/m68k-elf/4.3.2/crtend.o -T mcf5275.ld
d:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/../../../../m68k-elf
/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x10): undefined reference to `sbrk'
d:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/../../../../m68k-elf
/lib\libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text+0x18): undefined reference to `write'
d:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/../../../../m68k-elf
/lib\libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text+0x10): undefined reference to `close'
d:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/../../../../m68k-elf
/lib\libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text+0x14): undefined reference to `fstat'
d:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/../../../../m68k-elf
/lib\libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text+0x10): undefined reference to `isatty'
d:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/../../../../m68k-elf
/lib\libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text+0x18): undefined reference to `lseek'
d:/program files/codesourcery/bin/../lib/gcc/m68k-elf/4.3.2/../../../../m68k-elf
/lib\libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text+0x18): undefined reference to `read'
collect2: ld returned 1 exit status
make: *** [menu.elf] Error 1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]