https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157
Bug ID: 99157 Summary: [ARM] libgcc -mcmse check always fail Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgcc Assignee: unassigned at gcc dot gnu.org Reporter: hsuhau617 at gmail dot com Target Milestone: --- When checking -mcmse support, it will always fail. Because it checks the return value with "$?", but in makefile it should be "$$?". I have a simple patch for the bug: --- a/libgcc/config/arm/t-arm +++ b/libgcc/config/arm/t-arm @@ -4,7 +4,7 @@ LIB1ASMFUNCS = _thumb1_case_sqi _thumb1_case_uqi _thumb1_case_shi \ HAVE_CMSE:=$(findstring __ARM_FEATURE_CMSE,$(shell $(gcc_compile_bare) -dM -E - </dev/null)) HAVE_V81M:=$(findstring armv8.1-m.main,$(gcc_compile_bare)) -ifeq ($(shell $(gcc_compile_bare) -E -mcmse - </dev/null >/dev/null 2>/dev/null; echo $?),0) +ifeq ($(shell $(gcc_compile_bare) -E -mcmse - </dev/null >/dev/null 2>/dev/null; echo $$?),0) CMSE_OPTS:=-mcmse endif