From owner-freebsd-current@freebsd.org Sun Jun 12 13:17:48 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4EDDAF0EEE for ; Sun, 12 Jun 2016 13:17:48 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-4.reflexion.net [208.70.210.4]) (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 A9D2F268D for ; Sun, 12 Jun 2016 13:17:47 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 313 invoked from network); 12 Jun 2016 13:18:18 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 12 Jun 2016 13:18:18 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Sun, 12 Jun 2016 09:17:51 -0400 (EDT) Received: (qmail 6057 invoked from network); 12 Jun 2016 13:17:50 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 12 Jun 2016 13:17:50 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.0.105] (ip70-189-131-151.lv.lv.cox.net [70.189.131.151]) by iron2.pdx.net (Postfix) with ESMTPSA id 7E5A0B1E001; Sun, 12 Jun 2016 06:17:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: 11.0 -r301139: WITH_META_MODE=yes vs. "sh: ./make_keys: Exec format error"? [still true of -r301815] From: Mark Millard In-Reply-To: <38443.1465735161@kaos.jnpr.net> Date: Sun, 12 Jun 2016 06:17:44 -0700 Cc: Bryan Drewery , FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: <890D3808-1939-4BEA-886F-324EBA8C8671@dsl-only.net> <92116.1464890038@kaos.jnpr.net> <4a2034a9-a2e1-d951-aecf-43e043c48d75@FreeBSD.org> <55609B4E-DCC8-4666-BA15-17B6EF7D593F@dsl-only.net> <38443.1465735161@kaos.jnpr.net> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 13:17:49 -0000 On 2016-Jun-12, at 5:39 AM, Simon J. Gerraty wrote: > Mark Millard wrote: >>> --- build-tools_lib/ncurses/ncursesw --- >>> Building = /usr/obj/clang/arm.armv6/usr/src/lib/ncurses/ncursesw/make_keys >=20 > I must have been looking at on of our internal FreeBSD trees last > time... >=20 > In FreeBSD lib/ncurses/ncursesw/Makefile and other places I checked > just uses ${CC} for building make_keys - I don't see how that could = work > for cross-building.=20 >=20 > If you want cross-building to work, the simple solution is to ensure > that you use HOST_CC rather than CC when building things that need to > run on the build host. >=20 > eg. in our internal tree - which cross builds fine: >=20 > make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} > ${HOST_CC} -o $@ ${HOST_CFLAGS} = ${NCURSES_DIR}/ncurses/tinfo/make_keys.c >=20 > make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} > ${HOST_CC} -o $@ ${HOST_CFLAGS} -DMAIN_PROGRAM \ > ${NCURSES_DIR}/ncurses/tinfo/make_hash.c >=20 > and in share/mk/local.init.mk >=20 > HOST_CC?=3D /usr/bin/cc >=20 > should do. Cross builds work just fine based on the FreeBSD tree when omitting = WITH_META_MODE=3D. It is only when using WITH_META_MODE=3D that the cross build does not = work. So the ${CC} use must mix with some other aspect of WITH_META_MODE=3D = operation if ${CC} use contributes to the failure. As of -r301825 there is almost no use of HOST_CC at the upper levels or = in share/mk/*: > # grep HOST_CC /usr/src/Makefile* > # grep HOST_CC /usr/src/share/mk/* > /usr/src/share/mk/bsd.compiler.mk:.for var in CC CXX HOST_CC HOST_CXX where that last does: > .for var in CC CXX HOST_CC HOST_CXX > .if defined(${var}) && ${${var}:M${CCACHE_BIN}} =3D=3D "" > ${var}:=3D ${CCACHE_BIN} ${${var}} > .endif > .endfor Looking around more suggests that there is CC_FOR_BUILD and that HOST_CC = is more historical: > find /usr/src/ -name .svn -prune -o -exec grep HOST_CC {} ; -print | = more > # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still > # use `HOST_CC' if defined, but it is deprecated. > case $CC_FOR_BUILD,$HOST_CC,$CC in > ,*,*) CC_FOR_BUILD=3D$HOST_CC ;; > /usr/src/contrib/sqlite3/config.guess > * Makefile.in: rename HOST_CC to CC_FOR_BUILD > /usr/src/contrib/binutils/ld/ChangeLog-9197 > # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still > # use `HOST_CC' if defined, but it is deprecated. > case $CC_FOR_BUILD,$HOST_CC,$CC in > ,*,*) CC_FOR_BUILD=3D$HOST_CC ;; > /usr/src/contrib/binutils/config.guess > (HOST_CC, HOST_PREFIX, HOST_PREFIX_1): Undefine, they should > (HOST_CC, HOST_PREFIX, HOST_PREFIX_1): New variables. > /usr/src/contrib/binutils/ChangeLog > # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still > # use `HOST_CC' if defined, but it is deprecated. > case $CC_FOR_BUILD,$HOST_CC,$CC in > ,*,*) CC_FOR_BUILD=3D$HOST_CC ;; > /usr/src/contrib/ntp/config.guess > # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still > # use `HOST_CC' if defined, but it is deprecated. > case $CC_FOR_BUILD,$HOST_CC,$CC in > ,*,*) CC_FOR_BUILD=3D$HOST_CC ;; > /usr/src/contrib/ntp/sntp/config.guess > # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still > # use `HOST_CC' if defined, but it is deprecated. > case $CC_FOR_BUILD,$HOST_CC,$CC in > ,*,*) CC_FOR_BUILD=3D$HOST_CC ;; > /usr/src/contrib/ntp/sntp/libevent/build-aux/config.guess > # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still > # use `HOST_CC' if defined, but it is deprecated. > case $CC_FOR_BUILD,$HOST_CC,$CC in > ,*,*) CC_FOR_BUILD=3D$HOST_CC ;; > /usr/src/contrib/ofed/librdmacm/config/config.guess . . . =3D=3D=3D Mark Millard markmi at dsl-only.net