SVF icon indicating copy to clipboard operation
SVF copied to clipboard

SVF build

Open luqu1999 opened this issue 2 years ago • 5 comments

lq@lq-virtual-machine:~/SVF$ ./build.sh LLVM_DIR=/home/lq/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04 Z3_DIR=/home/lq/z3-4.8.8-x64-ubuntu-16.04 -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Linker detection: GNU ld -- Found Z3: /home/lq/z3-4.8.8-x64-ubuntu-16.04/bin/libz3.a -- Z3 include dir: /home/lq/z3-4.8.8-x64-ubuntu-16.04/include -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE
-- Configuring done -- Generating done -- Build files have been written to: /home/lq/SVF/Release-build Scanning dependencies of target Svf [ 0%] Building CXX object lib/CMakeFiles/Svf.dir/CFL/CFGNormalizer.cpp.o [ 1%] Building CXX object lib/CMakeFiles/Svf.dir/CFL/CFLGrammar.cpp.o [ 2%] Building CXX object lib/CMakeFiles/Svf.dir/CFL/CFLAlias.cpp.o [ 3%] Building CXX object lib/CMakeFiles/Svf.dir/CFL/CFLGraphBuilder.cpp.o In file included from /home/lq/SVF/include/SVF-FE/LLVMModule.h:33:0, from /home/lq/SVF/include/Util/SVFUtil.h:34, from /home/lq/SVF/lib/CFL/CFLGrammar.cpp:31: /home/lq/SVF/include/SVF-FE/BasicTypes.h:107:15: error: ‘VPIntrinsic’ in namespace ‘llvm’ does not name a type typedef llvm::VPIntrinsic VPIntrinsic; ^~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:110:15: error: ‘MinMaxIntrinsic’ in namespace ‘llvm’ does not name a type typedef llvm::MinMaxIntrinsic MinMaxIntrinsic; ^~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:124:15: error: ‘MemCpyInlineInst’ in namespace ‘llvm’ does not name a type typedef llvm::MemCpyInlineInst MemCpyInlineInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:136:15: error: ‘PseudoProbeInst’ in namespace ‘llvm’ does not name a type typedef llvm::PseudoProbeInst PseudoProbeInst; ^~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:137:15: error: ‘NoAliasScopeDeclInst’ in namespace ‘llvm’ does not name a type typedef llvm::NoAliasScopeDeclInst NoAliasScopeDeclInst; ^~~~~~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:138:15: error: ‘GCStatepointInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCStatepointInst GCStatepointInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:139:15: error: ‘GCProjectionInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCProjectionInst GCProjectionInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:140:15: error: ‘GCRelocateInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCRelocateInst GCRelocateInst; ^~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:141:15: error: ‘GCResultInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCResultInst GCResultInst; ^~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:142:15: error: ‘AssumeInst’ in namespace ‘llvm’ does not name a type typedef llvm::AssumeInst AssumeInst; ^~~~~~~~~~ In file included from /home/lq/SVF/include/SVF-FE/LLVMModule.h:33:0, from /home/lq/SVF/include/Util/SVFUtil.h:34, from /home/lq/SVF/lib/CFL/CFGNormalizer.cpp:31: /home/lq/SVF/include/SVF-FE/BasicTypes.h:107:15: error: ‘VPIntrinsic’ in namespace ‘llvm’ does not name a type typedef llvm::VPIntrinsic VPIntrinsic; ^~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:110:15: error: ‘MinMaxIntrinsic’ in namespace ‘llvm’ does not name a type typedef llvm::MinMaxIntrinsic MinMaxIntrinsic; ^~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:124:15: error: ‘MemCpyInlineInst’ in namespace ‘llvm’ does not name a type typedef llvm::MemCpyInlineInst MemCpyInlineInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:136:15: error: ‘PseudoProbeInst’ in namespace ‘llvm’ does not name a type typedef llvm::PseudoProbeInst PseudoProbeInst; ^~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:137:15: error: ‘NoAliasScopeDeclInst’ in namespace ‘llvm’ does not name a type typedef llvm::NoAliasScopeDeclInst NoAliasScopeDeclInst; ^~~~~~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:138:15: error: ‘GCStatepointInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCStatepointInst GCStatepointInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:139:15: error: ‘GCProjectionInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCProjectionInst GCProjectionInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:140:15: error: ‘GCRelocateInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCRelocateInst GCRelocateInst; ^~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:141:15: error: ‘GCResultInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCResultInst GCResultInst; ^~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:142:15: error: ‘AssumeInst’ in namespace ‘llvm’ does not name a type typedef llvm::AssumeInst AssumeInst; ^~~~~~~~~~ In file included from /home/lq/SVF/include/SVF-FE/LLVMModule.h:33:0, from /home/lq/SVF/include/Util/SVFUtil.h:34, from /home/lq/SVF/include/Graphs/ICFGNode.h:33, from /home/lq/SVF/include/MemoryModel/SVFStatements.h:36, from /home/lq/SVF/include/Graphs/IRGraph.h:34, from /home/lq/SVF/include/MemoryModel/SVFIR.h:33, from /home/lq/SVF/include/Graphs/ConsGEdge.h:33, from /home/lq/SVF/include/Graphs/ConsG.h:33, from /home/lq/SVF/include/Graphs/CFLGraph.h:39, from /home/lq/SVF/include/CFL/CFLGraphBuilder.h:34, from /home/lq/SVF/lib/CFL/CFLGraphBuilder.cpp:30: /home/lq/SVF/include/SVF-FE/BasicTypes.h:107:15: error: ‘VPIntrinsic’ in namespace ‘llvm’ does not name a type typedef llvm::VPIntrinsic VPIntrinsic; ^~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:110:15: error: ‘MinMaxIntrinsic’ in namespace ‘llvm’ does not name a type typedef llvm::MinMaxIntrinsic MinMaxIntrinsic; ^~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:124:15: error: ‘MemCpyInlineInst’ in namespace ‘llvm’ does not name a type typedef llvm::MemCpyInlineInst MemCpyInlineInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:136:15: error: ‘PseudoProbeInst’ in namespace ‘llvm’ does not name a type typedef llvm::PseudoProbeInst PseudoProbeInst; ^~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:137:15: error: ‘NoAliasScopeDeclInst’ in namespace ‘llvm’ does not name a type typedef llvm::NoAliasScopeDeclInst NoAliasScopeDeclInst; ^~~~~~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:138:15: error: ‘GCStatepointInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCStatepointInst GCStatepointInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:139:15: error: ‘GCProjectionInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCProjectionInst GCProjectionInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:140:15: error: ‘GCRelocateInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCRelocateInst GCRelocateInst; ^~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:141:15: error: ‘GCResultInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCResultInst GCResultInst; ^~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:142:15: error: ‘AssumeInst’ in namespace ‘llvm’ does not name a type typedef llvm::AssumeInst AssumeInst; ^~~~~~~~~~ In file included from /home/lq/SVF/include/SVF-FE/LLVMModule.h:33:0, from /home/lq/SVF/include/Util/SVFUtil.h:34, from /home/lq/SVF/include/Graphs/ICFGNode.h:33, from /home/lq/SVF/include/MemoryModel/SVFStatements.h:36, from /home/lq/SVF/include/Graphs/IRGraph.h:34, from /home/lq/SVF/include/MemoryModel/SVFIR.h:33, from /home/lq/SVF/include/Graphs/ConsGEdge.h:33, from /home/lq/SVF/include/Graphs/ConsG.h:33, from /home/lq/SVF/include/Graphs/CFLGraph.h:39, from /home/lq/SVF/include/CFL/CFLSolver.h:30, from /home/lq/SVF/include/CFL/CFLAlias.h:33, from /home/lq/SVF/lib/CFL/CFLAlias.cpp:30: /home/lq/SVF/include/SVF-FE/BasicTypes.h:107:15: error: ‘VPIntrinsic’ in namespace ‘llvm’ does not name a type typedef llvm::VPIntrinsic VPIntrinsic; ^~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:110:15: error: ‘MinMaxIntrinsic’ in namespace ‘llvm’ does not name a type typedef llvm::MinMaxIntrinsic MinMaxIntrinsic; ^~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:124:15: error: ‘MemCpyInlineInst’ in namespace ‘llvm’ does not name a type typedef llvm::MemCpyInlineInst MemCpyInlineInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:136:15: error: ‘PseudoProbeInst’ in namespace ‘llvm’ does not name a type typedef llvm::PseudoProbeInst PseudoProbeInst; ^~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:137:15: error: ‘NoAliasScopeDeclInst’ in namespace ‘llvm’ does not name a type typedef llvm::NoAliasScopeDeclInst NoAliasScopeDeclInst; ^~~~~~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:138:15: error: ‘GCStatepointInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCStatepointInst GCStatepointInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:139:15: error: ‘GCProjectionInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCProjectionInst GCProjectionInst; ^~~~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:140:15: error: ‘GCRelocateInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCRelocateInst GCRelocateInst; ^~~~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:141:15: error: ‘GCResultInst’ in namespace ‘llvm’ does not name a type typedef llvm::GCResultInst GCResultInst; ^~~~~~~~~~~~ /home/lq/SVF/include/SVF-FE/BasicTypes.h:142:15: error: ‘AssumeInst’ in namespace ‘llvm’ does not name a type typedef llvm::AssumeInst AssumeInst; ^~~~~~~~~~ lib/CMakeFiles/Svf.dir/build.make:91: recipe for target 'lib/CMakeFiles/Svf.dir/CFL/CFLGrammar.cpp.o' failed make[2]: *** [lib/CMakeFiles/Svf.dir/CFL/CFLGrammar.cpp.o] Error 1 make[2]: *** 正在等待未完成的任务.... lib/CMakeFiles/Svf.dir/build.make:65: recipe for target 'lib/CMakeFiles/Svf.dir/CFL/CFGNormalizer.cpp.o' failed make[2]: *** [lib/CMakeFiles/Svf.dir/CFL/CFGNormalizer.cpp.o] Error 1 lib/CMakeFiles/Svf.dir/build.make:78: recipe for target 'lib/CMakeFiles/Svf.dir/CFL/CFLAlias.cpp.o' failed make[2]: *** [lib/CMakeFiles/Svf.dir/CFL/CFLAlias.cpp.o] Error 1 lib/CMakeFiles/Svf.dir/build.make:104: recipe for target 'lib/CMakeFiles/Svf.dir/CFL/CFLGraphBuilder.cpp.o' failed make[2]: *** [lib/CMakeFiles/Svf.dir/CFL/CFLGraphBuilder.cpp.o] Error 1 CMakeFiles/Makefile2:1102: recipe for target 'lib/CMakeFiles/Svf.dir/all' failed make[1]: *** [lib/CMakeFiles/Svf.dir/all] Error 2 Makefile:143: recipe for target 'all' failed make: *** [all] Error 2

