Closed frobnitzem closed 1 year ago
@llvm/issue-subscribers-clang-frontend
Could you please try 16 or main
branch? https://godbolt.org should be helpful.
Trying on the main
branch from this morning it appears to be fixed.
$ clang++ --version
clang version 17.0.0 (https://github.com/llvm/llvm-project 7d6c2e18114de9900d1b012cf9c219803b183f63)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/llvm-main-46f6kmxz64vnu2h74z456bbjwaobzcik/bin
I was unable to build llvm-16.0.6 using the same method that worked for main:
==> llvm: Executing phase: 'cmake'
==> Error: ProcessError: Command exited with status 1:
'/spack-envs/base/opt/linux-sles15-x86_64/gcc-7.5.0/cmake-3.23.2-4r4mpiba7cwdw2hlakh5i7tchi64s3qd/bin/cmake' '-G' 'Ninja' '-DCMAKE_INSTALL_PREFIX:STRING=/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/llvm-git.llvmorg-16.0.6-o66ymj6pmpgrbvu4bqtlvfbt27wvyyeu' '-DCMAKE_BUILD_TYPE:STRING=Release' '-DBUILD_TESTING:BOOL=OFF' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/llvm-git.llvmorg-16.0.6-o66ymj6pmpgrbvu4bqtlvfbt27wvyyeu/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/llvm-git.llvmorg-16.0.6-o66ymj6pmpgrbvu4bqtlvfbt27wvyyeu/lib64;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/binutils-2.40-rg6g4yyiqdzmc5ejmejezyt7d2xb3wmj/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/zlib-1.2.13-abrb3atbm7o5fggx4vybpt7g4ydwtpih/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/hwloc-2.9.0-zzjts67h2facfzs3tezbjdfb3dtdgvde/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/libpciaccess-0.16-mapeygkvvng2dilnbjb7ukkhpmcswxm2/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/libxml2-2.10.3-rvhmalp7pdtbgsdd6pthjow2kf4nugvk/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/libiconv-1.17-6m3ig2mpx2wioaqiortrj3ijoepbh3rs/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/xz-5.4.1-dyb23ip5utjeinb4aj4sccaemvawhvqu/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/ncurses-6.4-ofauveglil4rftaqtbwhgttdtd5drsqu/lib;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/libedit-3.1-20210216-yquigse5fctuujerftzgfnavbuqxk67x/lib;/opt/rocm-5.4.0' '-DCMAKE_PREFIX_PATH:STRING=/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/perl-data-dumper-2.173-7oaxd4wc4uwh3bbshuveosl3m3tc2rzk;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/ninja-1.11.1-komdbdics63iafimoqgc6rs72l7nmfsh;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/python-3.10.8-rk6whgdavdt3uyqhx5m5xd6554fz6ti3;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/libedit-3.1-20210216-yquigse5fctuujerftzgfnavbuqxk67x;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/hwloc-2.9.0-zzjts67h2facfzs3tezbjdfb3dtdgvde;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/libpciaccess-0.16-mapeygkvvng2dilnbjb7ukkhpmcswxm2;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/binutils-2.40-rg6g4yyiqdzmc5ejmejezyt7d2xb3wmj;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/ncurses-6.4-ofauveglil4rftaqtbwhgttdtd5drsqu;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/libxml2-2.10.3-rvhmalp7pdtbgsdd6pthjow2kf4nugvk;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/zlib-1.2.13-abrb3atbm7o5fggx4vybpt7g4ydwtpih;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/xz-5.4.1-dyb23ip5utjeinb4aj4sccaemvawhvqu;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/pkgconf-1.8.0-oizcqfus423o3zrvufjxaxlldkg4azgh;/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/libiconv-1.17-6m3ig2mpx2wioaqiortrj3ijoepbh3rs;/spack-envs/base/opt/linux-sles15-x86_64/gcc-7.5.0/cmake-3.23.2-4r4mpiba7cwdw2hlakh5i7tchi64s3qd' '-DLLVM_REQUIRES_RTTI:BOOL=ON' '-DLLVM_ENABLE_RTTI:BOOL=ON' '-DLLVM_ENABLE_EH:BOOL=ON' '-DLLVM_ENABLE_LIBXML2:BOOL=OFF' '-DCLANG_DEFAULT_OPENMP_RUNTIME:STRING=libomp' '-DPYTHON_EXECUTABLE:STRING=/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/python-3.10.8-rk6whgdavdt3uyqhx5m5xd6554fz6ti3/bin/python3.10' '-DLIBOMP_USE_HWLOC:BOOL=ON' '-DLIBOMP_HWLOC_INSTALL_DIR:STRING=/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/hwloc-2.9.0-zzjts67h2facfzs3tezbjdfb3dtdgvde' '-DPython3_EXECUTABLE:STRING=/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/python-3.10.8-rk6whgdavdt3uyqhx5m5xd6554fz6ti3/bin/python3.10' '-DCUDA_TOOLKIT_ROOT_DIR:STRING=IGNORE' '-DCUDA_SDK_ROOT_DIR:STRING=IGNORE' '-DCUDA_NVCC_EXECUTABLE:STRING=IGNORE' '-DLIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES:STRING=IGNORE' '-DLIBOMPTARGET_ENABLE_DEBUG:BOOL=OFF' '-DLLDB_ENABLE_LIBEDIT:BOOL=ON' '-DLLDB_ENABLE_CURSES:BOOL=ON' '-DLLVM_ENABLE_TERMINFO:BOOL=ON' '-DLLDB_ENABLE_LIBXML2:BOOL=OFF' '-DLLDB_DISABLE_PYTHON:BOOL=ON' '-DLLVM_BINUTILS_INCDIR:STRING=/spack-manager/spack/opt/spack/linux-sles15-zen3/clang-15.0.0/binutils-2.40-rg6g4yyiqdzmc5ejmejezyt7d2xb3wmj/include' '-DLINK_POLLY_INTO_TOOLS:BOOL=ON' '-DBUILD_SHARED_LIBS:BOOL=OFF' '-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON' '-DLLVM_LINK_LLVM_DYLIB:BOOL=OFF' '-DLLVM_USE_SPLIT_DWARF:BOOL=OFF' '-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY:BOOL=ON' '-DLLVM_TARGETS_TO_BUILD:STRING=X86' '-DLIBOMP_TSAN_SUPPORT:BOOL=OFF' '-DLLVM_ENABLE_PROJECTS:STRING=lldb;clang;clang-tools-extra;openmp;lld;compiler-rt;libcxx;libcxxabi;libunwind;polly' '/spack-manager/stage/spack-stage-llvm-git.llvmorg-16.0.6-o66ymj6pmpgrbvu4bqtlvfbt27wvyyeu/spack-src/llvm'
1 error found in build log:
13 -- Detecting C compile features - done
14 -- Detecting CXX compiler ABI info
15 -- Detecting CXX compiler ABI info - done
16 -- Check for working CXX compiler: /spack-manager/spack/lib/spack/env/clang/clang++ - skipped
17 -- Detecting CXX compile features
18 -- Detecting CXX compile features - done
>> 19 CMake Error at CMakeLists.txt:139 (MESSAGE):
20 libcxx isn't a known project:
21 bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;
libclc;lld;lldb;mlir;openmp;polly;pstl;flang.
22 Did you mean to enable it as a runtime in LLVM_ENABLE_RUNTIMES?
23
24
25 -- Configuring incomplete, errors occurred!
The bug is not present in 15.0.7 either. Apparently it was only present in earlier patch-levels.
I'm closing this ticket based on this.
$ clang++ --version
clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
Target: x86_64-unknown-linux-gnu
Thread model: posix
While compiling a large header-based library, I ran into a segfault that appears to be coming from the Clang C++ source parser. For this particular package, the
grid_generator.cc
file is the only one of its cc source files that displays the error. All its other sources compile fine with llvm. I originally used a few system-specific modified LLVM 15 versions, but have since reproduced the error with basic LLVM 12 and LLVM 14. GCC 7.5 does not have the error. Apple Clang 14 on my MacBook also does not have the error.A reproducer for the bug is here (in the
build.sh
script):https://github.com/frobnitzem/llvm-parse-bug1
Changing the text of the source file slightly around the indicated error token does not resolve the issue, but sometimes causes the error message to blame a file location thousands of lines away (e.g. 3059,2023, etc.). Other versions of Clang have more verbose output. In particular, Cray Clang version 15.0.0 (324a8e7de6a18594c06a0ee5d8c0eda2109c6ac6) shows: