summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjperkin <jperkin>2014-03-07 15:03:15 +0000
committerjperkin <jperkin>2014-03-07 15:03:15 +0000
commit6200c13a30a9791f6d5a1b9ae8315d8f21731d9d (patch)
treea4b709aa992ae654ec5dad3e538eb7471a6f30ec /mk
parentbbf2998ed57318e7e1c5e6196c070468f577b61d (diff)
downloadpkgsrc-6200c13a30a9791f6d5a1b9ae8315d8f21731d9d.tar.gz
When building 32-bit packages on x86_64 GNU ld isn't smart enough to
figure out the target architecture based on the objects so we need to explicitly set it. This allows bootstrap --abi=32 to complete successfully on x86_64.
Diffstat (limited to 'mk')
-rw-r--r--mk/platform/Linux.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/mk/platform/Linux.mk b/mk/platform/Linux.mk
index 5ae70b9baa7..4e30dca8074 100644
--- a/mk/platform/Linux.mk
+++ b/mk/platform/Linux.mk
@@ -1,4 +1,4 @@
-# $NetBSD: Linux.mk,v 1.59 2014/02/20 11:03:09 jperkin Exp $
+# $NetBSD: Linux.mk,v 1.60 2014/03/07 15:03:15 jperkin Exp $
#
# Variable definitions for the Linux operating system.
@@ -111,6 +111,13 @@ ABI?= 64
LIBABISUFFIX?= 64
.endif
+# When building 32-bit packages on x86_64 GNU ld isn't smart enough to
+# figure out the target architecture based on the objects so we need to
+# explicitly set it.
+.if ${NATIVE_MACHINE_ARCH} == "x86_64" && ${MACHINE_ARCH} == "i386"
+_WRAP_EXTRA_ARGS.LD+= -m elf_i386
+.endif
+
## Use _CMD so the command only gets run when needed!
.if exists(/lib${LIBABISUFFIX}/libc.so.6)
_GLIBC_VERSION_CMD= /lib${LIBABISUFFIX}/libc.so.6 --version | \