I'm a novice, and I want to know what to do if there is such a problem during build Thanks!!!

luqu1999 avatar Sep 12 '22 03:09 luqu1999

You will need to use llvm-13 or above.

yuleisui avatar Sep 12 '22 03:09 yuleisui

Hello, now I have another problem in the compilation process. What is the reason?

clang -c -fno-discard-value-names -emit-llvm swap.c -o swap.bc

clang: error: unknown argument: '-fno-discard-value-names'

luqu1999 avatar Sep 12 '22 08:09 luqu1999

The result searched from Google

https://www.google.com/search?q=clang%3A+error%3A+unknown+argument%3A+%27-fno-discard-value-names%27&rlz=1CDGOYI_enAU996AU996&oq=clang%3A+error%3A+unknown+argument%3A+%27-fno-discard-value-names%27&aqs=chrome..69i57j69i58.2709j0j4&hl=en-GB&sourceid=chrome-mobile&ie=UTF-8

yuleisui avatar Sep 12 '22 08:09 yuleisui

Thank you very much. I have solved the problem just now, but I made another mistake when trying Interprocedural Control-Flow Graph

lq@lq-virtual-machine:~/code$ wpa -type -dump-icfg swap.ll

Command 'wpa' not found, did you mean:

command 'wpe' from deb xwpe command 'ipa' from deb freeipa-client command 'wpp' from deb wpp command 'gpa' from deb gpa

Try: sudo apt install

I'm sorry to have bothered you so many times today

luqu1999 avatar Sep 12 '22 08:09 luqu1999

Need to setup your environmental variable. Type: source ./setup.sh

yuleisui avatar Sep 12 '22 09:09 yuleisui