From 6cb77fcfb37ffb445ab62ea1545422dc52128da1 Mon Sep 17 00:00:00 2001 From: jinge90 Date: Thu, 16 May 2024 19:09:52 +0800 Subject: [PATCH] [SYCL] Add -fPIC for Intel math function host code (#13800) Add "-fPIC" for compiling Intel math function host code. Signed-off-by: jinge90 --- libdevice/cmake/modules/SYCLLibdevice.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libdevice/cmake/modules/SYCLLibdevice.cmake b/libdevice/cmake/modules/SYCLLibdevice.cmake index 708b472dcb98..e8c96d009982 100644 --- a/libdevice/cmake/modules/SYCLLibdevice.cmake +++ b/libdevice/cmake/modules/SYCLLibdevice.cmake @@ -217,6 +217,11 @@ set(imf_bf16_fallback_src ${imf_fallback_src_dir}/imf_bf16_fallback.cpp) set(imf_host_cxx_flags -c -D__LIBDEVICE_HOST_IMPL__ ) + +if (NOT WIN32) + list(APPEND imf_host_cxx_flags -fPIC) +endif() + add_custom_command(OUTPUT ${imf_fp32_fallback_src} COMMAND ${CMAKE_COMMAND} -D SRC_DIR=${imf_src_dir} -D DEST_DIR=${imf_fallback_src_dir}