diff options
author | jperkin <jperkin@pkgsrc.org> | 2016-03-17 16:02:23 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2016-03-17 16:02:23 +0000 |
commit | d61de8cf4d0ca35da52643eec74d6dda121b99ea (patch) | |
tree | 21b0aba73df2a3bbd338f9f40f5c35e946b0344f /mk | |
parent | a480e32b2cd8af0360e49625c66c5a45f0f26c69 (diff) | |
download | pkgsrc-d61de8cf4d0ca35da52643eec74d6dda121b99ea.tar.gz |
Since the MACHINE_ARCH cleanup, the bootstrap for i386-on-x86_64 Linux has
been broken due to NATIVE_MACHINE_ARCH no longer being set to x86_64. Fix
this by introducing HOST_MACHINE_ARCH which refers to the underlying host
architecture rather than bmake's native architecture, thus differentiating
between cross-compiling and multilib.
This is currently only set on Linux as the only OPSYS which currently
requires such a test, but can be expanded to other OPSYS as necessary.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.prefs.mk | 6 | ||||
-rw-r--r-- | mk/platform/Linux.mk | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index 7382adadd25..e5a1666ca78 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.381 2016/03/11 23:54:08 khorben Exp $ +# $NetBSD: bsd.prefs.mk,v 1.382 2016/03/17 16:02:23 jperkin Exp $ # # This file includes the mk.conf file, which contains the user settings. # @@ -221,6 +221,10 @@ LOWER_VENDOR?= ssd LOWER_VENDOR?= pc . endif LOWER_VENDOR?= unknown +. if !defined(HOST_MACHINE_ARCH) +HOST_MACHINE_ARCH!= ${UNAME} -m +MAKEFLAGS+= HOST_MACHINE_ARCH=${HOST_MACHINE_ARCH:Q} +. endif .elif ${OPSYS} == "OpenBSD" LOWER_OPSYS?= openbsd diff --git a/mk/platform/Linux.mk b/mk/platform/Linux.mk index 74605d96893..9e1e23757ac 100644 --- a/mk/platform/Linux.mk +++ b/mk/platform/Linux.mk @@ -1,4 +1,4 @@ -# $NetBSD: Linux.mk,v 1.65 2016/03/10 16:58:19 jperkin Exp $ +# $NetBSD: Linux.mk,v 1.66 2016/03/17 16:02:23 jperkin Exp $ # # Variable definitions for the Linux operating system. @@ -120,7 +120,7 @@ LIBABISUFFIX?= 64 # 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" +.if ${HOST_MACHINE_ARCH} == "x86_64" && ${MACHINE_ARCH} == "i386" _WRAP_EXTRA_ARGS.LD+= -m elf_i386 CWRAPPERS_APPEND.ld+= -m elf_i386 .endif |