New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 715779 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: May 2017
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 711461



Sign in to add a comment

binutils-2.27: sys-boot/coreboot fails to build for panther (amd64)

Project Member Reported by rahulchaudhry@chromium.org, Apr 26 2017

Issue description

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

 
This 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.

Status: Fixed (was: Assigned)
Marking this "fixed" as the original build issue is fixed by "--enable-compressed-debug-sections=none" configure option.

Comment 3 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61
Status: Verified (was: Fixed)
Closing. Please reopen it if its not fixed. Thanks!

Sign in to add a comment