Skip to content

Commit 6fd1635

Browse files
committed
gcc: Fix building of libgcc on w/regards to -mcmse
There is a bug in how libgcc detects if the compiler suppoerts -mcmse. Fix the t-arm makefile stub to correctly report if -mcmse is supported Fixes #301 Signed-off-by: Kumar Gala <[email protected]>
1 parent 37296bc commit 6fd1635

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 019443b8643c570185bdbf8e7908965a6e26da34 Mon Sep 17 00:00:00 2001
2+
From: Kumar Gala <[email protected]>
3+
Date: Tue, 1 Dec 2020 15:35:25 -0600
4+
Subject: [PATCH] gcc: libgcc: t-arm: Fix -mcmse compile test for setting
5+
CMSE_OPTS
6+
7+
We need to use $$? to get the exit code because of how expansion
8+
works in make.
9+
10+
Signed-off-by: Kumar Gala <[email protected]>
11+
---
12+
libgcc/config/arm/t-arm | 2 +-
13+
1 file changed, 1 insertion(+), 1 deletion(-)
14+
15+
diff --git a/libgcc/config/arm/t-arm b/libgcc/config/arm/t-arm
16+
index 364f40ebe7f..3625a2590be 100644
17+
--- a/libgcc/config/arm/t-arm
18+
+++ b/libgcc/config/arm/t-arm
19+
@@ -4,7 +4,7 @@ LIB1ASMFUNCS = _thumb1_case_sqi _thumb1_case_uqi _thumb1_case_shi \
20+
21+
HAVE_CMSE:=$(findstring __ARM_FEATURE_CMSE,$(shell $(gcc_compile_bare) -dM -E - </dev/null))
22+
HAVE_V81M:=$(findstring armv8.1-m.main,$(gcc_compile_bare))
23+
-ifeq ($(shell $(gcc_compile_bare) -E -mcmse - </dev/null >/dev/null 2>/dev/null; echo $?),0)
24+
+ifeq ($(shell $(gcc_compile_bare) -E -mcmse - </dev/null >/dev/null 2>/dev/null; echo $$?),0)
25+
CMSE_OPTS:=-mcmse
26+
endif
27+
28+
--
29+
2.28.0
30+

0 commit comments

Comments
 (0)