pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc
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.
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 <riastradh%NetBSD.org@localhost>
-$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}
Home |
Main Index |
Thread Index |
Old Index