dev-util/valgrind: fix linking on Solaris
authorFabian Groffen <grobian@gentoo.org>
Thu, 5 Apr 2018 08:08:10 +0000 (10:08 +0200)
committerFabian Groffen <grobian@gentoo.org>
Thu, 5 Apr 2018 08:08:10 +0000 (10:08 +0200)
Package-Manager: Portage-2.3.24, Repoman-2.3.6

dev-util/valgrind/valgrind-3.13.0-r2.ebuild
dev-util/valgrind/valgrind-9999.ebuild

index f509e509703bcd66d3b687f989910ac3e3a1e04b..0ef938d860fdf9a3ebb153464a575529e60f9452 100644 (file)
@@ -15,7 +15,7 @@ if [[ ${PV} == "9999" ]]; then
        inherit git-r3
 else
        SRC_URI="ftp://sourceware.org/pub/valgrind/${P}.tar.bz2"
-       KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+       KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~x64-solaris"
 fi
 
 DEPEND="mpi? ( virtual/mpi )"
@@ -37,6 +37,15 @@ src_prepare() {
        # Fix --xml-socket command line option (qt-creator), bug #641790
        eapply "${FILESDIR}"/${P}-xml-socket.patch
 
+       if [[ ${CHOST} == *-solaris* ]] ; then
+               # upstream doesn't support this, but we don't build with
+               # Sun/Oracle ld, we have a GNU toolchain, so get some things
+               # working the Linux/GNU way
+               find "${S}" -name "Makefile.am" -o -name "Makefile.tool.am" | xargs \
+                       sed -i -e 's:-M,/usr/lib/ld/map.noexstk:-z,noexecstack:' || die
+               cp "${S}"/coregrind/link_tool_exe_{linux,solaris}.in
+       fi
+
        # Allow users to test their own patches
        eapply_user
 
index 2b96d5f5150c97ff6deed268f50ad6f3910029f8..b7152e95dc5e587b209d6563da06f07db6e71e1f 100644 (file)
@@ -31,6 +31,15 @@ src_prepare() {
        # Respect CFLAGS, LDFLAGS
        eapply "${FILESDIR}"/${PN}-3.7.0-respect-flags.patch
 
+       if [[ ${CHOST} == *-solaris* ]] ; then
+               # upstream doesn't support this, but we don't build with
+               # Sun/Oracle ld, we have a GNU toolchain, so get some things
+               # working the Linux/GNU way
+               find "${S}" -name "Makefile.am" -o -name "Makefile.tool.am" | xargs \
+                       sed -i -e 's:-M,/usr/lib/ld/map.noexstk:-z,noexecstack:' || die
+               cp "${S}"/coregrind/link_tool_exe_{linux,solaris}.in
+       fi
+
        # Allow users to test their own patches
        eapply_user