From 3ef27eba2d80bb88d654570dd751f9be2ce4b792 Mon Sep 17 00:00:00 2001 From: Andrej Rosano Date: Sun, 9 Aug 2015 20:01:01 +0200 Subject: [PATCH] sys-boot/grub: add grub_platforms_arm64 use flag Enables the build of efi grub application for arm64 platforms. Signed-off-by: Andrej Rosano --- .../sys-boot/grub/grub-9999.ebuild | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-boot/grub/grub-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-boot/grub/grub-9999.ebuild index 9c40132c44..6ffc4d3eb1 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-boot/grub/grub-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-boot/grub/grub-9999.ebuild @@ -42,6 +42,8 @@ GRUB_ALL_PLATFORMS=( coreboot multiboot efi-32 pc qemu xen # amd64, ia64: efi-64 + # arm64: + arm64 ) IUSE+=" ${GRUB_ALL_PLATFORMS[@]/#/grub_platforms_}" @@ -85,6 +87,7 @@ DEPEND="${RDEPEND} sys-fs/squashfs-tools[lzo,xz] grub_platforms_efi-64? ( app-emulation/qemu[qemu_softmmu_targets_x86_64] ) grub_platforms_pc? ( app-emulation/qemu[qemu_softmmu_targets_i386] ) + grub_platforms_arm64? ( app-emulation/qemu[qemu_softmmu_targets_aarch64] ) ) truetype? ( app-arch/unzip ) " @@ -119,6 +122,19 @@ QA_PRESTRIPPED=" " pkg_pretend() { + if [[ ${GRUB_PLATFORMS} =~ "arm64" ]] ; then + ebegin "Checking for aarch64-cros-linux-gnu-gcc" + if type -p aarch64-cros-linux-gnu-gcc > /dev/null ; then + eend 0 + else + eend 1 + eerror "Failed to locate 'aarch64-cros-linux-gnu-gcc' in \$PATH." + eerror "You can install an AARCH64 toolchain using:" + eerror " $ crossdev -t aarch64-cros-linux-gnu" + die "AARCH64 toolchain not found" + fi + fi + if [[ ${MERGE_TYPE} != binary ]]; then # Bug 439082 if ! version_is_at_least 4.8 "$(gcc-version)" && @@ -180,6 +196,12 @@ grub_configure() { local TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}" export TARGET_CFLAGS TARGET_CPPFLAGS fi ;; + arm64) + # FIXME(andrejro): mixed architecture binaries are generated + # while prepallstrip uses the native strip executable. This + # causes errors trying to strip aarch64 grub modules. + platform=efi + local CTARGET=aarch64-cros-linux-gnu ;; guessed) ;; *) platform=${MULTIBUILD_VARIANT} ;; esac @@ -231,7 +253,6 @@ src_configure() { fi tc-export CC NM OBJCOPY STRIP - export TARGET_CC=${TARGET_CC:-${CC}} tc-export BUILD_CC # Bug 485592 # Portage will take care of cleaning up GRUB_PLATFORMS