#!/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 ## DP: Upstream status: Debian specific if [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 fi [ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts patch_opts="${patch_opts:--f --no-backup-if-mismatch}" case "$1" in -patch) patch $patch_opts -p1 < $0;; -unpatch) patch $patch_opts -p1 -R < $0;; *) echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1;; esac exit 0 @DPATCH@ --- 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*) + case "$EMULATION_NAME" in + *i386*) LIBPATH_SUFFIX=32 ;; + esac + ;; +esac