Skip to content

build failed with apple clang 12 on macOS #175

Open
@gentcys

Description

@gentcys

run cargo check --all inside tikv project, and error occurred.

tikv git:(update_dependency) ✗ RUST_BACKTRACE=1 cargo check --all
   Compiling afl v0.6.0
   Compiling librocksdb_sys v0.1.0 (https://github.com/tikv/rust-rocksdb.git#0876316d)
error: failed to run custom build command for `afl v0.6.0`

Caused by:
  process didn't exit successfully: `/Users/gentcys/Codes/personal/tikv/target/debug/build/afl-ec701a85aa8db2c6/build-script-build` (exit code: 101)
--- stdout
rm -f afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze afl-as as afl-g++ afl-clang afl-clang++ *.o *~ a.out core core.[1-9][0-9]* *.stackdump test .test test-instr .test-instr0 .test-instr1 qemu_mode/qemu-2.10.0.tar.bz2 afl-qemu-trace
rm -rf out_dir qemu_mode/qemu-2.10.0
/Library/Developer/CommandLineTools/usr/bin/make -C llvm_mode clean
rm -f *.o *.so *~ a.out core core.[1-9][0-9]* test-instr .test-instr0 .test-instr1
rm -f ../afl-clang-fast ../afl-llvm-rt.o ../afl-llvm-rt-32.o ../afl-llvm-rt-64.o ../afl-clang-fast++
/Library/Developer/CommandLineTools/usr/bin/make -C libdislocator clean
rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
rm -f libdislocator.so
/Library/Developer/CommandLineTools/usr/bin/make -C libtokencap clean
rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
rm -f libtokencap.so
[*] Checking for the ability to compile x86 code...
[+] Everything seems to be working, ready to compile.
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/lib/afl\" -DDOC_PATH=\"/share/doc/afl\" -DBIN_PATH=\"/bin\" afl-gcc.c -o afl-gcc
set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $i; done
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/lib/afl\" -DDOC_PATH=\"/share/doc/afl\" -DBIN_PATH=\"/bin\" afl-fuzz.c -o afl-fuzz
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/lib/afl\" -DDOC_PATH=\"/share/doc/afl\" -DBIN_PATH=\"/bin\" afl-showmap.c -o afl-showmap
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/lib/afl\" -DDOC_PATH=\"/share/doc/afl\" -DBIN_PATH=\"/bin\" afl-tmin.c -o afl-tmin
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/lib/afl\" -DDOC_PATH=\"/share/doc/afl\" -DBIN_PATH=\"/bin\" afl-gotcpu.c -o afl-gotcpu
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/lib/afl\" -DDOC_PATH=\"/share/doc/afl\" -DBIN_PATH=\"/bin\" afl-analyze.c -o afl-analyze
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/lib/afl\" -DDOC_PATH=\"/share/doc/afl\" -DBIN_PATH=\"/bin\" afl-as.c -o afl-as
ln -sf afl-as as
[*] Testing the CC wrapper and instrumentation output...
unset AFL_USE_ASAN AFL_USE_MSAN; AFL_QUIET=1 AFL_INST_RATIO=100 AFL_PATH=. ./afl-clang -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/lib/afl\" -DDOC_PATH=\"/share/doc/afl\" -DBIN_PATH=\"/bin\" test-instr.c -o test-instr
echo 0 | ./afl-showmap -m none -q -o .test-instr0 ./test-instr
echo 1 | ./afl-showmap -m none -q -o .test-instr1 ./test-instr

Oops, the instrumentation does not seem to be behaving correctly!

Please ping <[email protected]> to troubleshoot the issue.


--- stderr
make: *** [test_build] Error 1
thread 'main' panicked at 'assertion failed: status.success()', /Users/gentcys/.cargo/registry/src/github.com-1ecc6299db9ec823/afl-0.6.0/build.rs:33:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: build_script_build::build_afl
   8: build_script_build::main
   9: std::rt::lang_start::{{closure}}
  10: std::rt::lang_start_internal
  11: std::rt::lang_start
  12: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions