This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Barebones toolchain multiple definition of `_start'


Nvidia's Tegra PDK comes with a toolchain from CodeSourcery for
building their bootloader.  gcc --version reports:

  arm-none-eabi-gcc (Sourcery G++ Lite 2009q3-68) 4.4.1

The CodeSourcery toolchain works fine.  But I wanted to try ct-ng.
I used menuconfig to set up a barebones toolchain and built it.
I've attached .config.2.   gcc --version reports:

  arm-crosstool-eabi-gcc (crosstool-NG 1.14.0) 4.4.6

I specified the toolchain to the bootloader
makefile, and all seemed to work, except for the final link:

$X_TOOLS/arm-crosstool-eabi/bin/arm-crosstool-eabi-gcc
-Wl,-Tmake/cop.ldscript -Wl,-Map=_out/debug_p852/images/cop_stage1.map
-L$X_TOOLS/arm-crosstool-eabi/arm-crosstool-eabi/sysroot/lib/armv4t
arch/tegra2/core/_out/debug_p852_cop_stage1/cop_init.o
${STAGE2_FILES_OUT} -Wl,--whole-archive
arch/tegra2/core/_out/debug_p852_cop_stage1/libtegra2core.a
(lots more .a files skipped for brevity)
-Wl,--no-whole-archive -Wl,--gc-sections -o
_out/debug_p852/images/cop_stage;

arch/tegra2/core/_out/debug_p852_cop_stage1/cop_init.o: In function
`_start': cop_init.c:(.startup+0x0): multiple definition of `_start'
$X_TOOLS/arm-crosstool-eabi/lib/gcc/arm-crosstool-eabi/4.4.6/../../../../
arm-crosstool-eabi/lib/crt0.o:$CROSSTOOL/.build/src/newlib-1.17.0/libgloss/arm/crt0.S:83:
first defined here
$X_TOOLS/arm-crosstool-eabi/lib/gcc/arm-crosstool-eabi/4.4.6/../../../../
arm-crosstool-eabi/lib/crt0.o:
In function `start': (.text+0xe0): undefined reference to `main'
$X_TOOLS/arm-crosstool-eabi/lib/gcc/arm-crosstool-eabi/4.4.6/../../../../
arm-crosstool-eabi/lib/libc.a(lib_a-exit.o):
In function `exit':
$CROSSTOOL/.build/src/newlib-1.17.0/newlib/libc/stdlib/exit.c:65:
undefined reference to `_exit'
$X_TOOLS/arm-crosstool-eabi/lib/gcc/arm-crosstool-eabi/4.4.6/../../../../
arm-crosstool-eabi/lib/libc.a(lib_a-sbrkr.o):
In function `_sbrk_r':
$CROSSTOOL/.build/src/newlib-1.17.0/newlib/libc/reent/sbrkr.c:60:
undefined reference to `_sbrk' collect2: ld returned 1 exit status

The only thing I changed was the toolchain.  Why would the ct-ng
toolchain have this problem while CodeSourcery does not?

Dave

Attachment: dot-config
Description: Binary data

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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