From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-forensics/aflplusplus/files/
Date: Mon, 4 Jul 2022 23:24:15 +0000 (UTC) [thread overview]
Message-ID: <1656977042.55dbef339a5303eea0c707b2c1b5fa9f523276ae.sam@gentoo> (raw)
commit: 55dbef339a5303eea0c707b2c1b5fa9f523276ae
Author: Alexander Miller <alex.miller <AT> gmx <DOT> de>
AuthorDate: Mon Jul 4 17:15:04 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 4 23:24:02 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55dbef33
app-forensics/aflplusplus: Respect CC and CPPFLAGS when building aflpp_driver
Note that using user's CFLAGS with hard-coded clang can cause trouble.
Signed-off-by: Alexander Miller <alex.miller <AT> gmx.de>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/aflplusplus-4.01c-respect-flags.patch | 47 +++++++++++++++++++++-
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch b/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch
index ebe638f1a86c..1cfc03d5f42b 100644
--- a/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch
+++ b/app-forensics/aflplusplus/files/aflplusplus-4.01c-respect-flags.patch
@@ -1,4 +1,4 @@
-* Respect CFLAGS everywhere when building.
+* Respect CC, CFLAGS, CPPFLAGS, LDFLAGS everywhere when building.
* Ignore build flags then when testing the CC wrappers (could contain
incompatible flags).
* Disable LTO for runtime objects, these shouldn't contain IR.
@@ -131,7 +131,7 @@
--- a/utils/aflpp_driver/GNUmakefile
+++ b/utils/aflpp_driver/GNUmakefile
-@@ -13,7 +13,8 @@ ifneq "" "$(LLVM_BINDIR)"
+@@ -13,40 +13,41 @@ ifneq "" "$(LLVM_BINDIR)"
LLVM_BINDIR := $(LLVM_BINDIR)/
endif
@@ -141,3 +141,46 @@
all: libAFLDriver.a libAFLQemuDriver.a aflpp_qemu_driver_hook.so
+ aflpp_driver.o: aflpp_driver.c
+- -$(LLVM_BINDIR)clang -I. -I../../include $(CFLAGS) -c aflpp_driver.c
++ $(CC) $(CPPFLAGS) -I. -I../../include $(CFLAGS) -c aflpp_driver.c
+
+ libAFLDriver.a: aflpp_driver.o
+- @ar rc libAFLDriver.a aflpp_driver.o
++ ar rc libAFLDriver.a aflpp_driver.o
+ @cp -vf libAFLDriver.a ../../
+
+ debug:
+- $(LLVM_BINDIR)clang -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.o ../../src/afl-performance.c
+- $(LLVM_BINDIR)clang -I../../include -D_DEBUG=\"1\" -g -funroll-loops -c aflpp_driver.c
++ $(CC) $(CPPFLAGS) -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.o ../../src/afl-performance.c
++ $(CC) $(CPPFLAGS) -I../../include -D_DEBUG=\"1\" $(CFLAGS) -g -funroll-loops -c aflpp_driver.c
+ #$(LLVM_BINDIR)clang -S -emit-llvm -Wno-deprecated -I../../include $(CFLAGS) -D_DEBUG=\"1\" -c -o afl-performance.ll ../../src/afl-performance.c
+ #$(LLVM_BINDIR)clang -S -emit-llvm -I../../include -D_DEBUG=\"1\" -g -funroll-loops -c aflpp_driver.c
+ ar rc libAFLDriver.a afl-performance.o aflpp_driver.o
+
+ aflpp_qemu_driver.o: aflpp_qemu_driver.c
+- -$(LLVM_BINDIR)clang $(CFLAGS) -O0 -funroll-loops -c aflpp_qemu_driver.c
++ $(CC) $(CPPFLAGS) $(CFLAGS) -O0 -funroll-loops -c aflpp_qemu_driver.c
+
+ libAFLQemuDriver.a: aflpp_qemu_driver.o
+- @-ar rc libAFLQemuDriver.a aflpp_qemu_driver.o
+- @-cp -vf libAFLQemuDriver.a ../../
++ ar rc libAFLQemuDriver.a aflpp_qemu_driver.o
++ @cp -vf libAFLQemuDriver.a ../../
+
+ aflpp_qemu_driver_hook.so: aflpp_qemu_driver_hook.o
+- @-test -e aflpp_qemu_driver_hook.o && $(LLVM_BINDIR)clang $(LDFLAGS) -shared aflpp_qemu_driver_hook.o -o aflpp_qemu_driver_hook.so || echo "Note: Optional aflpp_qemu_driver_hook.so not built."
++ @test -e aflpp_qemu_driver_hook.o && $(CC) $(LDFLAGS) -shared aflpp_qemu_driver_hook.o -o aflpp_qemu_driver_hook.so || echo "Note: Optional aflpp_qemu_driver_hook.so not built."
+
+ aflpp_qemu_driver_hook.o: aflpp_qemu_driver_hook.c
+- @-test -e ../../qemu_mode/qemuafl/qemuafl/api.h && $(LLVM_BINDIR)clang $(CFLAGS) -funroll-loops -c aflpp_qemu_driver_hook.c || echo "Note: Optional aflpp_qemu_driver_hook.o not built."
++ @test -e ../../qemu_mode/qemuafl/qemuafl/api.h && $(CC) $(CPPFLAGS) $(CFLAGS) -funroll-loops -c aflpp_qemu_driver_hook.c || echo "Note: Optional aflpp_qemu_driver_hook.o not built."
+
+ test: debug
+ #clang -S -emit-llvm -D_DEBUG=\"1\" -I../../include -Wl,--allow-multiple-definition -funroll-loops -o aflpp_driver_test.ll aflpp_driver_test.c
+- afl-clang-fast -D_DEBUG=\"1\" -I../../include -Wl,--allow-multiple-definition -funroll-loops -o aflpp_driver_test aflpp_driver_test.c libAFLDriver.a afl-performance.o
++ ../../afl-clang-fast -D_DEBUG=\"1\" -I../../include -Wl,--allow-multiple-definition -funroll-loops -o aflpp_driver_test aflpp_driver_test.c libAFLDriver.a afl-performance.o
+
+ clean:
+ rm -f *.o libAFLDriver*.a libAFLQemuDriver.a aflpp_qemu_driver_hook.so *~ core aflpp_driver_test
next reply other threads:[~2022-07-04 23:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 23:24 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-12-21 19:29 [gentoo-commits] repo/gentoo:master commit in: app-forensics/aflplusplus/files/ Sam James
2022-07-04 23:24 Sam James
2022-07-04 23:24 Sam James
2022-07-04 23:24 Sam James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1656977042.55dbef339a5303eea0c707b2c1b5fa9f523276ae.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox