Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/local/llvm14/bin/opt: array_01_cpp_m2r_dbg.ll:13:16: error: expected type #604

Closed
4 of 8 tasks
yurivict opened this issue Mar 24, 2023 · 1 comment
Closed
4 of 8 tasks
Labels
done-elsewhere This is taken care of in a different PR

Comments

@yurivict
Copy link

  • 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
Copy link
Member

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 and CXX, 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 and PHASAR_BUILD_IR to OFF, so for example cmake -DPHASAR_BUILD_UNITTESTS=OFF -DPHASAR_BUILD_IR=OFF -G Ninja ..

This issue will be fixed by #516

@MMory MMory added the done-elsewhere This is taken care of in a different PR label May 3, 2023
@MMory MMory closed this as completed Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done-elsewhere This is taken care of in a different PR
Projects
None yet
Development

No branches or pull requests

3 participants