jsnyder / avr32-toolchain

Makefile & supporting patches/scripts to build an AVR32 toolchain.
29 stars 30 forks source link

binutils sometimes fails to build from clean start, other times not #8

Closed jsnyder closed 11 years ago

jsnyder commented 13 years ago

Somewhat at random, builds fail with the following set of errors:

elf32-avr32.c:168: error: ‘BFD_RELOC_AVR32_DIFF32’ undeclared here (not in a function)
elf32-avr32.c:169: error: ‘BFD_RELOC_AVR32_DIFF16’ undeclared here (not in a function)
elf32-avr32.c:170: error: ‘BFD_RELOC_AVR32_DIFF8’ undeclared here (not in a function)
elf32-avr32.c:171: error: ‘BFD_RELOC_AVR32_GOT32’ undeclared here (not in a function)
elf32-avr32.c:172: error: ‘BFD_RELOC_AVR32_GOT16’ undeclared here (not in a function)
elf32-avr32.c:173: error: ‘BFD_RELOC_AVR32_GOT8’ undeclared here (not in a function)
elf32-avr32.c:175: error: ‘BFD_RELOC_AVR32_21S’ undeclared here (not in a function)
elf32-avr32.c:176: error: ‘BFD_RELOC_AVR32_16U’ undeclared here (not in a function)
elf32-avr32.c:177: error: ‘BFD_RELOC_AVR32_16S’ undeclared here (not in a function)
elf32-avr32.c:178: error: ‘BFD_RELOC_AVR32_SUB5’ undeclared here (not in a function)
elf32-avr32.c:179: error: ‘BFD_RELOC_AVR32_8S_EXT’ undeclared here (not in a function)
elf32-avr32.c:180: error: ‘BFD_RELOC_AVR32_8S’ undeclared here (not in a function)
elf32-avr32.c:182: error: ‘BFD_RELOC_AVR32_22H_PCREL’ undeclared here (not in a function)
elf32-avr32.c:183: error: ‘BFD_RELOC_AVR32_18W_PCREL’ undeclared here (not in a function)
elf32-avr32.c:184: error: ‘BFD_RELOC_AVR32_16B_PCREL’ undeclared here (not in a function)
elf32-avr32.c:185: error: ‘BFD_RELOC_AVR32_16N_PCREL’ undeclared here (not in a function)
elf32-avr32.c:186: error: ‘BFD_RELOC_AVR32_11H_PCREL’ undeclared here (not in a function)
elf32-avr32.c:187: error: ‘BFD_RELOC_AVR32_10UW_PCREL’ undeclared here (not in a function)
elf32-avr32.c:188: error: ‘BFD_RELOC_AVR32_9H_PCREL’ undeclared here (not in a function)
elf32-avr32.c:189: error: ‘BFD_RELOC_AVR32_9UW_PCREL’ undeclared here (not in a function)
elf32-avr32.c:194: error: ‘BFD_RELOC_AVR32_GOTPC’ undeclared here (not in a function)
elf32-avr32.c:195: error: ‘BFD_RELOC_AVR32_GOTCALL’ undeclared here (not in a function)
elf32-avr32.c:196: error: ‘BFD_RELOC_AVR32_LDA_GOT’ undeclared here (not in a function)
elf32-avr32.c:197: error: ‘BFD_RELOC_AVR32_GOT21S’ undeclared here (not in a function)
elf32-avr32.c:198: error: ‘BFD_RELOC_AVR32_GOT18SW’ undeclared here (not in a function)
elf32-avr32.c:199: error: ‘BFD_RELOC_AVR32_GOT16S’ undeclared here (not in a function)
elf32-avr32.c:202: error: ‘BFD_RELOC_AVR32_32_CPENT’ undeclared here (not in a function)
elf32-avr32.c:203: error: ‘BFD_RELOC_AVR32_CPCALL’ undeclared here (not in a function)
elf32-avr32.c:204: error: ‘BFD_RELOC_AVR32_16_CP’ undeclared here (not in a function)
elf32-avr32.c:205: error: ‘BFD_RELOC_AVR32_9W_CP’ undeclared here (not in a function)
elf32-avr32.c:207: error: ‘BFD_RELOC_AVR32_ALIGN’ undeclared here (not in a function)
elf32-avr32.c:209: error: ‘BFD_RELOC_AVR32_15S’ undeclared here (not in a function)
In file included from elf32-avr32.c:3915:
elf32-target.h:635: error: ‘bfd_arch_avr32’ undeclared here (not in a function)
elf32-target.h:635: error: initializer element is not constant
elf32-target.h:635: error: (near initialization for ‘elf32_bed.arch’)
make[5]: *** [elf32-avr32.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-bfd] Error 2
make[1]: *** [all] Error 2
make: *** [stamps/build-binutils] Error 2```

A workaround appears to be attempting the build again (even after a make clean).

I haven't yet figured out why it sometimes fails and other times builds.
kblomqvist commented 12 years ago

Had the same issue and the sixth build was success.

martinwguy commented 12 years ago

This may be due to the parallel build option, where the successful building of some things depends on other things having completed or not. You could try setting PROCS=1 in the Makefile, which maybe should be the default to make the build more deterministic

kblomqvist commented 12 years ago

Setting PROCS=1 looks promising. Compiled successfully from the clean start at the first attempt.

jsnyder commented 12 years ago

I'll give this a try and will commit this if it builds cleanly for me.

jsnyder commented 12 years ago

That appears to be successful for me, so I'm going to push that and mark this closed for now.

jsnyder commented 12 years ago

With the updated patches, PROCS=1, I seem to now have to run twice to get it to complete, so this doesn't seem to be closed.

kblomqvist commented 12 years ago

Related discussion in http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=69245

jsnyder commented 12 years ago

I've checked out some of those threads in the past, and a few of the other build systems (crosstools-ng), and I think some of them typically succeed on first try. What is slightly maddening for me is that even with PROCS=1 it sometimes dies and sometimes completes. I suppose I could try and catch the error in that particular binutils build and rerun that section of build automatically, but thats a pretty ugly kludge.

I'll try taking a few more swings at this in the coming days if I have time.

kblomqvist commented 12 years ago

Is there anything new? I haven't encountered this issue anymore (have done dozen of builds in Debian 6).

jsnyder commented 12 years ago

I'll try doing some builds again with the latest update you sent a merge request for. It would happen for me sporadically in the past, but perhaps the newer patches have cleaned things up or improved?

kblomqvist commented 12 years ago

perhaps the newer patches have cleaned things up or improved?

I doubt that ;)

kblomqvist commented 12 years ago

FYI: Successful builds on Ubuntu 12.04 32-bit and 64-bit.

kblomqvist commented 11 years ago

I suggest to close this issue. Binutils and its AVR32 patches have been updated, at least, twice since the last time.

jsnyder commented 11 years ago

Thanks.