Fix Implib.so imports when 'amd64' architecture is using (#10618)

Co-authored-by: Alexey Marchenko <santana705736@gmail.com>
This commit is contained in:
Jingyu Zhou 2023-07-17 03:04:56 -07:00 committed by GitHub
parent 522c9d4f0f
commit 4b00018a33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -439,17 +439,24 @@ elseif(NOT WIN32 AND NOT APPLE) # Linux Only
${SHIM_LIB_OUTPUT_DIR}/libfdb_c.so.tramp.S)
set(IMPLIBSO_SRC_DIR ${CMAKE_SOURCE_DIR}/contrib/Implib.so)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
set(IMPLIBSO_ARCH "x86_64")
else()
set(IMPLIBSO_ARCH ${CMAKE_SYSTEM_PROCESSOR})
endif()
set(IMPLIBSO_SRC
${IMPLIBSO_SRC_DIR}/implib-gen.py
${IMPLIBSO_SRC_DIR}/arch/common/init.cpp.tpl
${IMPLIBSO_SRC_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/config.ini
${IMPLIBSO_SRC_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/table.S.tpl
${IMPLIBSO_SRC_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/trampoline.S.tpl
${IMPLIBSO_SRC_DIR}/arch/${IMPLIBSO_ARCH}/config.ini
${IMPLIBSO_SRC_DIR}/arch/${IMPLIBSO_ARCH}/table.S.tpl
${IMPLIBSO_SRC_DIR}/arch/${IMPLIBSO_ARCH}/trampoline.S.tpl
)
add_custom_command(OUTPUT ${SHIM_LIB_GEN_SRC}
COMMAND $<TARGET_FILE:Python3::Interpreter> ${IMPLIBSO_SRC_DIR}/implib-gen.py
--target ${CMAKE_SYSTEM_PROCESSOR}
--target ${IMPLIBSO_ARCH}
--outdir ${SHIM_LIB_OUTPUT_DIR}
--dlopen-callback=fdb_shim_dlopen_callback
--symbol-filter='^fdb_.*$$'