For panther(amd64), sys-boot/coreboot fails to build with binutils 2.27.
Snippet from the output of "build_packages --nousepkg --board=panther":
coreboot-0.0.1-r2060: LINK cbfs/fallback/romstage.debug
coreboot-0.0.1-r2060: /usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.27/ld.bfd.real: 2api.o: access beyond end of merged section (2556271736)
coreboot-0.0.1-r2060: /usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.27/ld.bfd.real: 2api.o: access beyond end of merged section (492131732)
coreboot-0.0.1-r2060: /usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.27/ld.bfd.real: 2api.o: access beyond end of merged section (1933178823)
...
coreboot-0.0.1-r2060: /usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.27/ld.bfd.real: 2api.o: access beyond end of merged section (1803799009)
coreboot-0.0.1-r2060: /usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.27/ld.bfd.real: 2api.o: access beyond end of merged section (1693583249)
coreboot-0.0.1-r2060: /usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.27/ld.bfd.real: 2api.o: access beyond end of merged section (268089298)
coreboot-0.0.1-r2060: /usr/x86_64-pc-linux-gnu/i686-pc-linux-gnu/binutils-bin/2.27/ld.bfd.real: build/romstage/external/vboot_reference/../../../external/vboot_reference/vboot_fw20.a(2api.o)(.debug_info+0xc5c): reloc against `.debug_str': error 2
coreboot-0.0.1-r2060: make: *** [src/arch/x86/Makefile.inc:265: build/cbfs/fallback/romstage.debug] Error 1
coreboot-0.0.1-r2060: * ERROR: sys-boot/coreboot-0.0.1-r2060::chromiumos failed (compile phase):
coreboot-0.0.1-r2060: * emake failed
Comment 1 by rahulchaudhry@chromium.org
, May 15 2017This issue is related to "--compress-debug-sections" flags for the assembler and linkers. Specifically, the assembler defaults to compressing the debug sections on x86, but the linker is unable to read back the compressed debug info. This issue happens for object files during coreboot builds ("2api.o" above), as well as for object files in "libgcc.a". The configuration and defaults for this flag in upstream binutils 2.27 are a bit confusing: -) By default, --compress-debug-sections is enabled in "gas", but only for "x86". From "gas/configure.tgt": case ${cpu_type}-${fmt}-${os} in i386-elf-linux*) # Default to compress DWARF debug sections for Linux/x86. if test ${ac_default_compressed_debug_sections} = unset; then ac_default_compressed_debug_sections=yes fi ;; esac -) For both "ld.bfd" and "ld.gold", the default is no-compress-debug-sections, for all architectures. -) There is a configure time option "--enable-compressed-debug-sections" that sets the default for this flag in "gas" and "ld.bfd". "ld.gold" seems to ignore this configure option. -) When binutils is configured with "--enable-compressed-debug-sections=none", the defaults are set to no-compress-debug-sections for all three tools for all architectures. With this default, the sys-boot/coreboot build errors reported in this issue are gone. This is probably what we want for now (binutils 2.25 does not compress debug sections either). After the binutils upgrade, we can revisit this, test and evaluate a different "--enable-compressed-debug-sections" configuration for all tools across all supported architectures. Compressed debug sections is not enabled by default for arm/aarch64 in upstream binutils, and there are clearly some unresolved issues with the x86 support as well.