commit:     c288da02f7fc90f969d06a4dbd50b22cfa782d6d
Author:     Leno Hou <lenohou <AT> gmail <DOT> com>
AuthorDate: Tue Jun 28 14:31:29 2016 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Jun 28 17:47:02 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/ppc64le.git/commit/?id=c288da02

sys-devel/binutils: add ld BE emulations for ppc64le target #580614

Signed-off-by: Leno Hou <lenohou <AT> gmail.com>
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

 eclass/toolchain-binutils.eclass                       | 10 ++++++++++
 .../binutils/files/binutils-configure-target.patch     | 18 ++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass
index 34c8569..17eb5dc 100644
--- a/eclass/toolchain-binutils.eclass
+++ b/eclass/toolchain-binutils.eclass
@@ -180,6 +180,16 @@ tc-binutils_apply_patches() {
                        eend $?
                done
        fi
+
+       # fix emulations issues if possible #580614
+       if [[ -e ${FILESDIR}/binutils-configure-target.patch ]] ; then
+               einfo "Fixing emulations issues in configure target files"
+               ebegin "  Updating ld/configure.tgt"
+               patch "ld/configure.tgt" 
"${FILESDIR}"/binutils-configure-target.patch >& 
"${T}"/configure-target-patch.log \
+                               || eerror "Please file a bug about this"
+               eend $?
+       fi
+
        # fix conflicts with newer glibc #272594
        if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
                sed -i 's:\<getline\>:get_line:g' 
libiberty/testsuite/test-demangle.c

diff --git a/sys-devel/binutils/files/binutils-configure-target.patch 
b/sys-devel/binutils/files/binutils-configure-target.patch
new file mode 100644
index 0000000..0cd8778
--- /dev/null
+++ b/sys-devel/binutils/files/binutils-configure-target.patch
@@ -0,0 +1,18 @@
+--- ld/configure.tgt.orig      2016-05-15 07:49:39.661039407 +0000
++++ ld/configure.tgt   2016-05-15 08:15:24.441045822 +0000
+@@ -586,10 +586,13 @@
+                       esac
+                       case "${targ}" in
+                       powerpc*le-*)
+-                              for z in targ_emul targ_extra_emuls 
targ_extra_libpath targ64_extra_emuls targ64_extra_libpath
++                              for z in targ_extra_emuls targ_extra_libpath 
targ64_extra_emuls targ64_extra_libpath
+                               do
+-                                eval ${z}=\"`eval echo \\$${z} | sed -e 
's/ppc/lppc/g'`\"
++                                eval ${z}+=\" `eval echo \\$${z} | sed -e 
's/ppc/lppc/g'`\"
+                               done
++                              eval targ_extra_emuls+=\" \$targ_emul\"
++                              eval targ_emul=\"`eval echo \\$targ_emul | sed 
-e 's/ppc/lppc/g'`\"
++
+                       esac ;;
+ powerpc-*-nto*)         targ_emul=elf32ppcnto ;;
+ powerpcle-*-nto*)       targ_emul=elf32lppcnto ;;

Reply via email to