summaryrefslogtreecommitdiff
path: root/recipes/binutils/binutils-2.19/binutils-x86_64_i386_biarch.patch
blob: b79a76af37bb029386af10aab4ddf664ca443eca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh -e
## 127_x86_64_i386_biarch.dpatch
##
## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
## DP: Author: Aurelien Jarno <aurel32.debian.org>
## DP: Upstream status: Debian specific
#
# Hacked to apply with quilt

--- binutils/ld/emulparams/elf_i386.sh
+++ binutils/ld/emulparams/elf_i386.sh
@@ -12,3 +12,13 @@
 GENERATE_PIE_SCRIPT=yes
 NO_SMALL_DATA=yes
 SEPARATE_GOTPLT=12
+
+# Linux modify the default library search path to first include
+# a 32-bit specific directory.
+case "$target" in
+  x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
+    case "$EMULATION_NAME" in
+      *i386*) LIBPATH_SUFFIX=32 ;;
+    esac
+    ;;
+esac