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

Cmake may not detect ar path when building DeepState AFL #358

Open
disconnect3d opened this issue Jul 24, 2020 · 0 comments
Open

Cmake may not detect ar path when building DeepState AFL #358

disconnect3d opened this issue Jul 24, 2020 · 0 comments

Comments

@disconnect3d
Copy link
Member

Tl;dr: I stumbled upon cmake not detecting the ar path while it is clearly in my Ubuntu 18.04 installation.

The issue is that some generated file contains the CMAKE_AR-NOTFOUND instead of ar path. I resolved it locally by specyfing -D CMAKE_AR=/usr/bin/ar as suggested here.

root@b2e78972f3fa:~/deepstate/build_afl# CXX="$AFL_HOME/afl-clang++" CC="$AFL_HOME/afl-clang" cmake -DDEEPSTATE_AFL=ON ../
-- The C compiler identification is Clang 6.0.0
-- The CXX compiler identification is Clang 6.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /root/AFL/afl-clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /root/AFL/afl-clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /root/deepstate/build_afl

root@b2e78972f3fa:~/deepstate/build_afl# make
Scanning dependencies of target deepstate_AFL
[  1%] Building C object CMakeFiles/deepstate_AFL.dir/src/lib/DeepState.c.o
afl-cc 2.57b by <[email protected]>
afl-as 2.57b by <[email protected]>
[+] Instrumented 1205 locations (64-bit, non-hardened mode, ratio 100%).
[  2%] Building C object CMakeFiles/deepstate_AFL.dir/src/lib/Log.c.o
afl-cc 2.57b by <[email protected]>
afl-as 2.57b by <[email protected]>
[+] Instrumented 43 locations (64-bit, non-hardened mode, ratio 100%).
[  3%] Building C object CMakeFiles/deepstate_AFL.dir/src/lib/Option.c.o
afl-cc 2.57b by <[email protected]>
afl-as 2.57b by <[email protected]>
[+] Instrumented 285 locations (64-bit, non-hardened mode, ratio 100%).
[  5%] Building C object CMakeFiles/deepstate_AFL.dir/src/lib/Stream.c.o
afl-cc 2.57b by <[email protected]>
afl-as 2.57b by <[email protected]>
[+] Instrumented 280 locations (64-bit, non-hardened mode, ratio 100%).
[  6%] Linking C static library libdeepstate_AFL.a
Error running link command: No such file or directory
CMakeFiles/deepstate_AFL.dir/build.make:147: recipe for target 'libdeepstate_AFL.a' failed
make[2]: *** [libdeepstate_AFL.a] Error 2
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/deepstate_AFL.dir/all' failed
make[1]: *** [CMakeFiles/deepstate_AFL.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
make: *** [all] Error 2

root@b2e78972f3fa:~/deepstate/build_afl# cat CMakeFiles//deepstate_AFL.dir/link.txt
CMAKE_AR-NOTFOUND qc libdeepstate_AFL.a CMakeFiles/deepstate_AFL.dir/src/lib/DeepState.c.o CMakeFiles/deepstate_AFL.dir/src/lib/Log.c.o CMakeFiles/deepstate_AFL.dir/src/lib/Option.c.o CMakeFiles/deepstate_AFL.dir/src/lib/Stream.c.o

root@b2e78972f3fa:~/deepstate/build_afl# apt install ar
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ar
root@b2e78972f3fa:~/deepstate/build_afl# ar
Usage: ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
       ar -M [<mri-script]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant