compiling --with-sanitizers=fuzzer on Alpine Linux fails to link #18983

issue MarcoFalke opened this issue on May 15, 2020
  1. MarcoFalke commented at 4:32 PM on May 15, 2020: member

    Steps to reproduce:

       0 apk --no-cache --update add autoconf automake g++ gcc git libtool make pkgconfig python3 boost-dev libevent-dev zeromq-dev qt5-qtbase-dev qt5-qttools-dev ccache clang valgrind
       1 git clone https://github.com/bitcoin/bitcoin --depth=1 ./bitcoin-core
       2 cd bitcoin-core
       3 ./autogen.sh 
       4 ./configure --enable-c++17 --enable-fuzz --with-sanitizers=fuzzer CC=clang CXX=clang++
    

    output:

    checking build system type... x86_64-pc-linux-musl
    checking host system type... x86_64-pc-linux-musl
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
    checking for gawk... no
    checking for mawk... no
    checking for nawk... no
    checking for awk... awk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking whether to enable maintainer-specific portions of Makefiles... yes
    checking whether make supports nested variables... (cached) yes
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C++ compiler... yes
    checking whether clang++ accepts -g... yes
    checking whether make supports the include directive... yes (GNU style)
    checking dependency style of clang++... gcc3
    checking whether clang++ supports C++17 features with -std=c++17... yes
    checking whether std::atomic can be used without link library... yes
    checking whether we are using the GNU Objective C++ compiler... yes
    checking whether clang++ -std=c++17 accepts -g... yes
    checking dependency style of clang++ -std=c++17... gcc3
    checking how to print strings... printf
    checking for gcc... clang
    checking whether we are using the GNU C compiler... yes
    checking whether clang accepts -g... yes
    checking for clang option to accept ISO C89... none needed
    checking whether clang understands -c and -o together... yes
    checking dependency style of clang... gcc3
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by clang... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 98304
    checking how to convert x86_64-pc-linux-musl file names to x86_64-pc-linux-musl format... func_convert_file_noop
    checking how to convert x86_64-pc-linux-musl file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver [@FILE](/bitcoin-bitcoin/contributor/file/) support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from clang object... ok
    checking for sysroot... no
    checking for a working dd... /bin/dd
    checking how to truncate binary pipes... /bin/dd bs=4096 count=1
    ./configure: line 1: /usr/bin/file: not found
    checking for mt... no
    checking if : is a manifest tool... no
    checking how to run the C preprocessor... clang -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if clang supports -fno-rtti -fno-exceptions... yes
    checking for clang option to produce PIC... -fPIC -DPIC
    checking if clang PIC flag -fPIC -DPIC works... yes
    checking if clang static flag -static works... yes
    checking if clang supports -c -o file.o... yes
    checking if clang supports -c -o file.o... (cached) yes
    checking whether the clang linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking how to run the C++ preprocessor... clang++ -std=c++17 -E
    checking for ld used by clang++ -std=c++17... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking whether the clang++ -std=c++17 linker (/usr/bin/ld) supports shared libraries... yes
    checking for clang++ -std=c++17 option to produce PIC... -fPIC -DPIC
    checking if clang++ -std=c++17 PIC flag -fPIC -DPIC works... yes
    checking if clang++ -std=c++17 static flag -static works... yes
    checking if clang++ -std=c++17 supports -c -o file.o... yes
    checking if clang++ -std=c++17 supports -c -o file.o... (cached) yes
    checking whether the clang++ -std=c++17 linker (/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... (cached) GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking for ar... /usr/bin/ar
    checking for ranlib... /usr/bin/ranlib
    checking for strip... /usr/bin/strip
    checking for gcov... /usr/bin/gcov
    checking for lcov... no
    checking for python3.5... no
    checking for python3.6... no
    checking for python3.7... no
    checking for python3.8... /usr/bin/python3.8
    checking for genhtml... no
    checking for git... /usr/bin/git
    checking for ccache... /usr/bin/ccache
    checking for xgettext... /usr/bin/xgettext
    checking for hexdump... /usr/bin/hexdump
    checking for readelf... /usr/bin/readelf
    checking for c++filt... /usr/bin/c++filt
    checking for objcopy... /usr/bin/objcopy
    checking for doxygen... no
    configure: WARNING: Doxygen not found
    checking whether C++ compiler accepts -Werror... yes
    checking whether the linker accepts -Wl,--fatal-warnings... yes
    checking whether C++ compiler accepts -fsanitize=fuzzer... yes
    checking whether the linker accepts -fsanitize=fuzzer... no
    configure: error: linker did not accept requested flags, you are missing required libraries
    
  2. MarcoFalke added the label Bug on May 15, 2020
  3. MarcoFalke added the label Tests on May 15, 2020
  4. MarcoFalke commented at 4:40 PM on May 15, 2020: member

    config log section:

    configure:19515: checking whether C++ compiler accepts -Werror
    configure:19534: clang++ -std=c++17 -c -g -O2  -Werror  conftest.cpp >&5
    configure:19534: $? = 0
    configure:19542: result: yes
    configure:19591: checking whether the linker accepts -Wl,--fatal-warnings
    configure:19610: clang++ -std=c++17 -o conftest -g -O2    -Wl,--fatal-warnings conftest.cpp  >&5
    configure:19610: $? = 0
    configure:19619: result: yes
    configure:19863: checking whether C++ compiler accepts -fsanitize=fuzzer
    configure:19882: clang++ -std=c++17 -c -g -O2  -fsanitize=fuzzer  conftest.cpp >&5
    configure:19882: $? = 0
    configure:19891: result: yes
    configure:19901: checking whether the linker accepts -fsanitize=fuzzer
    configure:19925: clang++ -std=c++17 -o conftest -g -O2    -fsanitize=fuzzer conftest.cpp  >&5
    /usr/bin/ld: cannot find /usr/lib/clang/9.0.0/lib/linux/libclang_rt.fuzzer-x86_64.a: No such file or directory
    /usr/bin/ld: cannot find /usr/lib/clang/9.0.0/lib/linux/libclang_rt.ubsan_standalone-x86_64.a: No such file or directory
    /usr/bin/ld: cannot find /usr/lib/clang/9.0.0/lib/linux/libclang_rt.ubsan_standalone_cxx-x86_64.a: No such file or directory
    clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
    configure:19925: $? = 1
    
  5. MarcoFalke added the label Upstream on May 15, 2020
  6. MarcoFalke closed this on May 15, 2020

  7. MarcoFalke commented at 9:40 PM on May 16, 2020: member

    For those following at home. This has been reported upstream: https://github.com/google/sanitizers/issues/1080

  8. DrahtBot locked this on Feb 15, 2022
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 00:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me