commit:     80b1fc1e8b31f1e0b775cc2b856a64e7e058587f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 10 01:57:00 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 10 01:57:18 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80b1fc1e

dev-util/valgrind: fix build w/ Clang 15

Closes: https://bugs.gentoo.org/869320
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../valgrind/files/valgrind-3.19.0-clang-15.patch  | 33 ++++++++++++++++++++++
 dev-util/valgrind/valgrind-3.19.0.ebuild           | 19 +++++++------
 dev-util/valgrind/valgrind-9999.ebuild             | 18 ++++++------
 3 files changed, 52 insertions(+), 18 deletions(-)

diff --git a/dev-util/valgrind/files/valgrind-3.19.0-clang-15.patch 
b/dev-util/valgrind/files/valgrind-3.19.0-clang-15.patch
new file mode 100644
index 000000000000..77b2e8b091a4
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-3.19.0-clang-15.patch
@@ -0,0 +1,33 @@
+https://sourceware.org/git/?p=valgrind.git;a=commit;h=1dbc46750f7f716ae3b9cf718380df77422379da
+https://bugs.gentoo.org/869320
+
+From: Paul Floyd <[email protected]>
+Date: Tue, 19 Apr 2022 22:03:01 +0200
+Subject: [PATCH] Bug 452779 Valgrind fails to build on FreeBSD 13.0 with
+ llvm-devel (15.0.0)
+
+This fixes building.
+
+I may make the -lgcc and libgcc-sup conditonal on not using clang later.
+--- a/Makefile.tool.am
++++ b/Makefile.tool.am
+@@ -16,14 +16,14 @@ TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@ = \
+       $(top_builddir)/VEX/libvex-@VGCONF_ARCH_SEC@-@[email protected]
+ endif
+ 
+-
+-TOOL_LDADD_COMMON = -lgcc \
+-      $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_PRI@-@[email protected]
++TOOL_LDADD_COMMON = -lgcc
+ TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \
+-      $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON)
++      $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON) \
++      $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_PRI@-@[email protected]
+ if VGCONF_HAVE_PLATFORM_SEC
+ TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@ = \
+-      $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON)
++      $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@) $(TOOL_LDADD_COMMON) \
++      $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_SEC@-@[email protected]
+ endif
+ 
+ 

diff --git a/dev-util/valgrind/valgrind-3.19.0.ebuild 
b/dev-util/valgrind/valgrind-3.19.0.ebuild
index 7e7417e90831..14e4020342ba 100644
--- a/dev-util/valgrind/valgrind-3.19.0.ebuild
+++ b/dev-util/valgrind/valgrind-3.19.0.ebuild
@@ -22,6 +22,13 @@ IUSE="mpi"
 DEPEND="mpi? ( virtual/mpi )"
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+       # Respect CFLAGS, LDFLAGS
+       "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
+       "${FILESDIR}"/${PN}-3.15.0-Build-ldst_multiple-test-with-fno-pie.patch
+       "${FILESDIR}"/${PN}-3.19.0-clang-15.patch
+)
+
 src_prepare() {
        # Correct hard coded doc location
        sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
@@ -29,15 +36,10 @@ src_prepare() {
        # Don't force multiarch stuff on OSX, bug #306467
        sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
 
-       # Respect CFLAGS, LDFLAGS
-       eapply "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
-
-       eapply 
"${FILESDIR}"/${PN}-3.15.0-Build-ldst_multiple-test-with-fno-pie.patch
-
-       # conditionally copy musl specific suppressions && apply patch
+       # Conditionally copy musl specific suppressions && apply patch
        if use elibc_musl ; then
                cp "${FILESDIR}/musl.supp" "${S}" || die
-               eapply "${FILESDIR}/valgrind-3.13.0-malloc.patch"
+               PATCHES+=( "${FILESDIR}"/valgrind-3.13.0-malloc.patch )
        fi
 
        if [[ ${CHOST} == *-solaris* ]] ; then
@@ -49,8 +51,7 @@ src_prepare() {
                cp "${S}"/coregrind/link_tool_exe_{linux,solaris}.in
        fi
 
-       # Allow users to test their own patches
-       eapply_user
+       default
 
        # Regenerate autotools files
        eautoreconf

diff --git a/dev-util/valgrind/valgrind-9999.ebuild 
b/dev-util/valgrind/valgrind-9999.ebuild
index 7e7417e90831..aed73f6be21b 100644
--- a/dev-util/valgrind/valgrind-9999.ebuild
+++ b/dev-util/valgrind/valgrind-9999.ebuild
@@ -22,6 +22,12 @@ IUSE="mpi"
 DEPEND="mpi? ( virtual/mpi )"
 RDEPEND="${DEPEND}"
 
+PATCHES=(
+       # Respect CFLAGS, LDFLAGS
+       "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
+       "${FILESDIR}"/${PN}-3.15.0-Build-ldst_multiple-test-with-fno-pie.patch
+)
+
 src_prepare() {
        # Correct hard coded doc location
        sed -i -e "s:doc/valgrind:doc/${PF}:" docs/Makefile.am || die
@@ -29,15 +35,10 @@ src_prepare() {
        # Don't force multiarch stuff on OSX, bug #306467
        sed -i -e 's:-arch \(i386\|x86_64\)::g' Makefile.all.am || die
 
-       # Respect CFLAGS, LDFLAGS
-       eapply "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
-
-       eapply 
"${FILESDIR}"/${PN}-3.15.0-Build-ldst_multiple-test-with-fno-pie.patch
-
-       # conditionally copy musl specific suppressions && apply patch
+       # Conditionally copy musl specific suppressions && apply patch
        if use elibc_musl ; then
                cp "${FILESDIR}/musl.supp" "${S}" || die
-               eapply "${FILESDIR}/valgrind-3.13.0-malloc.patch"
+               PATCHES+=( "${FILESDIR}"/valgrind-3.13.0-malloc.patch )
        fi
 
        if [[ ${CHOST} == *-solaris* ]] ; then
@@ -49,8 +50,7 @@ src_prepare() {
                cp "${S}"/coregrind/link_tool_exe_{linux,solaris}.in
        fi
 
-       # Allow users to test their own patches
-       eapply_user
+       default
 
        # Regenerate autotools files
        eautoreconf

Reply via email to