llvm / llvm/llvm-project

fail to compile LLVM 23.1.1 in ubuntu 18.04

Open
#219,419 2 comments 0 reactions 0 assignees View on GitHub
build-problem clang-tools-extra
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

When I try to compile LLVM 23.1.1 in ubuntu 18.04,it gives the following error message,but I can build LLVM 22 in ubuntu 18.04:
```
/tmp/ccZuwudM.s: Assembler messages:
/tmp/ccZuwudM.s:253: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:309: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:318: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:327: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:336: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:345: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:354: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:363: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:372: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:381: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:390: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
/tmp/ccZuwudM.s:399: Error: symbol `_ZN4llvm12function_refIFvRNS_4json6ObjectEEE11callback_fnIUlS3_E2_EEvlS3_' is already defined
tools/clang/tools/extra/clang-doc/CMakeFiles/obj.clangDoc.dir/build.make:204: recipe for target 'tools/clang/tools/extra/clang-doc/CMakeFiles/obj.clangDoc.dir/JSONGenerator.cpp.o' failed
make[2]: *** [tools/clang/tools/extra/clang-doc/CMakeFiles/obj.clangDoc.dir/JSONGenerator.cpp.o] Error 1
```

the LLVM commit SHA1 ID:
21cd7726af6f743cd33557fb5311babac83fab05
Bump version to 23.1.1

build steps:
(1): install python 3.8:
```
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.8
python3.8 --version
```

(2): install cmake 3.31.6:
```
sudo tar --strip-components=1 -xvf ../cmake-3.31.6-linux-x86_64.tar.gz -C /usr
```

(3): compile LLVM 23.1.1:
```
cmake -S llvm -B build -G "Unix Makefiles" \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
-DLLVM_ENABLE_RUNTIMES=compiler-rt \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/home/xxxx/LLVM-23.1.1-ubuntu-18.04

cd build
make -j16
make install
```

compiler and other software package version:
```
gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

```
make --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
```

```
python3.8 --version
Python 3.8.0
```

```
cmake --version
cmake version 3.31.6

CMake suite maintained and supported by Kitware (kitware.com/cmake).
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing commit 21cd7726af6f743cd33557fb5311babac83fab05 on Ubuntu 18.04 with the provided CMake and Make commands. Inspect the tools/clang/tools/extra/clang-doc/CMakeFiles/obj.clangDoc.dir/JSONGenerator.cpp.o target and compare the LLVM 23.1.1 failure with the reported successful LLVM 22 build. Done means the failing target compiles successfully or the supported build limitation is clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, ubuntu
Domain
build-system, compilers, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.