secure-software-engineering / phasar

A LLVM-based static analysis framework.
Other
930 stars 140 forks source link

Using of "deprecated" c++-17 class(MacOs) #494

Closed haotianmichael closed 2 years ago

haotianmichael commented 2 years ago

Bug description

I try to build phasar. And include/phasar/PhasarLLVM/Pointer/PointsToSetOwner.h and include/phasar/PhasarLLVM/Pointer/LLVMPointsToSet.h use #include <memory_resource>, but when I used brew install llvm@13.0.1 to compile, it emitted errors that filememory_resourcenot found. I replaced this name with experimental/memory_resoruce, but it still emitted that unsynchronized_pool_resource not found. I did some research as follows:

Steps to reproduce

Actual result: class&operations commented in memory_resource still not found.

Expected result: Worked well.

Context (Environment)

Operating System:

Build Type:

Possible solution

I Googled libc++ supported c++17's implementations on memory_resource

But still not familiar well with c++ and libc++, So Please tell me what to do, thanks~

Example files

/usr/local/opt/llvm/include/c++/v1/experimental/memory_resource

haotianmichael commented 2 years ago

Roollbacking to 83b519e6 and rebuilding, everything works well. It seems that libc++'s implementation doesn't support unsynchronized_pool_resource? Any help would be grateful.

janniclas commented 2 years ago

Clang and specifically apple-clang don't support polymorphic memory resources as seen here. Depending on your setup you can try to use the gcc compiler to compile phasar. If you use a MacBook with the new M1 processor then this will be troublesome too, since the gcc support on the M1 is not soo good in my experience. At least I also still struggle to get it running. If you have any progress in this area please let me know. image

janniclas commented 2 years ago

Also, feel free to check out this branch. This fixed the issues for me.

MMory commented 2 years ago

@janniclas can we close this issue?