Issue 182413
Summary Errors Building
Labels new issue
Assignees
Reporter Not-Helpful
    Hello, I am trying to build release/16.x with the following script:
rm -rf build/16
rm -rf $INSTALLS/llvm/16/
mkdir $INSTALLS/llvm/16/
mkdir -p build
mkdir build/16

cmake -S llvm -B build/16 -G Ninja \
   -DLLVM_ENABLE_PROJECTS='clang' \
   -DCMAKE_INSTALL_PREFIX=$INSTALLS/llvm/16 \
   -DCMAKE_BUILD_TYPE=Release

cd build/16
ninja     # This fails
ninja install
cd ../../

The build fails (at the first ninja command) with dozens of errors all related to one file: llvm/llvm/include/llvm/ADT/SmallVector.h

All of the errors have the same shape. SmallVector does not have member X

Example: 
llvm/llvm/include/llvm/ADT/SmallVector.h:1206:31: error: ‘class llvm::SmallVector<char, 128>’ has no member named ‘begin’
 1206 |     this->destroy_range(this->begin(), this->end());

When inspecting the file, I can see the begin() function on line 270:
  iterator begin() { return (iterator)this->BeginX; }

Now, I don't really know C++ that well. So i could easily be convinced that some template magic is afoot that makes begin() a member sometimes, but not other times, but I find it very unlikely that Release/16.x is broken. I am guessing that I am doing something wrong.

What I have tried: 
Setting CXX = g++ (installed from pacman) and clang++ (built from github main branch). Both gave the same errors. I also tried completely deleting the build folder to wipe any artifacts. Also didnt work. I tried setting the standard to different versions. C++20 got passed the SmallVector file without erroring, but produced other errors. Lastly, I tried recreating a new Arch install based on the below material, on a different system, and got the error again.

Recreation:
Installed pacman packages (pacman -Qe):
base 3-2
base-devel 1-2
bash-completion 2.17.0-3
boost 1.89.0-4
cmake 4.2.3-1
gcc 15.2.1+r447+g6a64f6c3ebb8-1
git 2.52.0-2
glibc-locales 2.42+r51+gcbf39c26b258-2
hwloc 2.12.2-1
jdk17-openjdk 17.0.18.u8-1
lua51 5.1.5-13
make 4.4.1-2
nano 8.7-1
neovim 0.11.6-1
ninja 1.13.2-2
openssh 10.2p1-2
python 3.14.2-2
sshpass 1.10-2
sudo 1.9.17.p2-2
unzip 6.0-23
vim 9.1.2077-1
wget 1.25.0-3

gcc used from pacman package listed above. clang++ built from source off the main branch with the following script:
rm -rf ./build/

cmake -S ./llvm -B ./build/ -G Ninja \
   -DLLVM_ENABLE_PROJECTS="clang;lldb;llvm" \
   -DLLVM_ENABLE_RUNTIMES="all" \
   -DLLVM_TARGETS_TO_BUILD=X86 \
   -DCMAKE_INSTALL_PREFIX=$INSTALLS/llvm/full_build/

cd ./build/
ninja
ninja install

And the following clang++.cfg follow is also present:
--target=x86_64-unknown-linux-gnu
-I/home/helpful/.installs/llvm/full_build/include/x86_64-unknown-linux-gnu/
-Wl,-rpath,/home/helpful/.installs/llvm/full_build/lib/x86_64-unknown-linux-gnu/

Sorry if this is too much info. I'm not sure what is relevant and what isn't so I wanted to make sure the issue covered everything. I can post the actual error output if needed too.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to