Bug#891733: grub2: Please pass TARGET_CCASFLAGS := -fno-PIE on sparc and sparc64

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Wed Feb 28 10:45:37 UTC 2018


Source: grub2
Version: 2.02+dfsg1-1
Severity: normal
Tags: patch
User: debian-sparc at lists.debian.org
Usertags: sparc sparc64

Hi!

On sparc and sparc64, grub2 needs to be built without PIE as otherwise
the bootloader crashes when trying to boot any machine.

Adding the following to debian/rules is enough:

--- debian/rules.orig   2018-02-17 00:21:52.000000000 +0100
+++ debian/rules        2018-02-28 11:44:00.042409145 +0100
@@ -23,6 +23,10 @@
 export TARGET_CPPFLAGS := -Wno-unused-but-set-variable
 export TARGET_LDFLAGS := -no-pie
 
+ifneq (,$(filter sparc sparc64,$(DEB_HOST_ARCH_CPU)))
+export TARGET_CCASFLAGS := -fno-PIE
+endif
+
 ifeq (,$(shell which qemu-system-i386 2>/dev/null))
 with_check := no
 else

Attaching a patch.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
-------------- next part --------------
--- debian/rules.orig	2018-02-17 00:21:52.000000000 +0100
+++ debian/rules	2018-02-28 11:44:00.042409145 +0100
@@ -23,6 +23,10 @@
 export TARGET_CPPFLAGS := -Wno-unused-but-set-variable
 export TARGET_LDFLAGS := -no-pie
 
+ifneq (,$(filter sparc sparc64,$(DEB_HOST_ARCH_CPU)))
+export TARGET_CCASFLAGS := -fno-PIE
+endif
+
 ifeq (,$(shell which qemu-system-i386 2>/dev/null))
 with_check := no
 else


More information about the Pkg-grub-devel mailing list