KhronosGroup / KhronosGroup/SPIRV-LLVM-Translator

Incompatibility when linking with llvm 16

Open
#1,936 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
LLVM
Stars
625
Forks
279
Avg merge
3d 5h
Merged PRs (30d)
34

Description

We (Slackware) updated both llvm and spirv-llvm-translator to the latet versions (16.0.0) and ran into an issue. When both `libLLVM.so.16` and `libLLVMSPIRVLib.so.16` are loaded into the same process, the application aborts.
This simple example is enough to reproduce it for us:

```
$ echo "int main(void) { return 0; }" > llvm-test.cpp && gcc llvm-test.cpp -lLLVM -lLLVMSPIRVLib -o llvm-test && ./llvm-test
: CommandLine Error: Option 'use-dbg-addr' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
Aborted
```

This is currently the case for both `libMesaOpenCL` and `libRusticlOpenCL` (and potentially other OpenCL drivers) and thus affecting all applications using OpenCL.

Contributor guide

Open the contributing guide

Research direction

Start with the provided llvm-test.cpp reproduction and its link command using libLLVM.so.16 and libLLVMSPIRVLib.so.16. Investigate the duplicate registration of the use-dbg-addr option; done means the example loads both libraries and runs without the LLVM command-line registration abort.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.