/usr/local/llvm14/bin/opt: array_01_cpp_m2r_dbg.ll:13:16: error: expected type
yurivict opened this issue · 1 comments
yurivict commented
- I have searched open and closed issues for duplicates
- I made sure that I am not using an old project version (DO: pull Phasar, update git submodules, rebuild the project and check if the bug is still there)
Bug description
Build fails on FreeBSD 14-CURRENT:
[ 31% 237/760] cd /wrkdirs/usr/ports/devel/phasar/work/.build/test/llvm_test_code/constness/array && /usr/bin/c++ -std=c++17 -fno-discard-value-names -emit-llvm -S -Xclang -disable-O0-optnone -g /wrkdirs/usr/ports/devel/phasar/work/phasar-1222/test/llvm_test_code/constness/array/array_01.cpp -o array_01_cpp_m2r_dbg.ll && /usr/local/llvm14/bin/opt -mem2reg -S array_01_cpp_m2r_dbg.ll -o array_01_cpp_m2r_dbg.ll
FAILED: test/llvm_test_code/constness/array/array_01_cpp_m2r_dbg.ll /wrkdirs/usr/ports/devel/phasar/work/.build/test/llvm_test_code/constness/array/array_01_cpp_m2r_dbg.ll
cd /wrkdirs/usr/ports/devel/phasar/work/.build/test/llvm_test_code/constness/array && /usr/bin/c++ -std=c++17 -fno-discard-value-names -emit-llvm -S -Xclang -disable-O0-optnone -g /wrkdirs/usr/ports/devel/phasar/work/phasar-1222/test/llvm_test_code/constness/array/array_01.cpp -o array_01_cpp_m2r_dbg.ll && /usr/local/llvm14/bin/opt -mem2reg -S array_01_cpp_m2r_dbg.ll -o array_01_cpp_m2r_dbg.ll
array_01_cpp_m2r_dbg.ll:13:16: warning: ptr type is only supported in -opaque-pointers mode
store i32 0, ptr %retval, align 4
^
/usr/local/llvm14/bin/opt: array_01_cpp_m2r_dbg.ll:13:16: error: expected type
store i32 0, ptr %retval, align 4
^
Steps to reproduce
Regular build
Context (Environment)
- phasar: 1222
Operating System:
- Linux
- Windows
- macOS
- FreeBSD
Build Type:
- cmake
- custom build
Possible solution
We are happy to discuss possible solutions to this problem, especially if it origniates from a design flaw.
Example files
Files:
fabianbs96 commented
Hi @yurivict,
this is an issue that we have also observed ourselves. This comes when you compile phasar with a clang version >14. Then it compiles the LLVM test files for our unittests with that version as well. As phasar is currently set up to support LLVM 14, there is a compatibility issue. There are several ways to resolve this issue:
- Compile phasar with the clang version that comes with LLVM 14 (which you probably have installed on your system anyway). To use clang-14 to compile phasar, you can just configure your build with setting it as
CC
andCXX
, so, for example:CC=path/to/your/llvm-14/bin/clang CXX=/path/to/your/llvm-14/bin/clang++ cmake -G Ninja ..
- Disable the tests by setting the cmake variables
PHASAR_BUILD_UNITTESTS
andPHASAR_BUILD_IR
toOFF
, so for examplecmake -DPHASAR_BUILD_UNITTESTS=OFF -DPHASAR_BUILD_IR=OFF -G Ninja ..
This issue will be fixed by #516