Add -latomic to samples and tests

This commit is contained in:
lazymio 2023-12-28 22:50:48 +08:00
parent f389666ea6
commit db0acd5ace
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873

View File

@ -202,11 +202,13 @@ else()
string(FIND "${UC_COMPILER_MACRO}" "__mips__" UC_RET)
if(${UC_RET} GREATER_EQUAL "0")
set(UNICORN_TARGET_ARCH "mips")
set(UNICORN_CFLAGS ${UNICORN_CFLAGS} -latomic)
break()
endif()
string(FIND "${UC_COMPILER_MACRO}" "__sparc__" UC_RET)
if(${UC_RET} GREATER_EQUAL "0")
set(UNICORN_TARGET_ARCH "sparc")
set(UNICORN_CFLAGS ${UNICORN_CFLAGS} -latomic)
break()
endif()
string(FIND "${UC_COMPILER_MACRO}" "__ia64__" UC_RET)
@ -217,6 +219,7 @@ else()
string(FIND "${UC_COMPILER_MACRO}" "_ARCH_PPC" UC_RET)
if(${UC_RET} GREATER_EQUAL "0")
set(UNICORN_TARGET_ARCH "ppc")
set(UNICORN_CFLAGS ${UNICORN_CFLAGS} -latomic)
break()
endif()
string(FIND "${UC_COMPILER_MACRO}" "__riscv" UC_RET)
@ -228,6 +231,7 @@ else()
string(FIND "${UC_COMPILER_MACRO}" "__s390__" UC_RET)
if(${UC_RET} GREATER_EQUAL "0")
set(UNICORN_TARGET_ARCH "s390")
set(UNICORN_CFLAGS ${UNICORN_CFLAGS} -latomic)
break()
endif()
string(FIND ${UC_COMPILER_MACRO} "__tricore__" UC_RET)
@ -1194,6 +1198,7 @@ if(BUILD_SHARED_LIBS)
endif()
set(UNICORN_LINK_LIBRARIES ${UNICORN_LINK_LIBRARIES} unicorn-common)
set(UNICORN_COMPILE_OPTIONS ${UNICORN_COMPILE_OPTIONS} ${UNICORN_CFLAGS})
if(UNICORN_HAS_X86)
set(UNICORN_COMPILE_OPTIONS ${UNICORN_COMPILE_OPTIONS} -DUNICORN_HAS_X86)
set(UNICORN_LINK_LIBRARIES ${UNICORN_LINK_LIBRARIES} x86_64-softmmu)