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

Linker flags unrecognized when installing afl via cargo #187

Open
danben opened this issue Jul 17, 2021 · 0 comments
Open

Linker flags unrecognized when installing afl via cargo #187

danben opened this issue Jul 17, 2021 · 0 comments

Comments

@danben
Copy link

danben commented Jul 17, 2021

I'm using clang/llvm version 12 on Ubuntu 20.04, and I'm inside of an anaconda environment. I believe that I also tried this on version 10 with the same results. FWIW I haven't been able to find an LLVM manual that mentions these linker flags.

Error message:

--- stderr
 cc1: note: disable pass tree-cunrolli for functions in the range of [0, 4294967295]
 clang: error: -Wl,-O2: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -Wl,--sort-common: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -Wl,--as-needed: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -Wl,-z,relro: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -Wl,-z,now: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -Wl,--disable-new-dtags: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -Wl,--gc-sections: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -Wl,-rpath,/home/danben/anaconda3/lib: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -Wl,-rpath-link,/home/danben/anaconda3/lib: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -ldl: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -lrt: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 clang: error: -lm: 'linker' input unused [-Werror,-Wunused-command-line-argument]
 make[1]: *** [GNUmakefile.llvm:362: instrumentation/afl-common.o] Error 1

Command to compile (generated by cargo install afl:
/usr/lib/llvm-12/bin/clang -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/danben/anaconda3/include -ggdb3 -O0 -Wall -Wextra -Werror -g -Wno-pointer-sign -Wno-variadic-macros -Wall -Wextra -Wpointer-arith -I include/ -DAFL_PATH=\"/lib/afl\" -DBIN_PATH=\"/bin\" -DDOC_PATH=\"/share/doc/afl\" -Wall -g -Wno-cast-qual -Wno-variadic-macros -Wno-pointer-sign -I ./include/ -I ./instrumentation/ -DAFL_PATH=\"/lib/afl\" -DBIN_PATH=\"/bin\" -DLLVM_BINDIR=\"/usr/lib/llvm-12/bin\" -DVERSION=\"++3.01a\" -DLLVM_LIBDIR=\"/usr/lib/llvm-12/lib\" -DLLVM_VERSION=\"12.0.0\" -Wno-deprecated -DAFL_CLANG_FLTO=\"-flto=full\" -DAFL_REAL_LD=\"/usr/lib/llvm-12/bin/ld.lld\" -DAFL_CLANG_LDPATH=\"1\" -DAFL_CLANG_FUSELD=\"1\" -DCLANG_BIN=\"/usr/lib/llvm-12/bin/clang\" -DCLANGPP_BIN=\"/usr/lib/llvm-12/bin/clang++\" -DUSE_BINDIR=1 -Wno-unused-function -fdebug-prefix-map="/home/danben/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.10.1/AFLplusplus=llvm_mode" -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/danben/anaconda3/include -c src/afl-common.c -o instrumentation/afl-common.o -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/home/danben/anaconda3/lib -Wl,-rpath-link,/home/danben/anaconda3/lib -L/home/danben/anaconda3/lib -ldl -lrt -lm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant