You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: 0: Unresolved external reference to "_Z6printfPU3AS2Kcz".
clang++: error: spirv-link command failed with exit code 1 (use -v to see invocation)
(the same happens with -cl-std clc++).
It seems that the LLVM-SPIRV translater expects an unmangled printf symbol, but llvm emits a C++ mangled symbol.
It works when I use the experimental internal SPIRV emiter via -fintegrated-objemitter.
Also with POCL it does not work due to the mangled symbol (see pocl/pocl#1759), thus I assume llvm should produce an unmangled printf symbol as specified in OpenCL 1.2. Or all other software packages will need to adapt for clc++.
The text was updated successfully, but these errors were encountered:
With clang 19.1.3, the following example
```
__kernel void test()
{
printf("test");
}
```
compiles in OpenCL C mode to SPIRV:
```
clang++ --target=spirv64 -cl-std=CL2.0 -fno-integrated-objemitter -o test.spirv test.cl -O0
```
but in C++ for OpenCL mode
```
clang++ --target=spirv64 -cl-std=CLC++2021 -fno-integrated-objemitter -o test.spirv test.cl -O0
```
I get:
```
error: 0: Unresolved external reference to "_Z6printfPU3AS2Kcz".
clang++: error: spirv-link command failed with exit code 1 (use -v to see invocation)
```
(the same happens with `-cl-std clc++`).
It seems that the LLVM-SPIRV translater expects an unmangled printf symbol, but llvm emits a C++ mangled symbol.
It works when I use the experimental internal SPIRV emiter via -fintegrated-objemitter.
Also with POCL it does not work due to the mangled symbol (see pocl/pocl#1759), thus I assume llvm should produce an unmangled printf symbol as specified in OpenCL 1.2. Or all other software packages will need to adapt for clc++.
With clang 19.1.3, the following example
compiles in OpenCL C mode to SPIRV:
but in C++ for OpenCL mode
I get:
(the same happens with
-cl-std clc++
).It seems that the LLVM-SPIRV translater expects an unmangled printf symbol, but llvm emits a C++ mangled symbol.
It works when I use the experimental internal SPIRV emiter via
-fintegrated-objemitter
.Also with POCL it does not work due to the mangled symbol (see pocl/pocl#1759), thus I assume llvm should produce an unmangled printf symbol as specified in OpenCL 1.2. Or all other software packages will need to adapt for
clc++
.The text was updated successfully, but these errors were encountered: