Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id CD00D1A921F for ; Sun, 10 Apr 2022 19:54:04 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id 789DA84EA4; Sun, 10 Apr 2022 19:54:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id ADAEB84DBD for ; Sun, 10 Apr 2022 19:54:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id dh6ajWmgx-Rz for ; Sun, 10 Apr 2022 19:54:03 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id EE55784D1C for ; Sun, 10 Apr 2022 19:54:02 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id E08E3FB24; Sun, 10 Apr 2022 19:54:02 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_164962044234410" MIME-Version: 1.0 Date: Sun, 10 Apr 2022 19:54:02 +0000 From: "Taylor R Campbell" Subject: CVS commit: pkgsrc To: pkgsrc-changes@NetBSD.org Reply-To: riastradh@netbsd.org X-Mailer: log_accum Message-Id: <20220410195402.E08E3FB24@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_164962044234410 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: riastradh Date: Sun Apr 10 19:54:02 UTC 2022 Modified Files: pkgsrc/doc: HOWTO-use-crosscompile pkgsrc/mk: compiler.mk cwrappers.mk Log Message: mk: Use CWRAPPERS_PREPEND for --sysroot. Looks like maybe the -Wl,-rpath-link business isn't necessary after all -- will leave this as is until I find evidence otherwise. (joerg says it was a workaround for NetBSD toolchain parts that weren't properly adapted to use sysroot.) With this, revert cwrappers version dependency to what it was before. But keep it as TOOL_DEPENDS, not BUILD_DEPENDS. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 pkgsrc/doc/HOWTO-use-crosscompile cvs rdiff -u -r1.96 -r1.97 pkgsrc/mk/compiler.mk cvs rdiff -u -r1.35 -r1.36 pkgsrc/mk/cwrappers.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_164962044234410 Content-Disposition: inline Content-Length: 3806 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/doc/HOWTO-use-crosscompile diff -u pkgsrc/doc/HOWTO-use-crosscompile:1.10 pkgsrc/doc/HOWTO-use-crosscompile:1.11 --- pkgsrc/doc/HOWTO-use-crosscompile:1.10 Mon Apr 4 11:23:18 2022 +++ pkgsrc/doc/HOWTO-use-crosscompile Sun Apr 10 19:54:02 2022 @@ -1,7 +1,7 @@ Cross-compilation in pkgsrc (user's guide) -*- outline -*- Taylor R. Campbell -$NetBSD: HOWTO-use-crosscompile,v 1.10 2022/04/04 11:23:18 riastradh Exp $ +$NetBSD: HOWTO-use-crosscompile,v 1.11 2022/04/10 19:54:02 riastradh Exp $ The following steps enable you to build binary packages for a machine architecture other than the one you are building on. For example, you @@ -61,14 +61,30 @@ In addition to whatever else you want in MACHINE_ARCH= powerpc .endif -You can bootstrap pkgsrc or not; it shouldn't make a difference for -cross-compilation. If you do, replace `make' by `bmake' below, of -course. - XXX Some variables, notably LOCALBASE and other paths that get baked into packages, cannot currently be set differently for native and target packages. +** Bootstrapped pkgsrc + +You can bootstrap pkgsrc or not; it shouldn't make a difference for +cross-compilation. If you do: + + - Replace `make' by `bmake' below. + + - Make sure any ABI setting in mk.conf is conditionally set + appropriately. + + For example, bootstrap on amd64 leaves ABI=64 in mk.conf, which must + be left empty or undefined for earmv7hf cross-builds. So you might + need: + + .if empty(USE_CROSS_COMPILE:M[yY][eE][sS]) + ABI= 64 # set for native amd64 build + .else + ABI= # empty for earmv7hf cross-build + .endif + * Make some packages Now packages you build normally will be cross-compiled for the target: Index: pkgsrc/mk/compiler.mk diff -u pkgsrc/mk/compiler.mk:1.96 pkgsrc/mk/compiler.mk:1.97 --- pkgsrc/mk/compiler.mk:1.96 Fri Dec 3 07:40:26 2021 +++ pkgsrc/mk/compiler.mk Sun Apr 10 19:54:02 2022 @@ -1,4 +1,4 @@ -# $NetBSD: compiler.mk,v 1.96 2021/12/03 07:40:26 wiz Exp $ +# $NetBSD: compiler.mk,v 1.97 2022/04/10 19:54:02 riastradh Exp $ # # This Makefile fragment implements handling for supported C/C++/Fortran # compilers. @@ -220,6 +220,15 @@ _WRAP_EXTRA_ARGS.CC+= ${_CTF_CFLAGS} CWRAPPERS_APPEND.cc+= ${_CTF_CFLAGS} .endif +# Add sysroot if using cross-compilation tools. +# +.if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS]) +CWRAPPERS_PREPEND.cc+= --sysroot=${TOOLS_CROSS_DESTDIR:Q} +CWRAPPERS_PREPEND.cxx+= --sysroot=${TOOLS_CROSS_DESTDIR:Q} +CWRAPPERS_PREPEND.ld+= --sysroot=${TOOLS_CROSS_DESTDIR:Q} +# XXX cross fortran +.endif + # If the languages are not requested, force them not to be available # in the generated wrappers. # Index: pkgsrc/mk/cwrappers.mk diff -u pkgsrc/mk/cwrappers.mk:1.35 pkgsrc/mk/cwrappers.mk:1.36 --- pkgsrc/mk/cwrappers.mk:1.35 Mon Apr 4 11:23:06 2022 +++ pkgsrc/mk/cwrappers.mk Sun Apr 10 19:54:02 2022 @@ -1,11 +1,11 @@ -# $NetBSD: cwrappers.mk,v 1.35 2022/04/04 11:23:06 riastradh Exp $ +# $NetBSD: cwrappers.mk,v 1.36 2022/04/10 19:54:02 riastradh Exp $ # # This Makefile fragment implements integration of pkgtools/cwrappers. .include "../../mk/wrapper/wrapper-defs.mk" .include "../../mk/buildlink3/bsd.buildlink3.mk" -TOOL_DEPENDS+= cwrappers>=20220403:../../pkgtools/cwrappers +TOOL_DEPENDS+= cwrappers>=20150314:../../pkgtools/cwrappers # XXX This should be PREFIX, but USE_CROSSBASE overrides it. CWRAPPERS_SRC_DIR= ${LOCALBASE}/libexec/cwrappers @@ -101,9 +101,6 @@ generate-cwrappers: . endfor . endif . endif -. if !empty(TOOLS_USE_CROSS_COMPILE:M[yY][eE][sS]) - ${RUN}echo sysroot=${TOOLS_CROSS_DESTDIR:Q} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}} -. endif .endfor PREPEND_PATH+= ${WRAPPER_BINDIR} --_----------=_164962044234410--