afl no longer builds from source with gcc-7; doesn't look for "as" in dir specified by -B

Bug #1770342 reported by Bob McChesney
2
Affects Status Importance Assigned to Milestone
gcc-7 (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned

Bug Description

This issue began upstream recently before Ubuntu 18.04 was released, when 7.3.0-16 was introduced and fixed the following issue:

* Use triplet-prefixed as and ld (Helmut Grohne). Addresses: #895251.

As can be seen in the continuous integration for afl (https://ci.debian.net/packages/a/afl/unstable/amd64/), the build failed tests from 2018-04-12 until 2018-05-08 (when version 7.3.0-18 arrived).

A bug report for the issue was raised (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896057) and has been closed with the release of 7.3.0-18.

The symptom looks as follows by building afl from source (from http://lcamtuf.coredump.cx/afl/):

bob@BOB2:~/afl-2.52b$ make
[*] 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=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-gcc.c -o afl-gcc -ldl
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=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-fuzz.c -o afl-fuzz -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-showmap.c -o afl-showmap -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-tmin.c -o afl-tmin -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-gotcpu.c -o afl-gotcpu -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-analyze.c -o afl-analyze -ldl
cc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" afl-as.c -o afl-as -ldl
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-gcc -O3 -funroll-loops -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign -DAFL_PATH=\"/usr/local/lib/afl\" -DDOC_PATH=\"/usr/local/share/doc/afl\" -DBIN_PATH=\"/usr/local/bin\" test-instr.c -o test-instr -ldl
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 address hidden> to troubleshoot the issue.

Makefile:90: recipe for target 'test_build' failed
make: *** [test_build] Error 1
bob@BOB2:~/afl-2.52b$

I've tested Debian before and after and can confirm that 7.3.0-18 resolves the problem.

It would be very desirable to have this fixed in Ubuntu 18.04 as it's supported for 5 years, and afl is a popular tool that benefits from being rebuilt from source periodically.

Anything I'm doing wrong here in reporting this issue, please don't hesitate to berate. I'm keen for this to get resolved and I'm willing to do some work helping to fix. If that involves proposing a patch, that's fine but I might need some guidance about how to make the proposal.

Thanks.

Matthias Klose (doko)
Changed in gcc-7 (Ubuntu Bionic):
status: New → In Progress
Changed in gcc-7 (Ubuntu):
status: New → Fix Released
Revision history for this message
Bob McChesney (bmcchesney) wrote :

This appears to me to be fixed in bionic-updates with gcc-7 7.3.0-27ubuntu1~18.04. I'm marking this as no longer affecting me.

Changed in gcc-7 (Ubuntu Bionic):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.