Skip to content

Commit 5759f90

Browse files
authored
Merge pull request #4077 from XiWeiGu/loongarch64_abi
LoongArch64: Add ABI detection for loongarch64
2 parents db3366f + 67d1e72 commit 5759f90

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Makefile.system

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,12 @@ BINARY_DEFINED = 1
932932
endif
933933

934934
ifeq ($(ARCH), loongarch64)
935-
CCOMMON_OPT += -march=loongarch64 -mabi=lp64
936-
FCOMMON_OPT += -march=loongarch64 -mabi=lp64
935+
LA64_ABI=$(shell $(CC) -mabi=lp64d -c $(TOPDIR)/cpuid_loongarch64.c -o /dev/null > /dev/null 2> /dev/null && echo lp64d)
936+
ifneq ($(LA64_ABI), lp64d)
937+
LA64_ABI=lp64
938+
endif
939+
CCOMMON_OPT += -march=loongarch64 -mabi=$(LA64_ABI)
940+
FCOMMON_OPT += -march=loongarch64 -mabi=$(LA64_ABI)
937941
endif
938942

939943
endif

0 commit comments

Comments
 (0)