public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: David Wuertele <wuertele@gmail.com>
Cc: crossgcc@sourceware.org
Subject: Re: Barebones toolchain multiple definition of `_start'
Date: Sun, 05 Feb 2012 06:31:00 -0000	[thread overview]
Message-ID: <CAMKF1sqD4YNnHhOrpmmOMi3uz9pFqoqSeJvkXir3qvCDZrp66w@mail.gmail.com> (raw)
In-Reply-To: <CAJaQfj2QbXSnd9R9oEWDjZ74MUauBG+YjCgTheih=aHD_4ahvw@mail.gmail.com>

On Sat, Feb 4, 2012 at 8:27 PM, David Wuertele <wuertele@gmail.com> wrote:
> 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;
>

pass -nostartfiles  -nodefaultlibs to link step

> 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
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq

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

      reply	other threads:[~2012-02-05  6:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05  4:28 David Wuertele
2012-02-05  6:31 ` Khem Raj [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMKF1sqD4YNnHhOrpmmOMi3uz9pFqoqSeJvkXir3qvCDZrp66w@mail.gmail.com \
    --to=raj.khem@gmail.com \
    --cc=crossgcc@sourceware.org \
    --cc=wuertele@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).