-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Description
I'm trying to build Clang 18.1.4 with offloading with nvptx and amdgpu. The pretty much same cmake args worked on 17.0.6.
Modules loaded:
'torel@srl-login1:~$ module list
Currently Loaded Modulefiles:
- slurm/21.08.8 6) cuda12.3/toolkit/12.3.2 11) gmp/gcc/6.3.0(default)
- docker/20.10.26 7) cuda12.3/blas/12.3.2 12) mpfr/gcc/4.2.1(default)
- google/gdrive/2.1.0 8) cuda12.3/fft/12.3.2 13) mpc/gcc/u2204/1.3.1(default)
- numactl/gcc/2.0.18 9) cuda12.3/profiler/12.3.2 14) cmake/gcc/3.28.4
- hwloc/gcc/2.10.0(default) 10) amd/rocm/5.7.3
'
Cmake config:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-mavx2 -mno-avx512f -mno-avx512pf -mno-avx512bw" -DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt;bolt;libc;libclc;lld;lldb;openmp;flang;polly;pstl;mlir" -DCMAKE_INSTALL_PREFIX=/cm/shared/apps/clang/gcc/18.1.4 -G "Unix Makefiles" ../llvm -DCLANG_OPENMP_NVPTX_DEFAULT_ARCH=sm_80 -DLIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=70,75,80,90 -DLIBOMPTARGET_DEP_CUDA_DRIVER=/cm/shared/apps/cuda12.3/toolkit/12.3.2/targets/x86_64-linux/lib/stubs/libcuda.so
Build fails at
[ 22%] Building CXX object projects/libc/src/string/CMakeFiles/libc.src.string.strcpy.dir/strcpy.cpp.o
In file included from /home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/__support/endian.h:12,
from /home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/memory_utils/utils.h:1 ,
from /home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/memory_utils/inline_memcpy.h:14,
from /home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/strcpy.cpp:10:
/home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/strcpy.cpp:17:28: error: ‘char* __llvm_libc_18_1_4_::strcpy(char*, const char*)’ aliased to external symbol ‘strcpy’
17 | LLVM_LIBC_FUNCTION(char *, strcpy,
| ^~~~~~
/home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/__support/common.h:28:34: note: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
28 | decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]]; \
| ^~~~
/home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/strcpy.cpp:17:1: note: in expansion of macro ‘LLVM_LIBC_FUNCTION’
17 | LLVM_LIBC_FUNCTION(char *, strcpy,
| ^~~~~~~~~~~~~~~~~~
/home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/strcpy.cpp:17:28: error: ‘char* __llvm_libc_18_1_4_::strcpy(char*, const char*)’ specifies less restrictive attributes than its target ‘char* strcpy(char*, const char*)’: ‘leaf’, ‘nonnull’, ‘nothrow’ [-Werror=missing-attributes]
17 | LLVM_LIBC_FUNCTION(char *, strcpy,
| ^~~~~~
/home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/__support/common.h:28:34: note: in definition of macro ‘LLVM_LIBC_FUNCTION_IMPL’
28 | decltype(LIBC_NAMESPACE::name) name [[gnu::alias(#name)]]; \
| ^~~~
/home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/strcpy.cpp:17:1: note: in expansion of macro ‘LLVM_LIBC_FUNCTION’
17 | LLVM_LIBC_FUNCTION(char *, strcpy,
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/string.h:26,
from /home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/strcpy.h:12,
from /home/torel/workspace/Clang/llvm-project-llvmorg-18.1.4/libc/src/string/strcpy.cpp:9:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:77:1: note: ‘char* __llvm_libc_18_1_4_::strcpy(char*, const char*)’ target declared here
77 | __NTH (strcpy (char *__restrict __dest, const char *__restrict __src))
| ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [projects/libc/src/string/CMakeFiles/libc.src.string.strcpy.dir/build.make:76: projects/libc/src/string/CMakeFiles/libc.src.string.strcpy.dir/strcpy.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:81671: projects/libc/src/string/CMakeFiles/libc.src.string.strcpy.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
torel@srl-login1:~/workspace/Clang/llvm-project-llvmorg-18.1.4/Build-clang-x86_64$
Any suggestions?