hostboot
hostboot copied to clipboard
P8 build fixes for modern GCC
FYI - Not ignoring this, but some of these changes are incompatible with the GCC we're using internally. Trying to figure out how to conditionally include some of the GCC flags, e.g. -mabi=elfv1
Would this work?
From 33947245ccc71d19b8ec1ffb8be1880459521da6 Mon Sep 17 00:00:00 2001
From: Joel Stanley <[email protected]>
Date: Thu, 23 Apr 2020 08:32:01 +0930
Subject: [PATCH] cflags: Avoid -mabi=elfv1 for old tools
IBM has some old toolchains that need to build this code base that do
not support the elfv1 flag.
As the cflags.env.mk does not know about the compiler settings, put them
in env.mk after all the other makefiles have been included.
Change-Id: I13e002f31f481a14a4a1295420f4fd7f295f74e0
Signed-off-by: Joel Stanley <[email protected]>
---
src/build/mkrules/cflags.env.mk | 7 +++----
src/build/mkrules/env.mk | 8 +++++++-
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/build/mkrules/cflags.env.mk b/src/build/mkrules/cflags.env.mk
index 971c11b9ad89..ccd71e6d1086 100644
--- a/src/build/mkrules/cflags.env.mk
+++ b/src/build/mkrules/cflags.env.mk
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2013,2015
+# Contributors Listed Below - COPYRIGHT 2013,2020
# [+] Google Inc.
# [+] International Business Machines Corp.
#
@@ -39,9 +39,8 @@ COMMONFLAGS += $(OPT_LEVEL) -nostdlib
# TODO RTC: 123994 - ELFv2 ABI support (-mabi=elfv1)
CFLAGS += $(COMMONFLAGS) -mcpu=power7 -nostdinc -g -mno-vsx -mno-altivec\
-Wall -Werror -mtraceback=no -pipe \
- -ffunction-sections -fdata-sections -ffreestanding -mbig-endian \
- -mabi=elfv1
-ASMFLAGS += $(COMMONFLAGS) -mcpu=power7 -mbig-endian -mabi=elfv1
+ -ffunction-sections -fdata-sections -ffreestanding -mbig-endian
+ASMFLAGS += $(COMMONFLAGS) -mcpu=power7 -mbig-endian
CXXFLAGS += $(CFLAGS) -nostdinc++ -fno-rtti -fno-exceptions -Wall \
-fuse-cxa-atexit -std=gnu++03
LDFLAGS += --nostdlib --sort-common -EB $(COMMONFLAGS)
diff --git a/src/build/mkrules/env.mk b/src/build/mkrules/env.mk
index 4eacbaa3d607..dc0ec171f139 100644
--- a/src/build/mkrules/env.mk
+++ b/src/build/mkrules/env.mk
@@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2013,2014
+# Contributors Listed Below - COPYRIGHT 2013,2020
+# [+] International Business Machines Corp.
+#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -78,3 +80,7 @@ include $(MKRULESDIR)/binfile.env.mk
include $(MKRULESDIR)/beam.env.mk
include $(MKRULESDIR)/gcov.env.mk
include $(MKRULESDIR)/cflags.env.mk
+
+ELFV1 := $(call try-cflags,$(CC),-mabi=elfv1)
+CFLAGS += $(ELFV1)
+COMMONFLAGS += $(ELFV1)
--
2.26.1
Any new news here @dcrowell77 ? Have these been integrated?
No news, haven't had time to dig in.