Add support for Loongarch

This commit is contained in:
YalingFang 2024-01-05 08:14:12 +00:00
parent ac02af9286
commit 88d074c0e0
3 changed files with 13 additions and 1 deletions

View File

@ -335,6 +335,11 @@ set(RISCV 1)
set(RISCV32 1) set(RISCV32 1)
endif() endif()
if(ARCH_ID STREQUAL "loongarch64")
set(LOONGARCH 1)
set(LOONGARCH64 1)
endif()
if(WIN32 OR ARM OR PPC64LE OR PPC64 OR PPC) if(WIN32 OR ARM OR PPC64LE OR PPC64 OR PPC)
set(OPT_FLAGS_RELEASE "-O2") set(OPT_FLAGS_RELEASE "-O2")
else() else()
@ -744,7 +749,7 @@ else()
message(STATUS "AES support explicitly disabled") message(STATUS "AES support explicitly disabled")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_AES") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_AES")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_AES") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_AES")
elseif(NOT ARM AND NOT PPC64LE AND NOT PPC64 AND NOT PPC AND NOT S390X AND NOT RISCV) elseif(NOT ARM AND NOT PPC64LE AND NOT PPC64 AND NOT PPC AND NOT S390X AND NOT RISCV AND NOT LOONGARCH)
message(STATUS "AES support enabled") message(STATUS "AES support enabled")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes")
@ -754,6 +759,8 @@ else()
message(STATUS "AES support not available on s390x") message(STATUS "AES support not available on s390x")
elseif(RISCV) elseif(RISCV)
message(STATUS "AES support not available on RISC-V") message(STATUS "AES support not available on RISC-V")
elseif(LOONGARCH)
message(STATUS "AES support not available on LOONGARCH")
elseif(ARM6) elseif(ARM6)
message(STATUS "AES support not available on ARMv6") message(STATUS "AES support not available on ARMv6")
elseif(ARM7) elseif(ARM7)

View File

@ -38,6 +38,7 @@ $(package)_config_opts_arm_android=--static android-arm
$(package)_config_opts_aarch64_android=--static android-arm64 $(package)_config_opts_aarch64_android=--static android-arm64
$(package)_config_opts_aarch64_darwin=darwin64-arm64-cc $(package)_config_opts_aarch64_darwin=darwin64-arm64-cc
$(package)_config_opts_riscv64_linux=linux-generic64 $(package)_config_opts_riscv64_linux=linux-generic64
$(package)_config_opts_loongarch64_linux=linux-generic64
$(package)_config_opts_mipsel_linux=linux-generic32 $(package)_config_opts_mipsel_linux=linux-generic32
$(package)_config_opts_mips_linux=linux-generic32 $(package)_config_opts_mips_linux=linux-generic32
$(package)_config_opts_powerpc_linux=linux-generic32 $(package)_config_opts_powerpc_linux=linux-generic32

View File

@ -144,6 +144,10 @@ if(ARCHITECTURE STREQUAL "riscv64")
set(ARCH_ID "riscv64") set(ARCH_ID "riscv64")
set(ARCH "rv64gc") set(ARCH "rv64gc")
endif() endif()
if(ARCHITECTURE STREQUAL "loongarch64")
set(ARCH_ID "loongarch64")
set(ARCH "loongarch")
endif()
if(ARCHITECTURE STREQUAL "i686") if(ARCHITECTURE STREQUAL "i686")
SET(ARCH_ID "i386") SET(ARCH_ID "i386")