commit:     54b1cd46b846e631eff7431ca55bdd73806f110b
Author:     Alexander Miller <alex.miller <AT> gmx <DOT> de>
AuthorDate: Mon Jul  4 17:21:47 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=54b1cd46

app-forensics/aflplusplus: Fix lld detection

Signed-off-by: Alexander Miller <alex.miller <AT> gmx.de>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-forensics/aflplusplus/aflplusplus-4.01c.ebuild         |  1 +
 .../aflplusplus/files/aflplusplus-4.01c-lld-detect.patch   | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/app-forensics/aflplusplus/aflplusplus-4.01c.ebuild 
b/app-forensics/aflplusplus/aflplusplus-4.01c.ebuild
index b304644ff905..18186168e86e 100644
--- a/app-forensics/aflplusplus/aflplusplus-4.01c.ebuild
+++ b/app-forensics/aflplusplus/aflplusplus-4.01c.ebuild
@@ -40,6 +40,7 @@ 
QA_PREBUILT="usr/share/afl/testcases/others/elf/small_exec.elf"
 PATCHES=(
        "${FILESDIR}"/${PN}-4.01c-respect-flags.patch
        "${FILESDIR}"/${PN}-4.01c-no-ignore-errors-makefile.patch
+       "${FILESDIR}"/${PN}-4.01c-lld-detect.patch
 )
 
 llvm_check_deps() {

diff --git a/app-forensics/aflplusplus/files/aflplusplus-4.01c-lld-detect.patch 
b/app-forensics/aflplusplus/files/aflplusplus-4.01c-lld-detect.patch
new file mode 100644
index 000000000000..cec2c9d17979
--- /dev/null
+++ b/app-forensics/aflplusplus/files/aflplusplus-4.01c-lld-detect.patch
@@ -0,0 +1,14 @@
+--- a/GNUmakefile.llvm
++++ b/GNUmakefile.llvm
+@@ -218,9 +218,8 @@ endif
+ ifeq "$(LLVM_LTO)" "1"
+   ifneq "$(AFL_CLANG_FLTO)" ""
+     ifeq "$(AFL_REAL_LD)" ""
+-      ifneq "$(shell readlink $(LLVM_BINDIR)/ld.lld 2>&1)" ""
+-        AFL_REAL_LD = $(LLVM_BINDIR)/ld.lld
+-      else
++      AFL_REAL_LD = "$(shell command -v $(LLVM_BINDIR)/ld.lld 2>/dev/null || 
command -v ld.lld 2>/dev/null)"
++      ifeq "$(AFL_REAL_LD)" ""
+         $(warning ld.lld not found, cannot enable LTO mode)
+         LLVM_LTO = 0
+       endif

Reply via email to