All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Makefile: prevent libgcc to be linked twice
Date: Tue, 18 Oct 2011 10:30:27 +0200	[thread overview]
Message-ID: <4E9D3923.1050005@atmel.com> (raw)
In-Reply-To: <201110171325.40585.vapier@gentoo.org>

On 10/17/2011 07:25 PM, Mike Frysinger :
> On Monday 17 October 2011 09:41:15 Nicolas Ferre wrote:
>> If we define USE_PRIVATE_LIBGCC, PLATFORM_LIBS is used during
>> link. During this last link editing, libgcc may be listed twice
>> and fail.
>> Prevent this using "filter-out" in top Makefile.
> 
> could you please provide more details ?  libgcc should not be listed twice.

I compile current u-boot with the flowing command line:
make -j5 CROSS_COMPILE=arm-linux-gnueabi- USE_PRIVATE_LIBGCC=yes at91sam9m10g45ek_nandflash 

On an Ubuntu 11.10 with Linaro's cross-toolchain (targeting ARMv7). My SoC is an ARM926 so I use the "USE_PRIVATE_LIBGCC=yes" switch. This will prevent the build to take libgcc from my host but compile the u-boot embedded libgcc: everything is fine, good feature.

But, here is the final link editing stage:

UNDEF_SYM=`arm-linux-gnueabi-objdump -x board/atmel/at91sam9m10g45ek/libat91sam9m10g45ek.o api/libapi.o arch/arm/cpu/arm926ejs/at91/libat91.o arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/lib/libarm.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o drivers/mtd/nand/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/eth/libusb_eth.o drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o dri
vers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/reiserfs/libreiserfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o lib/zlib/libz.o net/libnet.o post/libpost.o | sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`; cd /home/nferre/workspace/u-boot/u-boot-git && arm-linux-gnueabi-ld  -pie -T u-boot.lds -Bstatic -Ttext 0x73f00000 $UNDEF_SYM arch/arm/cpu/arm926ejs/start.o --start-group api/libapi.o arch/arm/cpu/arm926ejs/at91/libat91.o arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/lib/libarm.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o drivers/mtd/nand
/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/eth/libusb_eth.o drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/reiserfs/libreiserfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o lib/zlib/libz.o net/libnet.o post/libpost.o board/atmel/at91sam9m10g45ek/libat91sam9m10g45ek.o --end-group /home/nferre/workspace/u-boot/u-boot-git/arch/arm/lib/eabi_compat.o /home/nferre/workspace/u-boot/u-boot-git/arch/arm/lib
/libgcc.o /home/nferre/workspace/u-boot/u-boot-git/arch/arm/lib/libgcc.o -Map u-boot.map -o u-boot


And you see that there is arch/arm/lib/libgcc.o included twice in object files that have to be linked together. I think that it is coming from the PLATFORM_LIBS variable so I modified like in my patch which solves the problem.

Best regards,
-- 
Nicolas Ferre

  reply	other threads:[~2011-10-18  8:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17 13:41 [U-Boot] [PATCH] Makefile: prevent libgcc to be linked twice Nicolas Ferre
2011-10-17 17:25 ` Mike Frysinger
2011-10-18  8:30   ` Nicolas Ferre [this message]
2011-10-18 16:06     ` Mike Frysinger
2011-10-20  8:26       ` Nicolas Ferre

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=4E9D3923.1050005@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.