Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
Makefile.inc: Add `-fno-pie` to `ADAFLAGS_common`

Building libgfxinit with Debian’s toolchain – latest test with *gnat-11*
11.2.0-13 from Debian sid/unstable – the build fails with the error
below.

E: Invalid reloc type: 10
E: Unable to create rmodule from 'build/cbfs/fallback/ramstage.debug'.

Debian’s toolchain is built without enabling PIE by default.

So, explicitly pass `-fno-pie` to `ADAFLAGS_common` to be independent
from how the toolchain was built.

TEST=*gnat* 11.2.0-13 successfully. builds
purism/librem_cnl/variants/librem_mini with libgfxint.

With the coreboot toolchain `make BUILD_TIMELESS=1` produces the
same `build/coreboot.rom` for `BOARD_PURISM_LIBREM_MINI_V2=y` on
top of commit 50251400d2 (sb/intel/common/firmware: Reword
me_cleaner warning) with and without the change.
Change-Id: I6661937906d95c130c6099f598d61b21e958fd85
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43759
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
---
M Makefile.inc
M src/lib/gnat/Makefile.inc
2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index cc7317d..1c76a91 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -444,6 +444,7 @@
ADAFLAGS_common += -Wstrict-aliasing -Wshadow
ADAFLAGS_common += -fno-common -fomit-frame-pointer
ADAFLAGS_common += -ffunction-sections -fdata-sections
+ADAFLAGS_common += -fno-pie
# Ada warning options:
#
# a Activate most optional warnings.
diff --git a/src/lib/gnat/Makefile.inc b/src/lib/gnat/Makefile.inc
index e740564..065ba71 100644
--- a/src/lib/gnat/Makefile.inc
+++ b/src/lib/gnat/Makefile.inc
@@ -13,6 +13,7 @@
-I$$(src)/lib/gnat/ \
$$(GCC_ADAFLAGS_$(1)) \
-Werror \
+ -fno-pie \

libgnat-$(1)-y += a-unccon.ads
libgnat-$(1)-y += ada.ads

To view, visit change 43759. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6661937906d95c130c6099f598d61b21e958fd85
Gerrit-Change-Number: 43759
Gerrit-PatchSet: 13
Gerrit-Owner: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Martin L. Roth <martinroth@google.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged