summaryrefslogtreecommitdiff
path: root/util/xcompile
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@coreboot.org>2022-09-08 20:25:46 +0200
committerPatrick Georgi <patrick@coreboot.org>2022-09-17 05:56:34 +0000
commitf0d5f67e46cac62f485805626ca4a7c4dd622a08 (patch)
tree9f2fefd269f7ef6944335898d1a0116a9ef61133 /util/xcompile
parent2c38933a0e461855c8eab997fc66baffa449f674 (diff)
downloadcoreboot-f0d5f67e46cac62f485805626ca4a7c4dd622a08.tar.gz
riscv: Enable the newfangled way of selecting instruction sets
gcc12+ will require riscv architecture selection to come not only with featurei suffixd charactersa, it also comes with feature_ful suffix_ed words_mith. Much creative, very appreciate. To accommodate for this madness, enable the already existing (but off by default) support for that in our gcc11 build, support using by detecting the compiler's behavior in xcompile and pass that knowledge along to our build system. Then cross our fingers and hope for the best! Change-Id: I5dfeed766626e78d4f8378d9d857b7a4d61510fd Signed-off-by: Patrick Georgi <patrick@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/67457 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Diffstat (limited to 'util/xcompile')
-rwxr-xr-xutil/xcompile/xcompile6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index e13996f6b1..e35904fde1 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -202,6 +202,10 @@ detect_special_flags() {
"$LDFLAGS --fix-cortex-a53-843419" && \
LDFLAGS_ARM64_A53_ERRATUM_843419+=" --fix-cortex-a53-843419"
;;
+ riscv)
+ testcc "$GCC" "$FLAGS_GCC -march=rv64iadc_zicsr_zifencei" &&
+ ARCH_SUFFIX="_zicsr_zifencei"
+ ;;
esac
}
@@ -221,6 +225,7 @@ report_arch_toolchain() {
# elf${TWIDTH}-${TBFDARCH} toolchain (${GCC})
ARCH_SUPPORTED+=${TARCH}
SUBARCH_SUPPORTED+=${TSUPP-${TARCH}}
+ARCH_SUFFIX_${TARCH}:=${ARCH_SUFFIX}
# GCC
GCC_CC_${TARCH}:=${GCC}
@@ -399,6 +404,7 @@ test_architecture() {
unset TABI TARCH TBFDARCH TCLIST TENDIAN TSUPP TWIDTH
unset CC_RT_EXTRA_GCC CC_RT_EXTRA_CLANG
unset GCC CLANG
+ unset ARCH_SUFFIX
if type "arch_config_$architecture" > /dev/null; then
"arch_config_$architecture"
else