Skip to content

Commit

Permalink
[elfutils] show config.log when ./configure fails (google#6963)
Browse files Browse the repository at this point in the history
to make it easier to figure out why configure fails with something like
```
Step #3 - "compile-afl-address-x86_64": configure: error: in `/src/elfutils':
Step #3 - "compile-afl-address-x86_64": configure: error: C compiler cannot create executables
Step #3 - "compile-afl-address-x86_64": See `config.log' for more details
```
  • Loading branch information
evverx authored Dec 7, 2021
1 parent c96a422 commit 467ad6b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions projects/elfutils/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,20 @@ export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
cd "$SRC/elfutils"

# ASan isn't compatible with -Wl,--no-undefined: https://github.com/google/sanitizers/issues/380
find -name Makefile.am | xargs sed -i 's/,--no-undefined//' &&
find -name Makefile.am | xargs sed -i 's/,--no-undefined//'

# ASan isn't compatible with -Wl,-z,defs either:
# https://clang.llvm.org/docs/AddressSanitizer.html#usage
sed -i 's/^\(ZDEFS_LDFLAGS=\).*/\1/' configure.ac &&
sed -i 's/^\(ZDEFS_LDFLAGS=\).*/\1/' configure.ac

autoreconf -i -f &&
./configure --enable-maintainer-mode --disable-debuginfod --disable-libdebuginfod \
autoreconf -i -f
if ! ./configure --enable-maintainer-mode --disable-debuginfod --disable-libdebuginfod \
--without-bzlib --without-lzma --without-zstd \
CC="$CC" CFLAGS="-Wno-error $CFLAGS" CXX="-Wno-error $CXX" CXXFLAGS="$CXXFLAGS" LDFLAGS="$CFLAGS" &&
CC="$CC" CFLAGS="-Wno-error $CFLAGS" CXX="-Wno-error $CXX" CXXFLAGS="$CXXFLAGS" LDFLAGS="$CFLAGS"; then
cat config.log
exit 1
fi

ASAN_OPTIONS=detect_leaks=0 make -j$(nproc) V=1


Expand Down

0 comments on commit 467ad6b

Please sign in to comment.