From owner-freebsd-arch@FreeBSD.ORG Wed Nov 26 21:37:19 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5D5183F for ; Wed, 26 Nov 2014 21:37:18 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C704078A for ; Wed, 26 Nov 2014 21:37:18 +0000 (UTC) Received: from [192.168.200.212] (unknown [50.136.155.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 8F2951928D6 for ; Wed, 26 Nov 2014 21:37:11 +0000 (UTC) Message-ID: <1417037830.4680.4.camel@ignoranthack.me> Subject: How is MACHINE_ARCH dervived by make? From: Sean Bruno Reply-To: sbruno@freebsd.org To: freebsd-arch@freebsd.org Date: Wed, 26 Nov 2014 13:37:10 -0800 Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.7 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2014 21:37:19 -0000 I have yet to find the magic bit in the build sys that causes ports to go off and think that I'm building for amd64. Building on a real amd64 box inside of an emulated jail via qemu and I still am getting tripped up by something in our system thinking that I want amd64 as the MACHINE_ARCH. ---- emulation jail, showing arm/armv6 ------ root@crack:/usr/share/mk # uname -a FreeBSD crack.ysv.freebsd.org 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r274799: Fri Nov 21 17:29:42 UTC 2014 sbruno@crack.ysv.freebsd.org:/usr/obj/usr/src/sys/CRACK arm root@crack:/usr/share/mk # sysctl hw.machine_arch hw.machine hw.machine_arch: armv6 hw.machine: arm ---------- e.g. math/fftw3 --> make -DBATCH -dA ------ Global:.CURDIR = /usr/ports/math/fftw3 Caching /usr/ports/math/fftw3 ...done Global:.OBJDIR = /usr/ports/math/fftw3 Caching . ...done Global:delete .PATH (not found) Global:.PATH = . Global:.PATH = . /usr/ports/math/fftw3 Global:.TARGETS = Caching /usr/share/mk ...done Expanding "sys.mk"... /usr/share/mk/sys.mk Internal:MAKEFILE = /usr/share/mk/sys.mk Global:.MAKE.MAKEFILES = /usr/share/mk/sys.mk Parse_SetInput: file /usr/share/mk/sys.mk, line 0, fd -1, nextbuf 0x413210, arg 0x800c5d370 Global:.PARSEDIR = /usr/share/mk Global:.PARSEFILE = sys.mk ParseSetParseFile: ${.PARSEDIR} = `/usr/share/mk' ${.PARSEFILE} = `sys.mk' ParseReadLine (4): 'unix ?= We run FreeBSD, not UNIX.' Global:unix = We run FreeBSD, not UNIX. ParseReadLine (5): '.FreeBSD ?= true' Global:.FreeBSD = true ParseReadLine (16): 'MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32| 64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}' Global:MACHINE_CPUARCH = ${MACHINE_ARCH:C/mips(n32| 64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} ParseReadLine (31): '.SUFFIXES: .out .a .ln .o .c .cc .cpp .cxx .C .m .F .f .e .r .y .l .S .asm .s .cl .p .h .sh' ParseDoDependency(.SUFFIXES: .out .a .ln .o .c .cc .cpp .cxx .C .m .F .f .e .r .y .l .S .asm .s .cl .p .h .sh) ParseReadLine (34): 'AR ?= ar' Global:AR = ar ParseReadLine (38): 'ARFLAGS ?= -crD' Global:ARFLAGS = -crD ParseReadLine (40): 'RANLIB ?= ranlib' Global:RANLIB = ranlib ParseReadLine (42): 'RANLIBFLAGS ?= -D' Global:RANLIBFLAGS = -D ParseReadLine (45): 'AS ?= as' Global:AS = as ParseReadLine (46): 'AFLAGS ?=' Global:AFLAGS = ParseReadLine (47): 'ACFLAGS ?=' Global:ACFLAGS = ParseReadLine (53): 'CC ?= cc' Global:CC = cc Applying[MACHINE_ARCH] :C to "amd64" Modifier pattern: "mips(n32|64)?(el)?" Modifier pattern: "mips" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Modifier pattern: "arm(v6)?(eb|hf)?" Modifier pattern: "arm" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Modifier pattern: "powerpc64" Modifier pattern: "powerpc" Result[MACHINE_ARCH] of :C is "amd64" lhs = "amd64", rhs = "arm", op = == Applying[MACHINE_ARCH] :C to "amd64" Modifier pattern: "mips(n32|64)?(el)?" Modifier pattern: "mips" Result[MACHINE_ARCH] of :C is "amd64" Applying[MACHINE_ARCH] :C to "amd64" Modifier pattern: "arm(v6)?(eb|hf)?" Modifier pattern: "arm"