taptipalit / selective_data_protection

Mitigating Data-only Attacks by Protecting Selective Memory-resident Data
Other
6 stars 0 forks source link

Error occurred while executing ./run.sh #1

Open JJaaang opened 3 years ago

JJaaang commented 3 years ago

Hi!

I built the source code provided by you and tried to create a hardened binary by running ./run.sh referring to the README.txt.

However, I encountered the following error and couldn't create a hardened binary.

jjang@jjang:~/work/doam/src/test/Datarand$ ./run.sh test
rm: cannot remove '*.png': No such file or directory
rm: cannot remove '*.dot': No such file or directory
+ LLVMROOT=/mnt/Projects/LLVM-custom/install/bin
+ rm null_helper.c aes_inreg.s aes_inmemkey.s aes_helper.c internal_libc.c
+ ln -s /mnt/Projects/LLVM-custom/lib/Transforms/Encryption/null_helper.c_ null_helper.c
+ ln -s /mnt/Projects/LLVM-custom/lib/Transforms/Encryption/aes_inmemkey.s aes_inmemkey.s
+ ln -s /mnt/Projects/LLVM-custom/lib/Transforms/Encryption/aes_inreg.s aes_inreg.s
+ ln -s /mnt/Projects/LLVM-custom/lib/Transforms/Encryption/aes_helper.c_ aes_helper.c
+ ln -s /mnt/Projects/LLVM-custom/lib/Transforms/LibcTransform/internal_libc.c_ internal_libc.c
+ GGDB=-ggdb
+ musl-clang -O0 -c -ggdb -emit-llvm test.c -o test.bc
./run.sh: line 21: musl-clang: command not found
+ '[' 127 -ne 0 ']'
+ exit 1

How can I solve this problem?

NOTE. my ubuntu is 20.04 ver and I did a build with the following command:

mkdir build && cd build
cmake ../src
cmake --build .
cmake --build . install

Also, I encountered the following error while executing "cmake --build .", and I solved the problem by adding "IRReader Linker" to "required_libraries" in "src/lib/Analaysis/SVF/LLVMBuild.txt".

[ 91%] Linking CXX shared library ../../../../lib/libclang.so
/usr/local/bin/ld: ../../../../lib/libLLVMSVF.a(SVFModule.cpp.o): in function 'LLVMModuleSet::loadModules(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)':
/home/jjang/work/doam/src/lib/Analysis/SVF/Util/SVFModule.cpp:88: undefined reference to 'llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, bool, llvm::StringRef)'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/clang/tools/libclang/CMakeFiles/libclang.dir/build.make:543:lib/libclang.so.7] Error 1
makr[1]: *** [CMakeFiles/Makefile2:27181: tools/clang/tools/libclang/CMakeFiles/libclang.dir/all] Error 2
make: *** [Makefile:152: all] Error2
taptipalit commented 3 years ago

Hi, I updated the instructions and the scripts. I removed the dependency on Musl, but you need to use the custom Glibc library as mentioned in the README.

Regarding the linking error, it's weird because I don't get it on my system. But I'm using the "Unix Makefiles" way of building. Maybe that's issue.