Skip to content

Compilation of fuzzer fails with custom-build.sh #141

@lemzwerg

Description

@lemzwerg

[04fa941]

Calling custom-build.sh to build the 'fuzzer' target fails on my up-to-date openSUSE Leap 15.6 box – contrary to the 'driver' target, which succeeds. I've tested with both clang 14 and 19.

The linking failure starts as follows; I've attached the complete log.

FAILED: bin/legacy
: && /usr/bin/ccache \
  clang++ -std=c++11 \
          -fsanitize=fuzzer-no-link \
          -fsanitize=address \
          -fsanitize-address-use-after-scope \
          -fsanitize=undefined \
          -g -O0 -g \
          -fsanitize=address \
          -fsanitize=undefined \
          -rdynamic \
          -fsanitize=fuzzer \
          -nostdlib++ \
          src/fuzzers/CMakeFiles/fuzzer-legacy.dir/__/legacy/ftfuzzer.cc.o -o bin/legacy \
          .../freetype2-testing/fuzzing/../external/libarchive/.libs/libarchive.a \
          .../freetype2-testing/fuzzing/../external/freetype2/objs/.libs/libfreetype.a \
          .../freetype2-testing/fuzzing/../external/bzip2/libbz2.a \
          .../freetype2-testing/fuzzing/../external/brotli/build/libbrotlidec-static.a \
          .../freetype2-testing/fuzzing/../external/brotli/build/libbrotlicommon-static.a \
          .../freetype2-testing/fuzzing/../external/libpng/usr/lib-asan/libpng.a \
          .../freetype2-testing/fuzzing/../external/zlib/usr/lib-asan/libz.a \
          .../freetype2-testing/fuzzing/../external/llvm-project/build/lib/libc++.a \
          .../freetype2-testing/fuzzing/../external/llvm-project/build/lib/libc++abi.a \
&& :
/usr/bin/ld:
  /usr/lib64/clang/19/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerIO.cpp.o):
    in function `fuzzer::FileToVector(std::__cxx11::basic_string<char,
                                      std::char_traits<char>,
                                      std::allocator<char> > const&,
                                      unsigned long,
                                      bool)':
  /home/abuild/rpmbuild/BUILD/llvm-19.1.7.src/projects/compiler-rt/lib/fuzzer/FuzzerIO.cpp:42:
  (.text._ZN6fuzzer12FileToVectorERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmb+0x47):
    undefined reference to
      `std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(
        std::__cxx11::basic_string<char,
        std::char_traits<char>,
        std::allocator<char> > const&,
        std::_Ios_Openmode)'

@bungeman, please advise.

custom-build.log.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions