[U-Boot] [PATCH] tools: build some commands without -pedantic

Linus Walleij linus.walleij at linaro.org
Tue Jul 12 17:24:58 CEST 2011


On Tue, Jul 12, 2011 at 1:58 PM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Linus Walleij,
>
> In message <1310469889-12999-1-git-send-email-linus.walleij at linaro.org> you wrote:
>> On this GCC in Fedora (4.6.0 20110530) the tools gen_eth_addr
>> and img2srec become size zero if compiled with -pedantic (no
>> warnings are emitted however). Marking them _NOPED solves the
>> issue for me.
>>
>> Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
>> ---
>>  tools/Makefile |    6 +++---
>>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> NAK.  I hate papering over obvious problems.  Please let's analyze
> what's going wrong, and fix the cause instead.

Yes I'm reluctant about the whole thing, doesn't say from the patch it
was indeed intended as a discussion item...

> This is all the more so, as I'm running Fedora 15 here on our machines
> [with gcc version 4.6.0 20110530 (Red Hat 4.6.0-9) (GCC)], and I don;t
> see any such problems.

Hm! Then I must be doing something wrong...

I do this, first I apply the patches I sent for Integrator support, then
I apply this patch to test with network support:

diff --git a/include/configs/integratorap.h b/include/configs/integratorap.h
index 26eac8b..39c84b5 100644
--- a/include/configs/integratorap.h
+++ b/include/configs/integratorap.h
@@ -80,17 +80,7 @@
 /*
  * Command line configuration.
  */
-
-
-#define CONFIG_CMD_IMI
-#define CONFIG_CMD_BDI
-#define CONFIG_CMD_BOOTD
-#define CONFIG_CMD_MEMORY
-#define CONFIG_CMD_FLASH
-#define CONFIG_CMD_IMLS
-#define CONFIG_CMD_LOADB
-#define CONFIG_CMD_LOADS
-
+#include <config_cmd_default.h>

 #define CONFIG_BOOTDELAY	2
 #define CONFIG_BOOTARGS		"root=/dev/mtdblock0 mem=32M console=ttyAM0
console=tty"
@@ -155,11 +145,14 @@
  * PCI definitions
  */

+#define CONFIG_PCI
 #ifdef CONFIG_PCI			/* pci support	*/
 #undef CONFIG_PCI_PNP
 #define CONFIG_PCI_SCAN_SHOW	1	/* show pci devices on startup	*/
 #define DEBUG

+#define CONFIG_NET_MULTI
+#define CONFIG_TULIP
 #define CONFIG_EEPRO100
 #define CONFIG_SYS_RX_ETH_BUFFER	8	/* use 8 rx buffer on eepro100	*/


Then I build like this:

cd u-boot
mkdir build
make O=build CROSS_COMPILE=arm-none-eabi- distclean
make O=build CROSS_COMPILE=arm-none-eabi- ap920t_config
make O=build CROSS_COMPILE=arm-none-eabi- all


Then this happens on my side:

make -C tools all
make[1]: Entering directory `/home/linus/u-boot/tools'
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter
/home/linus/u-boot/include -idirafter
/home/linus/u-boot/build/include2 -idirafter
/home/linus/u-boot/build/include -I /home/linus/u-boot/lib/libfdt -I
/home/linus/u-boot/tools -DCONFIG_SYS_TEXT_BASE=0x01000000
-DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic   -o
/home/linus/u-boot/build/tools/gen_eth_addr.o gen_eth_addr.c -c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter
/home/linus/u-boot/include -idirafter
/home/linus/u-boot/build/include2 -idirafter
/home/linus/u-boot/build/include -I /home/linus/u-boot/lib/libfdt -I
/home/linus/u-boot/tools -DCONFIG_SYS_TEXT_BASE=0x01000000
-DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic  -o
/home/linus/u-boot/build/tools/gen_eth_addr
/home/linus/u-boot/build/tools/gen_eth_addr.o
/home/linus/u-boot/build/tools/gen_eth_addr.o: file not recognized:
File truncated
collect2: ld returned 1 exit status
make[1]: *** [/home/linus/u-boot/build/tools/gen_eth_addr] Error 1
make[1]: Leaving directory `/home/linus/u-boot/tools'
make: *** [tools] Error 2

Which is because:
ls -al build/tools/gen_eth_addr.o
-rw-rw-r--. 1 linus linus 0 Jul 12 17:16 build/tools/gen_eth_addr.o

If I copy+paste the buildline and remove -pedantic like this:

u-boot]$ cd tools && gcc -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -idirafter /home/linus/u-boot/include -idirafter
/home/linus/u-boot/build/include2 -idirafter
/home/linus/u-boot/build/include -I /home/linus/u-boot/lib/libfdt -I
/home/linus/u-boot/tools -DCONFIG_SYS_TEXT_BASE=0x01000000
-DUSE_HOSTCC -D__KERNEL_STRICT_NAMES  -o
/home/linus/u-boot/build/tools/gen_eth_addr.o gen_eth_addr.c -c && cd
..

ls -al build/tools/gen_eth_addr.o
-rw-rw-r--. 1 linus linus 1380 Jul 12 17:21 build/tools/gen_eth_addr.o

It's the same effect as if I tag on _NOPED of course.

If I repeat it with "-pedantic -v" to see more what's happening in GCC:

cd tools && gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
-idirafter /home/linus/u-boot/include -idirafter
/home/linus/u-boot/build/include2 -idirafter
/home/linus/u-boot/build/include -I /home/linus/u-boot/lib/libfdt -I
/home/linus/u-boot/tools -DCONFIG_SYS_TEXT_BASE=0x01000000
-DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic -v -o
/home/linus/u-boot/build/tools/gen_eth_addr.o gen_eth_addr.c -c && cd
..
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.6.0/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto
--enable-plugin --enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic
--with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.6.0 20110530 (Red Hat 4.6.0-9) (GCC)
COLLECT_GCC_OPTIONS='-Wall' '-Wstrict-prototypes' '-O2'
'-fomit-frame-pointer' '-idirafter' '/home/linus/u-boot/include'
'-idirafter' '/home/linus/u-boot/build/include2' '-idirafter'
'/home/linus/u-boot/build/include' '-I'
'/home/linus/u-boot/lib/libfdt' '-I' '/home/linus/u-boot/tools' '-D'
'CONFIG_SYS_TEXT_BASE=0x01000000' '-D' 'USE_HOSTCC' '-D'
'__KERNEL_STRICT_NAMES' '-pedantic' '-v' '-c' '-E' '-mtune=generic'
'-march=i686'
 /usr/libexec/gcc/i686-redhat-linux/4.6.0/cc1 -E -quiet -v -I
/home/linus/u-boot/lib/libfdt -I /home/linus/u-boot/tools -D
CONFIG_SYS_TEXT_BASE=0x01000000 -D USE_HOSTCC -D __KERNEL_STRICT_NAMES
-idirafter /home/linus/u-boot/include -idirafter
/home/linus/u-boot/build/include2 -idirafter
/home/linus/u-boot/build/include gen_eth_addr.c -mtune=generic
-march=i686 -Wall -Wstrict-prototypes -pedantic -fomit-frame-pointer
-O2
ignoring nonexistent directory
"/usr/lib/gcc/i686-redhat-linux/4.6.0/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../../i686-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/linus/u-boot/lib/libfdt
 /home/linus/u-boot/tools
 /usr/lib/gcc/i686-redhat-linux/4.6.0/include
 /usr/local/include
 /usr/include
 /home/linus/u-boot/include
 /home/linus/u-boot/build/include2
 /home/linus/u-boot/build/include
End of search list.
COMPILER_PATH=/usr/libexec/gcc/i686-redhat-linux/4.6.0/:/usr/libexec/gcc/i686-redhat-linux/4.6.0/:/usr/libexec/gcc/i686-redhat-linux/:/usr/lib/gcc/i686-redhat-linux/4.6.0/:/usr/lib/gcc/i686-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/i686-redhat-linux/4.6.0/:/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-Wall' '-Wstrict-prototypes' '-O2'
'-fomit-frame-pointer' '-idirafter' '/home/linus/u-boot/include'
'-idirafter' '/home/linus/u-boot/build/include2' '-idirafter'
'/home/linus/u-boot/build/include' '-I'
'/home/linus/u-boot/lib/libfdt' '-I' '/home/linus/u-boot/tools' '-D'
'CONFIG_SYS_TEXT_BASE=0x01000000' '-D' 'USE_HOSTCC' '-D'
'__KERNEL_STRICT_NAMES' '-pedantic' '-v' '-c' '-E' '-mtune=generic'
'-march=i686'
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.6.0/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap
--enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto
--enable-plugin --enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic
--with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.6.0 20110530 (Red Hat 4.6.0-9) (GCC)
COLLECT_GCC_OPTIONS='-Wall' '-Wstrict-prototypes' '-O2'
'-fomit-frame-pointer' '-idirafter' '/home/linus/u-boot/include'
'-idirafter' '/home/linus/u-boot/build/include2' '-idirafter'
'/home/linus/u-boot/build/include' '-I'
'/home/linus/u-boot/lib/libfdt' '-I' '/home/linus/u-boot/tools' '-D'
'CONFIG_SYS_TEXT_BASE=0x01000000' '-D' 'USE_HOSTCC' '-D'
'__KERNEL_STRICT_NAMES' '-pedantic' '-v' '-c' '-o'
'/home/linus/.ccache/b/e/640dda2a6bea0b502be1a40f20250c-70431.o.tmp.finux.16608'
'-mtune=generic' '-march=i686'
 /usr/libexec/gcc/i686-redhat-linux/4.6.0/cc1 -fpreprocessed
/home/linus/.ccache/tmp/gen_eth_ad.tmp.finux.16608.i -quiet -dumpbase
gen_eth_ad.tmp.finux.16608.i -mtune=generic -march=i686 -auxbase-strip
/home/linus/.ccache/b/e/640dda2a6bea0b502be1a40f20250c-70431.o.tmp.finux.16608
-O2 -Wall -Wstrict-prototypes -pedantic -version -fomit-frame-pointer
-o /tmp/ccWF9IMp.s
GNU C (GCC) version 4.6.0 20110530 (Red Hat 4.6.0-9) (i686-redhat-linux)
	compiled by GNU C version 4.6.0 20110530 (Red Hat 4.6.0-9), GMP
version 4.3.2, MPFR version 3.0.0, MPC version 0.8.3-dev
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C (GCC) version 4.6.0 20110530 (Red Hat 4.6.0-9) (i686-redhat-linux)
	compiled by GNU C version 4.6.0 20110530 (Red Hat 4.6.0-9), GMP
version 4.3.2, MPFR version 3.0.0, MPC version 0.8.3-dev
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0738d5e4529b180665bca6e0f3477eb6
COLLECT_GCC_OPTIONS='-Wall' '-Wstrict-prototypes' '-O2'
'-fomit-frame-pointer' '-idirafter' '/home/linus/u-boot/include'
'-idirafter' '/home/linus/u-boot/build/include2' '-idirafter'
'/home/linus/u-boot/build/include' '-I'
'/home/linus/u-boot/lib/libfdt' '-I' '/home/linus/u-boot/tools' '-D'
'CONFIG_SYS_TEXT_BASE=0x01000000' '-D' 'USE_HOSTCC' '-D'
'__KERNEL_STRICT_NAMES' '-pedantic' '-v' '-c' '-o'
'/home/linus/.ccache/b/e/640dda2a6bea0b502be1a40f20250c-70431.o.tmp.finux.16608'
'-mtune=generic' '-march=i686'
 as --32 -o /home/linus/.ccache/b/e/640dda2a6bea0b502be1a40f20250c-70431.o.tmp.finux.16608
/tmp/ccWF9IMp.s
COMPILER_PATH=/usr/libexec/gcc/i686-redhat-linux/4.6.0/:/usr/libexec/gcc/i686-redhat-linux/4.6.0/:/usr/libexec/gcc/i686-redhat-linux/:/usr/lib/gcc/i686-redhat-linux/4.6.0/:/usr/lib/gcc/i686-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/i686-redhat-linux/4.6.0/:/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-Wall' '-Wstrict-prototypes' '-O2'
'-fomit-frame-pointer' '-idirafter' '/home/linus/u-boot/include'
'-idirafter' '/home/linus/u-boot/build/include2' '-idirafter'
'/home/linus/u-boot/build/include' '-I'
'/home/linus/u-boot/lib/libfdt' '-I' '/home/linus/u-boot/tools' '-D'
'CONFIG_SYS_TEXT_BASE=0x01000000' '-D' 'USE_HOSTCC' '-D'
'__KERNEL_STRICT_NAMES' '-pedantic' '-v' '-c' '-o'
'/home/linus/.ccache/b/e/640dda2a6bea0b502be1a40f20250c-70431.o.tmp.finux.16608'
'-mtune=generic' '-march=i686'

Not many hints here though :-(

Any suggestions on how to drill into this are deeply welcome!

Thanks,
Linus Walleij


More information about the U-Boot mailing list