diff mbox

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

Message ID CACRpkdaqvK3730mB67C8Bmpfm6fLHb1Tz-Bzr=Lhxn1bFw2i3g@mail.gmail.com
State Rejected
Headers show

Commit Message

Linus Walleij July 12, 2011, 3:24 p.m. UTC
On Tue, Jul 12, 2011 at 1:58 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Linus Walleij,
>
> In message <1310469889-12999-1-git-send-email-linus.walleij@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@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:

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

Comments

Mike Frysinger July 12, 2011, 3:49 p.m. UTC | #1
On Tue, Jul 12, 2011 at 11:24, Linus Walleij wrote:
> I do this, first I apply the patches I sent for Integrator support, then
> I apply this patch to test with network support:

no changes at all should be necessary to include/configs/.  build the
tools in an unconfigured tree to avoid any of that cruft.

$ git clean -x -d
$ make tools
$ size tools/gen_eth_addr.o
-mike
Linus Walleij July 12, 2011, 6:48 p.m. UTC | #2
On Tue, Jul 12, 2011 at 5:49 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tue, Jul 12, 2011 at 11:24, Linus Walleij wrote:
>> I do this, first I apply the patches I sent for Integrator support, then
>> I apply this patch to test with network support:
>
> no changes at all should be necessary to include/configs/.  build the
> tools in an unconfigured tree to avoid any of that cruft.
>
> $ git clean -x -d
> $ make tools
> $ size tools/gen_eth_addr.o

If you do this gen_eth_addr.o isn't even built, since it is only built
if you first
configure a board with CONFIG_CMD_NET of some kind.

$ git clean -x -d
$ make tools
(... some clean build logs ...)
$ size tools/gen_eth_addr.o
size: 'tools/gen_eth_addr.o': No such file

If I do the minimal test case like this:
$ make tools CONFIG_CMD_NET=y

I indeed get the same error again:
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/include2
-idirafter /home/linus/u-boot/include -I /home/linus/u-boot/lib/libfdt
-I /home/linus/u-boot/tools -DCONFIG_SYS_TEXT_BASE= -DUSE_HOSTCC
-D__KERNEL_STRICT_NAMES -pedantic   -o 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/include2
-idirafter /home/linus/u-boot/include -I /home/linus/u-boot/lib/libfdt
-I /home/linus/u-boot/tools -DCONFIG_SYS_TEXT_BASE= -DUSE_HOSTCC
-D__KERNEL_STRICT_NAMES -pedantic  -o gen_eth_addr gen_eth_addr.o
gen_eth_addr.o: file not recognized: File truncated
collect2: ld returned 1 exit status
make[1]: *** [gen_eth_addr] Error 1
make[1]: Leaving directory `/home/linus/u-boot/tools'
make: *** [tools] Error 2

So yes, I can positively repeat this on a clean tree. It's still -pendantic that
is the culprit, if I copy the above and run manually without -pedantic
it compiles
fine.

Thanks,
Linus Walleij
Mike Frysinger July 12, 2011, 6:57 p.m. UTC | #3
On Tue, Jul 12, 2011 at 14:48, Linus Walleij wrote:
> On Tue, Jul 12, 2011 at 5:49 PM, Mike Frysinger wrote:
>> On Tue, Jul 12, 2011 at 11:24, Linus Walleij wrote:
>>> I do this, first I apply the patches I sent for Integrator support, then
>>> I apply this patch to test with network support:
>>
>> no changes at all should be necessary to include/configs/.  build the
>> tools in an unconfigured tree to avoid any of that cruft.
>>
>> $ git clean -x -d
>> $ make tools
>> $ size tools/gen_eth_addr.o
>
> If you do this gen_eth_addr.o isn't even built, since it is only built
> if you first configure a board with CONFIG_CMD_NET of some kind.

not really.  either use `make tools-all`, or `make CONFIG_CMD_NET=y
tools`.  but you figured that out already ...

> I indeed get the same error again:
> 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/include2
> -idirafter /home/linus/u-boot/include -I /home/linus/u-boot/lib/libfdt
> -I /home/linus/u-boot/tools -DCONFIG_SYS_TEXT_BASE= -DUSE_HOSTCC
> -D__KERNEL_STRICT_NAMES -pedantic   -o 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/include2
> -idirafter /home/linus/u-boot/include -I /home/linus/u-boot/lib/libfdt
> -I /home/linus/u-boot/tools -DCONFIG_SYS_TEXT_BASE= -DUSE_HOSTCC
> -D__KERNEL_STRICT_NAMES -pedantic  -o gen_eth_addr gen_eth_addr.o
> gen_eth_addr.o: file not recognized: File truncated
> collect2: ld returned 1 exit status
> make[1]: *** [gen_eth_addr] Error 1
> make[1]: Leaving directory `/home/linus/u-boot/tools'
> make: *** [tools] Error 2
>
> So yes, I can positively repeat this on a clean tree. It's still -pendantic that
> is the culprit, if I copy the above and run manually without -pedantic
> it compiles fine.

