File tree Expand file tree Collapse file tree 6 files changed +30
-3
lines changed Expand file tree Collapse file tree 6 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ builtin_check_c_compiler_flag(-Wno-pedantic COMPILER_RT_HAS_WNO_PEDANTIC
2222builtin_check_c_compiler_flag(-nogpulib COMPILER_RT_HAS_NOGPULIB_FLAG)
2323builtin_check_c_compiler_flag(-flto COMPILER_RT_HAS_FLTO_FLAG)
2424builtin_check_c_compiler_flag(-fconvergent-functions COMPILER_RT_HAS_FCONVERGENT_FUNCTIONS_FLAG)
25+ builtin_check_c_compiler_flag("-Xclang -mcode-object-version=none" COMPILER_RT_HAS_CODE_OBJECT_VERSION_FLAG)
2526builtin_check_c_compiler_flag(-Wbuiltin-declaration-mismatch COMPILER_RT_HAS_WBUILTIN_DECLARATION_MISMATCH_FLAG)
2627builtin_check_c_compiler_flag(/Zl COMPILER_RT_HAS_ZL_FLAG)
2728builtin_check_c_compiler_flag(-fcf-protection=full COMPILER_RT_HAS_FCF_PROTECTION_FLAG)
Original file line number Diff line number Diff line change @@ -832,6 +832,12 @@ else ()
832832 append_list_if(COMPILER_RT_HAS_FLTO_FLAG -flto BUILTIN_CFLAGS)
833833 append_list_if(COMPILER_RT_HAS_FCONVERGENT_FUNCTIONS_FLAG
834834 -fconvergent-functions BUILTIN_CFLAGS)
835+
836+ # AMDGPU targets want to use a generic ABI.
837+ if ("${COMPILER_RT_DEFAULT_TARGET_ARCH} " MATCHES "amdgcn" )
838+ append_list_if(COMPILER_RT_HAS_CODE_OBJECT_VERSION_FLAG
839+ "SHELL:-Xclang -mcode-object-version=none" BUILTIN_CFLAGS)
840+ endif ()
835841 endif ()
836842
837843 set (BUILTIN_DEFS "" )
Original file line number Diff line number Diff line change @@ -215,6 +215,8 @@ function(_get_common_compile_options output_var flags)
215215 if (LIBC_CUDA_ROOT)
216216 list (APPEND compile_options "--cuda-path=${LIBC_CUDA_ROOT} " )
217217 endif ()
218+ elseif (LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
219+ list (APPEND compile_options "SHELL:-Xclang -mcode-object-version=none" )
218220 endif ()
219221 endif ()
220222 set (${output_var} ${compile_options} PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ set(LIBCXX_TEST_CONFIG "amdgpu-libc++-shared.cfg.in" CACHE STRING "")
3232set (LIBCXX_TEST_PARAMS "optimization=none;long_tests=False;executor=amdhsa-loader" CACHE STRING "" )
3333
3434# Necessary compile flags for AMDGPU.
35- set (LIBCXX_ADDITIONAL_COMPILE_FLAGS "-nogpulib;-flto;-fconvergent-functions" CACHE STRING "" )
36- set (LIBCXXABI_ADDITIONAL_COMPILE_FLAGS "-nogpulib;-flto;-fconvergent-functions" CACHE STRING "" )
35+ set (LIBCXX_ADDITIONAL_COMPILE_FLAGS
36+ "-nogpulib;-flto;-fconvergent-functions;SHELL:-Xclang -mcode-object-version=none" CACHE STRING "" )
37+ set (LIBCXXABI_ADDITIONAL_COMPILE_FLAGS
38+ "-nogpulib;-flto;-fconvergent-functions;SHELL:-Xclang -mcode-object-version=none" CACHE STRING "" )
3739set (CMAKE_REQUIRED_FLAGS "-nogpulib" CACHE STRING "" )
Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ function(compileDeviceRTLLibrary target_name target_triple)
299299endfunction ()
300300
301301add_custom_target (omptarget.devicertl.amdgpu)
302- compileDeviceRTLLibrary(amdgpu amdgcn-amd-amdhsa)
302+ compileDeviceRTLLibrary(amdgpu amdgcn-amd-amdhsa -Xclang -mcode-object- version =none )
303303
304304add_custom_target (omptarget.devicertl.nvptx)
305305compileDeviceRTLLibrary(nvptx nvptx64-nvidia-cuda --cuda-feature=+ptx63)
Original file line number Diff line number Diff line change 1+ // RUN: %libomptarget-compile-amdgcn-amd-amdhsa -Xclang \
2+ // RUN: -mcode-object-version=5
3+ // RUN: %libomptarget-run-amdgcn-amd-amdhsa | %fcheck-amdgcn-amd-amdhsa
4+
5+ // REQUIRES: amdgcn-amd-amdhsa
6+
7+ #include <stdio.h>
8+
9+ // Test to make sure we can build and run with the previous COV.
10+ int main () {
11+ #pragma omp target
12+ ;
13+
14+ // CHECK: PASS
15+ printf ("PASS\n" );
16+ }
You can’t perform that action at this time.
0 commit comments