build failure with clang 10 on Ubuntu 20.04
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 3
Description
Doing
```
cmake ..
make build
```
Leads to:
```
/usr/bin/ld: /usr/lib/llvm-10/lib/libclangCodeGen.a(BackendUtil.cpp.o): in function `(anonymous namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction, std::unique_ptr >)':
(.text._ZN12_GLOBAL__N_118EmitAssemblyHelper30EmitAssemblyWithNewPassManagerEN5clang13BackendActionESt10unique_ptrIN4llvm17raw_pwrite_streamESt14default_deleteIS5_EE+0x1f15): undefined reference to `getPollyPluginInfo()'
collect2: error: ld returned 1 exit status
make[2]: *** [examples/cpp/CMakeFiles/HelloWorld.dir/build.make:158: examples/cpp/HelloWorld] Error 1
make[1]: *** [CMakeFiles/Makefile2:1069: examples/cpp/CMakeFiles/HelloWorld.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
```
This is with `clang version 10.0.0-4ubuntu1`.
This appears to be upstream clang issue https://bugs.llvm.org/show_bug.cgi?id=44870
A fix claims to have been merged upstream but apparently didn't make this clang release. I gather from other Google hits that there are workarounds to be done in the cmake files, but I don't know the details.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with clang 10 on Ubuntu 20.04 using the reported cmake and make build commands. Read the CMake build configuration and the linked upstream Clang issue to identify the applicable workaround; done means the examples build successfully without the undefined reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100