]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PowerPC: incorrect library search order
authorAlan Modra <amodra@gmail.com>
Wed, 17 May 2017 23:38:55 +0000 (09:08 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 17 May 2017 23:38:55 +0000 (09:08 +0930)
First, need to match against just the CPU name, not the whole triplet.
Otherwise, the test picks up "*le-*" pattern from x86_64-apple-darwin
triplet.

Second, it should be testing for $target, not $host. Host may be
little endian by default, and the sysroot directory layout shouldn't
depend on whether it is built on LE or BE machine.

* emulparams/elf32ppccommon.sh (LIBPATH_SUFFIX): Set from target
cpu, not host.

ld/ChangeLog
ld/emulparams/elf32ppccommon.sh

index 7d4faad56d2054259a7d1378c6f6e65658a32097..40a80529f282acb46d4a3e741a17036070a8cb7f 100644 (file)
@@ -1,3 +1,10 @@
+2017-05-18  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2017-03-13  Alexey Neyman  <stilor@att.net>
+       * emulparams/elf32ppccommon.sh (LIBPATH_SUFFIX): Set from target
+       cpu, not host.
+
 2017-04-28  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
 
        PR ld/21404
index 1f54ef8056dce38e3b6ed90074f97337f1783422..d00cf68d894be9cd5d5438dddd91f44014e928d7 100644 (file)
@@ -44,11 +44,11 @@ fi
 
 # Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
 # Similarly, look for 32 bit libraries in /lib32, /usr/lib32 etc.
-case "$host":"$EMULATION_NAME" in
-  *le-*:*64lppc*) LIBPATH_SUFFIX=64 ;;
-  *le-*:*32lppc*) LIBPATH_SUFFIX=32 ;;
-  *le-*:*64*) LIBPATH_SUFFIX=64be ;;
-  *le-*:*32*) LIBPATH_SUFFIX=32be ;;
+case `echo "$target" | sed -e 's/-.*//'`:"$EMULATION_NAME" in
+  *le:*64lppc*) LIBPATH_SUFFIX=64 ;;
+  *le:*32lppc*) LIBPATH_SUFFIX=32 ;;
+  *le:*64*) LIBPATH_SUFFIX=64be ;;
+  *le:*32*) LIBPATH_SUFFIX=32be ;;
   *:*64lppc*) LIBPATH_SUFFIX=64le ;;
   *:*32lppc*) LIBPATH_SUFFIX=32le ;;
   *:*64*) LIBPATH_SUFFIX=64 ;;