summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2014-03-07 15:03:15 +0000
committerjperkin <jperkin@pkgsrc.org>2014-03-07 15:03:15 +0000
commit337c9f7f2dbab51051b426e7413da4ad93afe47e (patch)
treea4b709aa992ae654ec5dad3e538eb7471a6f30ec
parent7bc76bf10136e815c8eaa38383ca862d84637e1e (diff)
downloadpkgsrc-337c9f7f2dbab51051b426e7413da4ad93afe47e.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.
-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 | \