sys-boot/coreboot does not build with ld.gold as default linker for aarch64-cros-linux-gnu. |
||||||||||
Issue descriptionSee https://chromium-review.googlesource.com/#/c/chromiumos/chromite/+/740668/ and https://chromium-review.googlesource.com/#/c/chromiumos/overlays/chromiumos-overlay/+/740671/ for switching to ld.gold as default linker in the aarch64-cros-linux-gnu toolchain. With this change, sys-boot/coreboot does not build: kevin-release: https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/release/builds/16729 elm-release: https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/release/builds/16728 The build fails with these errors: coreboot-0.0.1-r2314: LD /build/elm/tmp/portage/sys-boot/coreboot-0.0.1-r2314/work/coreboot-0.0.1/build/3rdparty/arm-trusted-firmware/bl31/bl31.elf coreboot-0.0.1-r2314: /usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0/ld.gold.real: error: /build/elm/tmp/portage/sys-boot/coreboot-0.0.1-r2314/work/coreboot-0.0.1/build/3rdparty/arm-trusted-firmware/bl31/bl31.ld:27:13: syntax error, unexpected NEXT coreboot-0.0.1-r2314: /usr/x86_64-pc-linux-gnu/aarch64-cros-linux-gnu/binutils-bin/2.27.0/ld.gold.real: fatal error: unable to parse script file /build/elm/tmp/portage/sys-boot/coreboot-0.0.1-r2314/work/coreboot-0.0.1/build/3rdparty/arm-trusted-firmware/bl31/bl31.ld coreboot-0.0.1-r2314: make[1]: *** [Makefile:556: /build/elm/tmp/portage/sys-boot/coreboot-0.0.1-r2314/work/coreboot-0.0.1/build/3rdparty/arm-trusted-firmware/bl31/bl31.elf] Error 1 coreboot-0.0.1-r2314: make: *** [src/arch/arm64/Makefile.inc:176: build/bl31.elf] Error 2
,
Jan 2 2018
[It appears that a bunch of old cros issues bulk-added the "Infra" component recently, but they should probably be "Infra>Client>ChromeOS".]
,
Jan 3 2018
,
Jan 4 2018
,
Jan 8 2018
,
Jan 10 2018
coreboot ebuild includes 3rdparty/arm-trusted-firmware, which contains the problematic linker script: bl31/bl31.ld.S
The problem is that this linker script uses the NEXT builtin function, which gold linker doesn't support.
We probably want to continue linking arm-trusted-firmware with the bfd linker.
It's a small patch to the Makefile that will do this for Chromium OS builds:
--- Makefile
+++ Makefile
@@ -119,9 +119,9 @@ export HOSTCC
CC := ${CROSS_COMPILE}gcc
CPP := ${CROSS_COMPILE}cpp
AS := ${CROSS_COMPILE}gcc
AR := ${CROSS_COMPILE}ar
-LD := ${CROSS_COMPILE}ld
+LD := ${CROSS_COMPILE}ld.bfd
OC := ${CROSS_COMPILE}objcopy
OD := ${CROSS_COMPILE}objdump
NM := ${CROSS_COMPILE}nm
PP := ${CROSS_COMPILE}gcc -E
If we decide to do this, I'm not sure where the change should go.
3rdparty/arm-trusted-firmware is cloned from ~/trunk/src/third_party/arm-trusted-firmware, which is cloned from https://chromium.googlesource.com/chromiumos/third_party/arm-trusted-firmware, which is a mirror of https://github.com/ARM-software/arm-trusted-firmware.
However, the mirroring updates seem to be paused right now. The "cros/upstream_mirror/master" branch is still syncing with master branch on github, but the "cros/master" branch is frozen since 2017-09-13.
If this change is not suitable for upstream, we can always apply it as a local patch in the coreboot ebuild.
Julius, can you suggest the proper way to handle this?
We want to make sure that coreboot continues building after we switch the default linker for arm64 to ld.gold.
,
Jan 10 2018
Uprevving the cros branch is a manual process. We just do it whenever needed. But the cros branch still needs to be a direct mirror of upstream from a certain point and can not take local patches. I can try to submit a patch upstream to detect and use ld.bfd if it exists, but they're not generally doing any fancy toolchain yet so I'm not sure if they'll take it. If not, we can try changing the make invocation from coreboot's build system to pass an explicit LD variable instead.
,
Jan 10 2018
Uploaded a patch to https://github.com/ARM-software/arm-trusted-firmware/pull/1220, let's see what happens.
,
Jan 24 2018
Ping! Any progress on the upstream pull request?
,
Jan 29 2018
There was a bit of back and forth on the implementation details. I just uploaded another version, let's hope this one will get accepted.
,
Jan 30 2018
Merged upstream. It'll take maybe a week or so for it to trickle from the integration branch back into master, then we can pull it.
,
Jan 30 2018
Thanks for the follow up. Please let us know when it has landed in Chromium OS.
,
Feb 5 2018
,
Feb 5 2018
Okay, change has landed in Chromium OS, please try again!
,
Feb 15 2018
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by zalcorn@chromium.org
, Dec 26 2017