commit:     58357ad14a1f2f507e9e705cb8c2f9afbc706076
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat May 30 21:58:04 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat May 30 21:58:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58357ad1

dev-libs/elfutils: use $CC in tests consistently, bug #718872

Reported-by: Agostino Sarubbo
Closes: https://bugs.gentoo.org/718872
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-libs/elfutils/elfutils-0.179.ebuild            |  3 ++
 .../files/elfutils-0.179-CC-in-tests.patch         | 45 ++++++++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/dev-libs/elfutils/elfutils-0.179.ebuild 
b/dev-libs/elfutils/elfutils-0.179.ebuild
index 5313453d1a0..70c6f757d6a 100644
--- a/dev-libs/elfutils/elfutils-0.179.ebuild
+++ b/dev-libs/elfutils/elfutils-0.179.ebuild
@@ -31,6 +31,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-0.175-disable-biarch-test-PR24158.patch
        "${FILESDIR}"/${PN}-0.177-disable-large.patch
        "${FILESDIR}"/${PN}-0.179-PaX-support.patch
+       "${FILESDIR}"/${PN}-0.179-CC-in-tests.patch
 )
 
 src_prepare() {
@@ -66,8 +67,10 @@ multilib_src_configure() {
 }
 
 multilib_src_test() {
+       # CC is a workaround for tests using ${CC-gcc}
        env     
LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm"
 \
                LC_ALL="C" \
+               CC="$(gc-getCC)" \
                emake check VERBOSE=1
 }
 

diff --git a/dev-libs/elfutils/files/elfutils-0.179-CC-in-tests.patch 
b/dev-libs/elfutils/files/elfutils-0.179-CC-in-tests.patch
new file mode 100644
index 00000000000..aa58862ec89
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.179-CC-in-tests.patch
@@ -0,0 +1,45 @@
+https://bugs.gentoo.org/718872
+--- a/tests/run-disasm-x86-64.sh
++++ b/tests/run-disasm-x86-64.sh
+@@ -22,7 +22,7 @@ case "`uname -m`" in
+   x86_64)
+     tempfiles testfile45.o
+     testfiles testfile45.S testfile45.expect
+-    gcc -m64 -c -o testfile45.o testfile45.S
++    ${CC-gcc} -m64 -c -o testfile45.o testfile45.S
+     testrun_compare ${abs_top_builddir}/src/objdump -d testfile45.o < 
testfile45.expect
+     ;;
+ esac
+--- a/tests/run-disasm-x86.sh
++++ b/tests/run-disasm-x86.sh
+@@ -22,7 +22,7 @@ case "`uname -m`" in
+   x86_64 | i?86 )
+     tempfiles testfile44.o
+     testfiles testfile44.S testfile44.expect
+-    gcc -m32 -c -o testfile44.o testfile44.S
++    ${CC-gcc} -m32 -c -o testfile44.o testfile44.S
+     testrun_compare ${abs_top_builddir}/src/objdump -d testfile44.o < 
testfile44.expect
+     ;;
+ esac
+--- a/tests/run-strip-g.sh
++++ b/tests/run-strip-g.sh
+@@ -25,7 +25,7 @@
+ tempfiles a.out strip.out debug.out readelf.out
+ 
+ echo Create debug a.out.
+-echo "int main() { return 1; }" | gcc -g -xc -
++echo "int main() { return 1; }" | ${CC-gcc} -g -xc -
+ 
+ echo strip -g to file with debug file
+ testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out ||
+--- a/tests/run-strip-nothing.sh
++++ b/tests/run-strip-nothing.sh
+@@ -23,7 +23,7 @@
+ tempfiles a.out strip.out debug.out
+ 
+ # Create no-debug a.out.
+-echo "int main() { return 1; }" | gcc -s -xc -
++echo "int main() { return 1; }" | ${CC-gcc} -s -xc -
+ 
+ # strip to file
+ testrun ${abs_top_builddir}/src/strip -g -o strip.out ||

Reply via email to