Skip to content

Commit

Permalink
[loong64] Disable vector instructions and linker relaxation
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaotian Wu <[email protected]>
  • Loading branch information
yetist committed Mar 11, 2024
1 parent 7cd7388 commit 61ca4ef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/arch/loong64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ ASM_TCHAR_OPS := @
CFLAGS += -fstrength-reduce -fomit-frame-pointer
CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1

## Check if the follow options is valid for current toolchains
# -mno-lsx: Disable 128-bit SIMD instructions, added after gcc-14
# -mno-lasx: Disable 256-bit SIMD instructions, added after gcc-14
# -mno-relax: Disable linker relaxation, added after gcc-14
# -Wa,-mno-relax: Disable linker relaxation, added after binutils-2.41
CHECK_CC_FLAGS := -mno-lsx -mno-lasx -mno-relax -Wa,-mno-relax

define check_cc_flag
$(shell $(CC) $(1) -x c -c /dev/null -o /dev/null > /dev/null 2>&1 && echo $(1))
endef
CFLAGS += $(foreach flag,$(CHECK_CC_FLAGS),$(call check_cc_flag,$(flag)))

# Check if -mno-explicit-relocs is valid
ifeq ($(CCTYPE),gcc)
MNER_TEST = $(CC) -mno-explicit-relocs -x c -c /dev/null -o /dev/null >/dev/null 2>&1
Expand Down

0 comments on commit 61ca4ef

Please sign in to comment.