Skip to content

llvm-mode fails to build on FreeBSD 12.2-RELEASE #705

@fuzzah

Description

@fuzzah

Error happens because variable PATH_MAX used in afl-ld-lto.c is not defined.
Attaching relevant part of gmake log:

[+] llvm_mode detected llvm 10+, enabling neverZero implementation and c++14
[+] llvm_mode detected llvm 11+, enabling afl-lto LTO implementation
[+] shmat seems to be working.
[*] Checking for working 'llvm-config'...
[*] Checking for working '/usr/local/llvm11/bin/clang'...
[*] Checking for matching versions of '/usr/local/llvm11/bin/clang' and 'llvm-config'
[*] We have llvm-config version 11.0.1 with a clang version 11.0.1, good.
[*] Checking for './afl-showmap'...
[+] All set and ready to build.
/usr/local/llvm11/bin/clang -O3 -funroll-loops -fPIC -D_FORTIFY_SOURCE=2 -Wall -g -Wno-cast-qual -Wno-variadic-macros -Wno-pointer-sign -I ./include/ -I ./instrumentation/ -DAFL_PATH=\"/usr/local/lib/afl\" -DBIN_PATH=\"/usr/local/bin\" -DLLVM_BINDIR=\"/usr/local/llvm11/bin\" -DVERSION=\"++3.01a\" -DLLVM_LIBDIR=\"/usr/local/llvm11/lib\" -DLLVM_VERSION=\"11.0.1\" -Wno-deprecated -DAFL_CLANG_FLTO=\"-flto=full\" -DAFL_REAL_LD=\"/usr/local/llvm11/bin/ld.lld\" -DAFL_CLANG_LDPATH=\"\" -DAFL_CLANG_FUSELD=\"1\" -DCLANG_BIN=\"/usr/local/llvm11/bin/clang\" -DCLANGPP_BIN=\"/usr/local/llvm11/bin/clang++\" -DUSE_BINDIR=1 -Wno-unused-function -fdebug-prefix-map="/root/git/AFLplusplus=llvm_mode"  src/afl-ld-lto.c -o afl-ld-lto
src/afl-ld-lto.c:256:15: error: use of undeclared identifier 'PATH_MAX'
char thecwd[PATH_MAX];
            ^
1 error generated.
gmake[1]: *** [GNUmakefile.llvm:401: afl-ld-lto] Error 1
                                                                                                                                                                             

AFL++ version 3.01a:

commit 068bef5eab942df0a133c92522f2ab81b28ac636 (HEAD -> stable, origin/stable, origin/HEAD)
Merge: 271116f8 b9e855b7
Author: van Hauser <[email protected]>
Date:   Wed Jan 20 19:12:52 2021 +0100
Merge pull request #691 from AFLplusplus/dev
push to stable                                       

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