diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-04-29 23:17:39 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-04-29 23:17:39 +0000 |
commit | 98377020572b2999771e89b3368d5772492603cc (patch) | |
tree | 8236d755cdfd0bd8f20fa168a0b84910ddbdf8f9 | |
parent | abb501e6a313c7d79698b03a9ff9fd0a9da3bd2e (diff) | |
download | px4-nuttx-98377020572b2999771e89b3368d5772492603cc.tar.gz px4-nuttx-98377020572b2999771e89b3368d5772492603cc.tar.bz2 px4-nuttx-98377020572b2999771e89b3368d5772492603cc.zip |
Fix objcopy problem with newer toolchains
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1746 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/ChangeLog | 5 | ||||
-rw-r--r-- | nuttx/Documentation/NuttX.html | 5 | ||||
-rw-r--r-- | nuttx/Makefile | 6 | ||||
-rw-r--r-- | nuttx/TODO | 7 | ||||
-rw-r--r-- | nuttx/arch/arm/src/Makefile | 4 | ||||
-rw-r--r-- | nuttx/configs/mcu123-lpc214x/nsh/Make.defs | 8 | ||||
-rw-r--r-- | nuttx/configs/mcu123-lpc214x/ostest/Make.defs | 8 | ||||
-rw-r--r-- | nuttx/configs/mcu123-lpc214x/usbserial/Make.defs | 8 | ||||
-rw-r--r-- | nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs | 8 | ||||
-rw-r--r-- | nuttx/configs/olimex-strp711/ostest/Make.defs | 10 |
10 files changed, 56 insertions, 13 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index ba377d494..e2c3431b1 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -707,3 +707,8 @@ * SPI: Add a method to set the number of bits per word. Also add an alternative interface for so that (eventually) I can phase the sndblock and recvblock methods and replace them with a single exchange method + * Build: objcopy fails with toolchains that use newer GCC and binutils. The + following arguments need to be included in the objcopy command line "-R .note + -R .note.gnu.build-id -R .comment" This has bin fixed in arch/arm/src/Makefile, + but other architectures may have the same problem. Thanks to Dave Marples + for verifying this. diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index d20111112..d779698a2 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -1393,6 +1393,11 @@ nuttx-0.4.6 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> * SPI: Add a method to set the number of bits per word. Also add an alternative interface for so that (eventually) I can phase the sndblock and recvblock methods and replace them with a single exchange method + * Build: objcopy fails with toolchains that use newer GCC and binutils. The + following arguments need to be included in the objcopy command line "-R .note + -R .note.gnu.build-id -R .comment" This has bin fixed in arch/arm/src/Makefile, + but other architectures may have the same problem. Thanks to Dave Marples + for verifying this. pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/Makefile b/nuttx/Makefile index e1cd92333..d72aa48b8 100644 --- a/nuttx/Makefile +++ b/nuttx/Makefile @@ -245,13 +245,13 @@ ifeq ($(CONFIG_RRLOAD_BINARY),y) fi endif ifeq ($(CONFIG_INTELHEX_BINARY),y) - @$(OBJCOPY) -O ihex $(TOPDIR)/$@ $(TOPDIR)/$@.ihx + @$(OBJCOPY) $(OBJCOPYARGS) -O ihex $(TOPDIR)/$@ $(TOPDIR)/$@.ihx endif ifeq ($(CONFIG_MOTOROLA_SREC),y) - @$(OBJCOPY) -O srec $(TOPDIR)/$@ $(TOPDIR)/$@.srec + @$(OBJCOPY) $(OBJCOPYARGS) -O srec $(TOPDIR)/$@ $(TOPDIR)/$@.srec endif ifeq ($(CONFIG_RAW_BINARY),y) - @$(OBJCOPY) -O binary $(TOPDIR)/$@ $(TOPDIR)/$@.bin + @$(OBJCOPY) $(OBJCOPYARGS) -O binary $(TOPDIR)/$@ $(TOPDIR)/$@.bin endif depend: diff --git a/nuttx/TODO b/nuttx/TODO index 1007989d1..af3018b61 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -366,13 +366,6 @@ o Build system Status: Open Priority: Medium-low - Descripton I am having trouble using the newer gcc 4.2.4 + binutils 2.19 - toolchain for ARM. The problem is in arch/arm/src/Makefile: - In the call to objcopy to relocate the .data section, arm-elf-objcopy - dies with a 'Floating point exception' No clue to the cause yet. - Status: Open - Priority: Medium-Low -- workaroung, stick with the 3.4.6 toolchain - o NuttShell (NSH) (examples/nsh) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile index a320cdb31..41ef077b5 100644 --- a/nuttx/arch/arm/src/Makefile +++ b/nuttx/arch/arm/src/Makefile @@ -85,7 +85,7 @@ nuttx: $(HEAD_AOBJ) board/libboard$(LIBEXT) --start-group $(LDLIBS) -lboard --end-group $(EXTRA_LIBS) $(LIBGCC) ifeq ($(CONFIG_BOOT_RUNFROMFLASH),y) @export flashloc=`$(OBJDUMP) --all-headers $(TOPDIR)/$@ | grep _eronly | cut -d' ' -f1`; \ - $(OBJCOPY) --adjust-section-vma=.data=0x$$flashloc $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage + $(OBJCOPY) $(OBJCOPYARGS) --adjust-section-vma=.data=0x$$flashloc $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage @mv $(TOPDIR)/$@.flashimage $(TOPDIR)/$@ endif @$(NM) $(TOPDIR)/$@ | \ @@ -93,7 +93,7 @@ endif sort > $(TOPDIR)/System.map @export vflashstart=`$(OBJDUMP) --all-headers $(TOPDIR)/$@ | grep _vflashstart | cut -d' ' -f1`; \ if [ ! -z "$$vflashstart" ]; then \ - $(OBJCOPY) --adjust-section-vma=.vector=0x$$vflashstart $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage; \ + $(OBJCOPY) $(OBJCOPYARGS) --adjust-section-vma=.vector=0x$$vflashstart $(TOPDIR)/$@ $(TOPDIR)/$@.flashimage; \ mv $(TOPDIR)/$@.flashimage $(TOPDIR)/$@; \ fi diff --git a/nuttx/configs/mcu123-lpc214x/nsh/Make.defs b/nuttx/configs/mcu123-lpc214x/nsh/Make.defs index 512b78cfb..b306fb1c8 100644 --- a/nuttx/configs/mcu123-lpc214x/nsh/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/nsh/Make.defs @@ -44,9 +44,17 @@ NM = $(CROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump +HOSTOS = ${shell uname -o} + ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} +ifeq ($(ARCHCCMAJOR),4) +ifneq ($(HOSTOS),Cygwin) +OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment +endif +endif + ifeq ("${CONFIG_DEBUG}","y") ARCHOPTIMIZATION = -g else diff --git a/nuttx/configs/mcu123-lpc214x/ostest/Make.defs b/nuttx/configs/mcu123-lpc214x/ostest/Make.defs index 1967f627d..f1c6bb7ca 100644 --- a/nuttx/configs/mcu123-lpc214x/ostest/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/ostest/Make.defs @@ -44,9 +44,17 @@ NM = $(CROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump +HOSTOS = ${shell uname -o} + ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} +ifeq ($(ARCHCCMAJOR),4) +ifneq ($(HOSTOS),Cygwin) +OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment +endif +endif + ifeq ("${CONFIG_DEBUG}","y") ARCHOPTIMIZATION = -g else diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs b/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs index 5fca3757f..c2888512f 100644 --- a/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs @@ -44,9 +44,17 @@ NM = $(CROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump +HOSTOS = ${shell uname -o} + ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} +ifeq ($(ARCHCCMAJOR),4) +ifneq ($(HOSTOS),Cygwin) +OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment +endif +endif + ifeq ("${CONFIG_DEBUG}","y") ARCHOPTIMIZATION = -g else diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs index 1ec3cfc19..224a7739c 100644 --- a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs @@ -44,9 +44,17 @@ NM = $(CROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump +HOSTOS = ${shell uname -o} + ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} +ifeq ($(ARCHCCMAJOR),4) +ifneq ($(HOSTOS),Cygwin) +OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment +endif +endif + ifeq ("${CONFIG_DEBUG}","y") ARCHOPTIMIZATION = -g else diff --git a/nuttx/configs/olimex-strp711/ostest/Make.defs b/nuttx/configs/olimex-strp711/ostest/Make.defs index 96c955804..f33c444fe 100644 --- a/nuttx/configs/olimex-strp711/ostest/Make.defs +++ b/nuttx/configs/olimex-strp711/ostest/Make.defs @@ -1,7 +1,7 @@ ############################################################################## # configs/olimex-strp711/ostest/Make.defs # -# Copyright (C) 2008 Gregory Nutt. All rights reserved. +# Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <spudmonkey@racsa.co.cr> # # Redistribution and use in source and binary forms, with or without @@ -44,9 +44,17 @@ NM = $(CROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump +HOSTOS = ${shell uname -o} + ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} +ifeq ($(ARCHCCMAJOR),4) +ifneq ($(HOSTOS),Cygwin) +OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment +endif +endif + ifeq ("${CONFIG_DEBUG}","y") ARCHOPTIMIZATION = -g else |