are you using ccache ?
-mike
Linus Walleij July 12, 2011, 6:59 p.m. UTC | #4
On Tue, Jul 12, 2011 at 8:57 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> [Me]
>> So yes, I can positively repeat this on a clean tree. It's still -pendantic that
>> is the culprit, if I copy the above and run manually without -pedantic
>> it compiles fine.
>
> are you using ccache ?

Yes :-P

I didn't think so, but nowadays it's apparently in the Fedora development tools
groupinstall. Removing the package and spawning a new shell indeed solves
the problem, like I guess deleting the ccache database would.

Thanks Mike!

I wonder if we could autodetect this so noone else runs into it?

Linus Walleij
Mike Frysinger July 12, 2011, 7:03 p.m. UTC | #5
On Tue, Jul 12, 2011 at 14:59, Linus Walleij wrote:
> On Tue, Jul 12, 2011 at 8:57 PM, Mike Frysinger wrote:
>> [Me]
>>> So yes, I can positively repeat this on a clean tree. It's still -pendantic that
>>> is the culprit, if I copy the above and run manually without -pedantic
>>> it compiles fine.
>>
>> are you using ccache ?
>
> Yes :-P
>
> I didn't think so, but nowadays it's apparently in the Fedora development tools
> groupinstall. Removing the package and spawning a new shell indeed solves
> the problem, like I guess deleting the ccache database would.
>
> Thanks Mike!
>
> I wonder if we could autodetect this so noone else runs into it?

not really.  sounds like ccache db corruption (lose power recently?),
and as with any corruption, "detecting" it in arbitrary build systems
isnt exactly a trivial task.  if you get back a valid ELF object, but
not the right one, how is u-boot to know ?

i'd `ccache -C` and forget about the whole thing :P
-mike
Wolfgang Denk July 12, 2011, 8:04 p.m. UTC | #6
Dear Linus Walleij,

In message <CACRpkdaqvK3730mB67C8Bmpfm6fLHb1Tz-Bzr=Lhxn1bFw2i3g@mail.gmail.com> you wrote:
>
> Yes I'm reluctant about the whole thing, doesn't say from the patch it
> was indeed intended as a discussion item...

You should have marked it as "RFC" in the subject, then.

> 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

This is what I see:

Short:

-> ./MAKEALL ap920t
Configuring for ap920t board...
Variant: Core module CM920T with core arm920t
pci.c: In function 'pci_init_board':
pci.c:392: warning: implicit declaration of function 'pciauto_config_init'
   text    data     bss     dec     hex filename
 162650    3236   36260  202146   315a2 ./u-boot

--------------------- SUMMARY ----------------------------
Boards compiled: 1
Boards with warnings or errors: 1 ( ap920t )
----------------------------------------------------------

Long:
...
make -C tools all
make[1]: Entering directory `/home/wd/git/u-boot/work/tools'
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /home/wd/git/u-boot/work/include -idirafter /home/wd/git/u-boot/work/include2 -idirafter /home/wd/git/u-boot/work/include -I /home/wd/git/u-boot/work/lib/libfdt -I /home/wd/git/u-boot/work/tools -DCONFIG_SYS_TEXT_BASE=0x01000000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic   -o gen_eth_addr.o gen_eth_addr.c -c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /home/wd/git/u-boot/work/include -idirafter /home/wd/git/u-boot/work/include2 -idirafter /home/wd/git/u-boot/work/include -I /home/wd/git/u-boot/work/lib/libfdt -I /home/wd/git/u-boot/work/tools -DCONFIG_SYS_TEXT_BASE=0x01000000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic  -o gen_eth_addr gen_eth_addr.o
strip gen_eth_addr
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /home/wd/git/u-boot/work/include -idirafter /home/wd/git/u-boot/work/include2 -idirafter /home/wd/git/u-boot/work/include -I /home/wd/git/u-boot/work/lib/libfdt -I /home/wd/git/u-boot/work/tools -DCONFIG_SYS_TEXT_BASE=0x01000000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic   -o img2srec.o img2srec.c -c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /home/wd/git/u-boot/work/include -idirafter /home/wd/git/u-boot/work/include2 -idirafter /home/wd/git/u-boot/work/include -I /home/wd/git/u-boot/work/lib/libfdt -I /home/wd/git/u-boot/work/tools -DCONFIG_SYS_TEXT_BASE=0x01000000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -pedantic  -o img2srec img2srec.o
strip img2srec
...

> Not many hints here though :-(

Something in your host system appears to be broken.

I've tested both on 32 bit (gcc-4.6.0-9.fc15.i686) and 64 bit
(gcc-4.6.0-9.fc15.x86_64) systems,  without seeing any such problems.

Sorry...


Best regards,

Wolfgang Denk
Wolfgang Denk July 12, 2011, 8:05 p.m. UTC | #7
Dear Linus Walleij,

In message <CACRpkdaDsMRw3Uu6Q7_MaBsb-WpaEy-WMkYf7Q0wAxNby126Fw@mail.gmail.com> you wrote:
> On Tue, Jul 12, 2011 at 8:57 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> > [Me]
> >> So yes, I can positively repeat this on a clean tree. It's still -pendantic that
> >> is the culprit, if I copy the above and run manually without -pedantic
> >> it compiles fine.
> >
> > are you using ccache ?
> 
> Yes :-P
> 
> I didn't think so, but nowadays it's apparently in the Fedora development tools
> groupinstall. Removing the package and spawning a new shell indeed solves
> the problem, like I guess deleting the ccache database would.

I'm using ccache as well, and always did.  Never saw such an issue
before.

Did you have any I/O errors (like corrupt data) on your system lately?


Best regards,

Wolfgang Denk
Mike Frysinger July 12, 2011, 8:17 p.m. UTC | #8
On Tue, Jul 12, 2011 at 16:05, Wolfgang Denk wrote:
> Linus Walleij wrote:
>> On Tue, Jul 12, 2011 at 8:57 PM, Mike Frysinger wrote:
>> > [Me]
>> >> So yes, I can positively repeat this on a clean tree. It's still -pendantic that
>> >> is the culprit, if I copy the above and run manually without -pedantic
>> >> it compiles fine.
>> >
>> > are you using ccache ?
>>
>> Yes :-P
>>
>> I didn't think so, but nowadays it's apparently in the Fedora development tools
>> groupinstall. Removing the package and spawning a new shell indeed solves
>> the problem, like I guess deleting the ccache database would.
>
> I'm using ccache as well, and always did.  Never saw such an issue
> before.
>
> Did you have any I/O errors (like corrupt data) on your system lately?

with Gentoo, we've often seen unexpected reboots (power loss / oom /
oops / etc...) result in zero byte files being left in the cache.
comes up semi-frequently for us since so many people are using ccache
and building from source.  the zero byte aspect makes sense when using
ext4 due to the fs design (metadata gets committed, but contents are
in transit and lost).

perhaps ccache itself should grow a 0 byte file check.  i cant imagine
any valid compiled object being 0 bytes ...
-mike
Linus Walleij July 12, 2011, 10:54 p.m. UTC | #9
On Tue, Jul 12, 2011 at 10:05 PM, Wolfgang Denk <wd@denx.de> wrote:

>> Yes I'm reluctant about the whole thing, doesn't say from the patch it
>> was indeed intended as a discussion item...
>
>You should have marked it as "RFC" in the subject, then.

I forgot, mea culpa.

>> I didn't think so, but nowadays it's apparently in the Fedora development tools
>> groupinstall. Removing the package and spawning a new shell indeed solves
>> the problem, like I guess deleting the ccache database would.
>
> I'm using ccache as well, and always did.  Never saw such an issue
> before.
>
> Did you have any I/O errors (like corrupt data) on your system lately?

Yep it's a laptop, it boots from a USB drive, sometimes I even drop the drive
and disconnect it in transit so data corruption is happening every day.

I removed ccache since I don't trust it anymore, sorry about the fuzz.

Thanks Wolfgang,
Linus Walleij
diff mbox

Patch

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