From unknown Sun Aug 17 01:00:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#74343] [PATCH 0/1] Fix cross-compilation for isc-dhcp Resent-From: Christoph Buck Original-Sender: "Debbugs-submit" Resent-CC: rekado@elephly.net, guix-patches@gnu.org Resent-Date: Wed, 13 Nov 2024 14:06:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74343 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74343@debbugs.gnu.org Cc: Christoph Buck , Ricardo Wurmus X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ricardo Wurmus Received: via spool by submit@debbugs.gnu.org id=B.17315067301664 (code B ref -1); Wed, 13 Nov 2024 14:06:05 +0000 Received: (at submit) by debbugs.gnu.org; 13 Nov 2024 14:05:30 +0000 Received: from localhost ([127.0.0.1]:41330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBDzt-0000Qf-FA for submit@debbugs.gnu.org; Wed, 13 Nov 2024 09:05:30 -0500 Received: from lists.gnu.org ([209.51.188.17]:44634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBCW5-0004eZ-UE for submit@debbugs.gnu.org; Wed, 13 Nov 2024 07:30:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBCW4-0000zz-Uh for guix-patches@gnu.org; Wed, 13 Nov 2024 07:30:37 -0500 Received: from mail-108-mta81.mxroute.com ([136.175.108.81]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBCW2-0002CR-1S for guix-patches@gnu.org; Wed, 13 Nov 2024 07:30:36 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta81.mxroute.com (ZoneMTA) with ESMTPSA id 1932580ec820003e01.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 13 Nov 2024 12:30:26 +0000 X-Zone-Loop: 0d23d1f0b1c83d64380c7ee00cb0a66c624cf861691b X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=icepic.de; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To: From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=kQE+AkEfjVSzWkLHInrMm28pRgLe4Z4JcJQLEtkY9fQ=; b=R b5CK8ZnUxL2h5xzUXVVfcYTo8su029CJ+DQp5MsPhlT6UZMu3PpMwlY0r+W63zmOm0EMUqySDJtMS avtSLp2UWlcwa8As26y+et+ChDZ6zkuwLmg5hm4tg941jFWlPlT6DPROLFsbGXiMqBLh6mdYbAvf9 nSD0yunyI88JQ0n2+j4BU97E6KlL3Ywc7DGnRSzC780A0GNgQdiXdO3rBtYJHAeKoEftewInWqRmr zT/RqyInbdkCgbZj6btlS6VatMIzIsoklfaTvATR6YnEamiSAv1B6Oc6oewjvv6oQ/lFX7pwuQzYV HaM0paZpxj7cedpaPMI0ZU4YdNlJbvzyg==; From: Christoph Buck Date: Wed, 13 Nov 2024 13:30:09 +0100 Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: dev@icepic.de Received-SPF: pass client-ip=136.175.108.81; envelope-from=dev@icepic.de; helo=mail-108-mta81.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Mailman-Approved-At: Wed, 13 Nov 2024 09:05:26 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi! Cross-compiling isc-dhcp from x64 to arm32 is broken as you can see below (output shortend to include only the relevant information) --8<---------------cut here---------------start------------->8--- icepic@G16-Buck ~/guix/src/guix [env]$ ./pre-inst-env guix describe Git checkout: repository: /home/icepic/guix/src/guix/ branch: master commit: b10ce47d8be5b6c15987f4e1d93b3bd71b1eb220 ./pre-inst-env guix build --target=arm-linux-gnueabihf isc-dhcp -K [...] phase `post-configure' succeeded after 0.5 seconds starting phase `patch-generated-file-shebangs' patch-shebang: ./bind/bind-9.11.37/contrib/dnsperf-2.1.0.0-1/contrib/queryparse/queryparse: warning: no binary for interpreter `python' found in $PATH phase `patch-generated-file-shebangs' succeeded after 0.1 seconds starting phase `update-config-scripts-for-bind' phase `update-config-scripts-for-bind' succeeded after 0.0 seconds starting phase `build' Making all in ./bind make[1]: Entering directory '/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind' /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37 already unpacked... Configuring BIND libraries for DHCP. Building BIND libraries - this takes some time. Building isc library in /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/isc /gnu/store/ylgkrq9j1gyfig2y66srmgsbyh9w20d9-binutils-2.41/bin/ar: `u' modifier ignored since `D' is the default (see `U') /gnu/store/ylgkrq9j1gyfig2y66srmgsbyh9w20d9-binutils-2.41/bin/ar: `u' modifier ignored since `D' is the default (see `U') Building dns library in /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns make[3]: *** [Makefile:601: include/dns/enumtype.h] Error 1 make[2]: *** [Makefile:595: include] Error 2 Building isccfg library in /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/isccfg In file included from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/isccfg/include/isccfg/aclconf.h:24, from aclconf.c:24: /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/types.h:230:10: fatal error: dns/enumtype.h: No such file or directory 230 | #include /* Provides dns_rdatatype_t. */ | ^~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:239: aclconf.o] Error 1 Building irs library in /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/irs In file included from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/tsig.h:28, from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/client.h:45, from context.c:28: /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/types.h:230:10: fatal error: dns/enumtype.h: No such file or directory 230 | #include /* Provides dns_rdatatype_t. */ | ^~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:237: context.o] Error 1 Installing BIND libraries to /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind. mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/include mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/include/isc mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/include/pk11 mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/include/pkcs11 mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/lib make[3]: *** [Makefile:601: include/dns/enumtype.h] Error 1 make[2]: *** [Makefile:595: include] Error 2 In file included from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/isccfg/include/isccfg/aclconf.h:24, from aclconf.c:24: /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/types.h:230:10: fatal error: dns/enumtype.h: No such file or directory 230 | #include /* Provides dns_rdatatype_t. */ | ^~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:239: aclconf.o] Error 1 In file included from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/tsig.h:28, from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/client.h:45, from context.c:28: /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/types.h:230:10: fatal error: dns/enumtype.h: No such file or directory 230 | #include /* Provides dns_rdatatype_t. */ | ^~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:237: context.o] Error 1 make[1]: *** [Makefile:77: bind2] Error 2 make[1]: Leaving directory '/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind' make: *** [Makefile:463: all-recursive] Error 1 error: in phase 'build': uncaught exception: %exception #<&invoke-error program: "make" arguments: () exit-status: 2 term-signal: #f stop-signal: #f> phase `build' failed after 14.3 seconds command "make" failed with status 2 build process 18 exited with status 256 note: keeping build directory `/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0' builder for `/gnu/store/havk5qmkfa6vz9f7vw794vp3n49fx21a-isc-dhcp-4.4.3-P1.drv' failed with exit code 1 --8<---------------cut here---------------end--------------->8--- >From what i understand the following goes wrong. During compilation of the `isc-dhcp` package, the package `bind` is also build. `isc-dhcp` includes the bind source tree but guix replaces it with a more recent version. During the build process of `bind`, which is triggered from `isc-dhcp` an executable named `gen` (see `lib/dns`) is compiled and executed to generate the `dns/enumtype.h` header. Execution on `gen` during cross-compilation however fails, because `gen` was cross-compiled and not build for the host system where it is executed. --8<---------------cut here---------------start------------->8--- icepic@G16-Buck:~$ file /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-1/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/gen /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-1/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/gen: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /gnu/store/yxbip29ib6rf69pfpqsxpi8wvslm1gng-glibc-cross-arm-linux-gnueabihf-2.39/lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped icepic@G16-Buck:~$ --8<---------------cut here---------------end--------------->8--- According to the documentation setting the `BUILD_CC` variable to the native compiler should prevent this error, and indeed guilx sets this variable in the build process. But this variable is ignored by the `configure` script of bind. --8<---------------cut here---------------start------------->8--- icepic@G16-Buck:/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-1$ source environment-variables icepic@G16-Buck:/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1$ printenv | grep BUILD_CC BUILD_CC=gcc icepic@G16-Buck:/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1$ cat dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/Makefile | grep BUILD_CC BUILD_CC = arm-linux-gnueabihf-gcc ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \ --8<---------------cut here---------------end--------------->8--- Configure of bind is called with the following paramters: --8<---------------cut here---------------start------------->8--- $ ./configure CONFIG_SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/sh SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/sh --without-openssl --without-libxml2 --without-libjson --without-gssapi --disable-threads --without-lmdb --includedir=/gnu/store/qfndmj9gi31qbzl7f9b00pcylnah4pf2-isc-dhcp-4.4.3-P1/include --libdir=/gnu/store/qfndmj9gi31qbzl7f9b00pcylnah4pf2-isc-dhcp-4.4.3-P1/lib --without-python --disable-kqueue --disable-epoll --disable-devpoll --host=arm-linux-gnueabihf CC_FOR_BUILD=gcc CONFIG_SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash --with-randomdev=/dev/random --enable-full-report --8<---------------cut here---------------end--------------->8--- If you look closely, you can see that parameter `--host` is set to `arm-linux-gnueabihf` but `--build` is missing. A quick look in the configure script of bind reveals, that `BUILD_CC` is only propagated from the env, if we are in a cross-compiling context : --8<---------------cut here---------------start------------->8--- if test "yes" = "$cross_compiling"; then if test -z "$BUILD_CC"; then as_fn_error $? "BUILD_CC not set" "$LINENO" 5 fi BUILD_CFLAGS="$BUILD_CFLAGS" BUILD_CPPFLAGS="$BUILD_CPPFLAGS" BUILD_LDFLAGS="$BUILD_LDFLAGS" BUILD_LIBS="$BUILD_LIBS" else BUILD_CC="$CC" BUILD_CFLAGS="$CFLAGS" BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG" BUILD_LDFLAGS="$LDFLAGS" BUILD_LIBS="$LIBS" fi --8<---------------cut here---------------end--------------->8--- And finally if we are in a cross compiled context is checked by --8<---------------cut here---------------start------------->8--- # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi --8<---------------cut here---------------end--------------->8--- in the configure script of `bind`. Since we don't have explicitly set the `--build` parameter of the configure script, i suspect this test fails and the `BUILD_CC` variable from the environment is not picked up. One can test this quickly, by extending the the `--build` parameter in the package description in admin.scm, namely --8<---------------cut here---------------start------------->8--- (lambda _ (substitute* "configure" (("--host=\\$host") "--host=$host_alias --build=$build_alias")) ;; BIND needs a native compiler because the DHCP ;; build system uses the built 'gen' executable. (setenv "BUILD_CC" "gcc") ;; powerpc-linux needs to be told to use -latomic. ,@(if (target-ppc32?) `((setenv "LIBS" "-latomic")) '())))) --8<---------------cut here---------------end--------------->8--- And indeed, building this package description seems to fix the problem. One thing however is suspicious. Why did cross compilation for aarch64 work? I didn't figure this out. However, the following patch should fix this issue for arm32 and aarch64 crossbuild still works. Christoph Buck (1): gnu: isc-dhcp: Fix cross compilation for arm32 gnu/packages/admin.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 1f057603ef59c7b9c32f610a897321fd75dc4dad -- 2.46.0 From unknown Sun Aug 17 01:00:24 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#74343] [PATCH 1/1] gnu: isc-dhcp: Fix cross compilation for arm32 Resent-From: Christoph Buck Original-Sender: "Debbugs-submit" Resent-CC: rekado@elephly.net, guix-patches@gnu.org Resent-Date: Wed, 13 Nov 2024 15:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74343 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74343@debbugs.gnu.org Cc: Christoph Buck , Ricardo Wurmus X-Debbugs-Original-Xcc: Ricardo Wurmus Received: via spool by 74343-submit@debbugs.gnu.org id=B74343.173151205418821 (code B ref 74343); Wed, 13 Nov 2024 15:35:01 +0000 Received: (at 74343) by debbugs.gnu.org; 13 Nov 2024 15:34:14 +0000 Received: from localhost ([127.0.0.1]:43153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBFNl-0004tV-PM for submit@debbugs.gnu.org; Wed, 13 Nov 2024 10:34:14 -0500 Received: from mail-108-mta150.mxroute.com ([136.175.108.150]:46877) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBFNj-0004tN-TP for 74343@debbugs.gnu.org; Wed, 13 Nov 2024 10:34:12 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta150.mxroute.com (ZoneMTA) with ESMTPSA id 193262918870003e01.001 for <74343@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 13 Nov 2024 15:34:07 +0000 X-Zone-Loop: 1412ceaafefa45e16cbad5df5f69a662d183bdbc0a1c X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=icepic.de; s=x; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XVKODV/ZqXtvXTuxM/6JgpgjQQXJ3nYzRZhBOovq2tc=; b=G4IWfnxAoYQJVwuqoq/Oecc3ys O1gr5zv2NN8Qgt+R5TUxp7OersWEbavfWQ3G90RqT+kbIhppmZveOqxuM3RTxPk2Jop7b9ha/Z8/m M5RMR1wTKVgWrNMTQHfBrWvG7NQMz2mFkUJbAD1lDXWeFEDZkfP64h8896KiUOqMs4jU5Ey/L+d3A 1w2s12BX1Z/aZl5+gnR5rjIyAfVAYTfXcRYZQ0Mqq7tOgzTbiVLJXla8kGO1OPE2alf3Q4npQJ/0+ u4E9YfiVfBc29Ee3+c5jQzRbeqcjX5YkZeCh0GCBRisoMJc0uLWD6xbDKy371WBmCanx4atWcG+yF MZlxUDXQ==; From: Christoph Buck Date: Wed, 13 Nov 2024 16:33:56 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: dev@icepic.de X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/admin.scm (isc-dhcp): Fix cross compilation for arm32 Change-Id: I52a863d2cb44e81e26de3224a7c5f8c6d2420cc6 --- gnu/packages/admin.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 9c765b51a9..4c13a88710 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -1551,7 +1551,7 @@ (define-public isc-dhcp (lambda _ (substitute* "configure" (("--host=\\$host") - "--host=$host_alias")) + "--host=$host_alias --build=$build_alias")) ;; BIND needs a native compiler because the DHCP ;; build system uses the built 'gen' executable. (setenv "BUILD_CC" "gcc") -- 2.46.0 From unknown Sun Aug 17 01:00:24 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Christoph Buck Subject: bug#74343: closed (Re: [bug#74343] [PATCH 1/1] gnu: isc-dhcp: Fix cross compilation for arm32) Message-ID: References: <87wmfxmgj4.fsf@gnu.org> X-Gnu-PR-Message: they-closed 74343 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 74343@debbugs.gnu.org Date: Wed, 18 Dec 2024 10:29:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1734517743-11178-1" This is a multi-part message in MIME format... ------------=_1734517743-11178-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #74343: [PATCH 0/1] Fix cross-compilation for isc-dhcp which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 74343@debbugs.gnu.org. --=20 74343: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D74343 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1734517743-11178-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 74343-done) by debbugs.gnu.org; 18 Dec 2024 10:28:53 +0000 Received: from localhost ([127.0.0.1]:33540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNrIO-0002tn-Ot for submit@debbugs.gnu.org; Wed, 18 Dec 2024 05:28:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNrIH-0002tK-6n for 74343-done@debbugs.gnu.org; Wed, 18 Dec 2024 05:28:45 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNrIA-00010w-VT; Wed, 18 Dec 2024 05:28:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=bILLLygGtJ0eN5jQYIRFH7XLKKgnBWZJxmM5tknGbOs=; b=gM7c+coxSPSQcKq0tzhO ZsTZcjXGSjPghIi3hn+Bxwd1B1mVNs0+Zx7PKRzHQJbtEN+clehmRn18TvDccXtM/CztV3X4Avln4 gzx4c4J3kNo/t9TNCYiABurn5W5KxBKQycBkBLTo1anOGhzAp7QLGKDPF656tspib9pW3cNJYhP6F QQY+zQgXVGvXShu09puYu6zNsxDBks0lVWSH8StM147GzJIwn/2mh+niC4xvphytngpfGGBMAASgO oXzvUAqNr/Zmx7jPk7DHpIYtnR2e1kqaNXz39tMKXWkgKKupjE2pBJZxxBPaRYmPtU7pL6Zg6K3FA GNW0jVgn3AdW2w==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christoph Buck Subject: Re: [bug#74343] [PATCH 1/1] gnu: isc-dhcp: Fix cross compilation for arm32 In-Reply-To: (Christoph Buck's message of "Wed, 13 Nov 2024 16:33:56 +0100") References: Date: Wed, 18 Dec 2024 11:28:31 +0100 Message-ID: <87wmfxmgj4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74343-done Cc: 74343-done@debbugs.gnu.org, Ricardo Wurmus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Christoph Buck skribis: > * gnu/packages/admin.scm (isc-dhcp): Fix cross compilation for arm32 > > Change-Id: I52a863d2cb44e81e26de3224a7c5f8c6d2420cc6 Finally applied, thanks for the fix and detailed analysis! ------------=_1734517743-11178-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Nov 2024 14:05:30 +0000 Received: from localhost ([127.0.0.1]:41330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBDzt-0000Qf-FA for submit@debbugs.gnu.org; Wed, 13 Nov 2024 09:05:30 -0500 Received: from lists.gnu.org ([209.51.188.17]:44634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBCW5-0004eZ-UE for submit@debbugs.gnu.org; Wed, 13 Nov 2024 07:30:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBCW4-0000zz-Uh for guix-patches@gnu.org; Wed, 13 Nov 2024 07:30:37 -0500 Received: from mail-108-mta81.mxroute.com ([136.175.108.81]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBCW2-0002CR-1S for guix-patches@gnu.org; Wed, 13 Nov 2024 07:30:36 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta81.mxroute.com (ZoneMTA) with ESMTPSA id 1932580ec820003e01.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 13 Nov 2024 12:30:26 +0000 X-Zone-Loop: 0d23d1f0b1c83d64380c7ee00cb0a66c624cf861691b X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=icepic.de; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To: From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=kQE+AkEfjVSzWkLHInrMm28pRgLe4Z4JcJQLEtkY9fQ=; b=R b5CK8ZnUxL2h5xzUXVVfcYTo8su029CJ+DQp5MsPhlT6UZMu3PpMwlY0r+W63zmOm0EMUqySDJtMS avtSLp2UWlcwa8As26y+et+ChDZ6zkuwLmg5hm4tg941jFWlPlT6DPROLFsbGXiMqBLh6mdYbAvf9 nSD0yunyI88JQ0n2+j4BU97E6KlL3Ywc7DGnRSzC780A0GNgQdiXdO3rBtYJHAeKoEftewInWqRmr zT/RqyInbdkCgbZj6btlS6VatMIzIsoklfaTvATR6YnEamiSAv1B6Oc6oewjvv6oQ/lFX7pwuQzYV HaM0paZpxj7cedpaPMI0ZU4YdNlJbvzyg==; From: Christoph Buck To: guix-patches@gnu.org Subject: [PATCH 0/1] Fix cross-compilation for isc-dhcp Date: Wed, 13 Nov 2024 13:30:09 +0100 Message-ID: MIME-Version: 1.0 X-Debbugs-Cc: Ricardo Wurmus Content-Transfer-Encoding: 8bit X-Authenticated-Id: dev@icepic.de Received-SPF: pass client-ip=136.175.108.81; envelope-from=dev@icepic.de; helo=mail-108-mta81.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 13 Nov 2024 09:05:26 -0500 Cc: Christoph Buck X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi! Cross-compiling isc-dhcp from x64 to arm32 is broken as you can see below (output shortend to include only the relevant information) --8<---------------cut here---------------start------------->8--- icepic@G16-Buck ~/guix/src/guix [env]$ ./pre-inst-env guix describe Git checkout: repository: /home/icepic/guix/src/guix/ branch: master commit: b10ce47d8be5b6c15987f4e1d93b3bd71b1eb220 ./pre-inst-env guix build --target=arm-linux-gnueabihf isc-dhcp -K [...] phase `post-configure' succeeded after 0.5 seconds starting phase `patch-generated-file-shebangs' patch-shebang: ./bind/bind-9.11.37/contrib/dnsperf-2.1.0.0-1/contrib/queryparse/queryparse: warning: no binary for interpreter `python' found in $PATH phase `patch-generated-file-shebangs' succeeded after 0.1 seconds starting phase `update-config-scripts-for-bind' phase `update-config-scripts-for-bind' succeeded after 0.0 seconds starting phase `build' Making all in ./bind make[1]: Entering directory '/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind' /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37 already unpacked... Configuring BIND libraries for DHCP. Building BIND libraries - this takes some time. Building isc library in /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/isc /gnu/store/ylgkrq9j1gyfig2y66srmgsbyh9w20d9-binutils-2.41/bin/ar: `u' modifier ignored since `D' is the default (see `U') /gnu/store/ylgkrq9j1gyfig2y66srmgsbyh9w20d9-binutils-2.41/bin/ar: `u' modifier ignored since `D' is the default (see `U') Building dns library in /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns make[3]: *** [Makefile:601: include/dns/enumtype.h] Error 1 make[2]: *** [Makefile:595: include] Error 2 Building isccfg library in /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/isccfg In file included from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/isccfg/include/isccfg/aclconf.h:24, from aclconf.c:24: /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/types.h:230:10: fatal error: dns/enumtype.h: No such file or directory 230 | #include /* Provides dns_rdatatype_t. */ | ^~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:239: aclconf.o] Error 1 Building irs library in /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/irs In file included from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/tsig.h:28, from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/client.h:45, from context.c:28: /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/types.h:230:10: fatal error: dns/enumtype.h: No such file or directory 230 | #include /* Provides dns_rdatatype_t. */ | ^~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:237: context.o] Error 1 Installing BIND libraries to /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind. mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/include mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/include/isc mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/include/pk11 mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/include/pkcs11 mkdir /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/lib make[3]: *** [Makefile:601: include/dns/enumtype.h] Error 1 make[2]: *** [Makefile:595: include] Error 2 In file included from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/isccfg/include/isccfg/aclconf.h:24, from aclconf.c:24: /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/types.h:230:10: fatal error: dns/enumtype.h: No such file or directory 230 | #include /* Provides dns_rdatatype_t. */ | ^~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:239: aclconf.o] Error 1 In file included from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/tsig.h:28, from /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/client.h:45, from context.c:28: /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/include/dns/types.h:230:10: fatal error: dns/enumtype.h: No such file or directory 230 | #include /* Provides dns_rdatatype_t. */ | ^~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:237: context.o] Error 1 make[1]: *** [Makefile:77: bind2] Error 2 make[1]: Leaving directory '/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1/bind' make: *** [Makefile:463: all-recursive] Error 1 error: in phase 'build': uncaught exception: %exception #<&invoke-error program: "make" arguments: () exit-status: 2 term-signal: #f stop-signal: #f> phase `build' failed after 14.3 seconds command "make" failed with status 2 build process 18 exited with status 256 note: keeping build directory `/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0' builder for `/gnu/store/havk5qmkfa6vz9f7vw794vp3n49fx21a-isc-dhcp-4.4.3-P1.drv' failed with exit code 1 --8<---------------cut here---------------end--------------->8--- >From what i understand the following goes wrong. During compilation of the `isc-dhcp` package, the package `bind` is also build. `isc-dhcp` includes the bind source tree but guix replaces it with a more recent version. During the build process of `bind`, which is triggered from `isc-dhcp` an executable named `gen` (see `lib/dns`) is compiled and executed to generate the `dns/enumtype.h` header. Execution on `gen` during cross-compilation however fails, because `gen` was cross-compiled and not build for the host system where it is executed. --8<---------------cut here---------------start------------->8--- icepic@G16-Buck:~$ file /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-1/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/gen /tmp/guix-build-isc-dhcp-4.4.3-P1.drv-1/dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/gen: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /gnu/store/yxbip29ib6rf69pfpqsxpi8wvslm1gng-glibc-cross-arm-linux-gnueabihf-2.39/lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped icepic@G16-Buck:~$ --8<---------------cut here---------------end--------------->8--- According to the documentation setting the `BUILD_CC` variable to the native compiler should prevent this error, and indeed guilx sets this variable in the build process. But this variable is ignored by the `configure` script of bind. --8<---------------cut here---------------start------------->8--- icepic@G16-Buck:/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-1$ source environment-variables icepic@G16-Buck:/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1$ printenv | grep BUILD_CC BUILD_CC=gcc icepic@G16-Buck:/tmp/guix-build-isc-dhcp-4.4.3-P1.drv-0/dhcp-4.4.3-P1$ cat dhcp-4.4.3-P1/bind/bind-9.11.37/lib/dns/Makefile | grep BUILD_CC BUILD_CC = arm-linux-gnueabihf-gcc ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \ --8<---------------cut here---------------end--------------->8--- Configure of bind is called with the following paramters: --8<---------------cut here---------------start------------->8--- $ ./configure CONFIG_SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/sh SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/sh --without-openssl --without-libxml2 --without-libjson --without-gssapi --disable-threads --without-lmdb --includedir=/gnu/store/qfndmj9gi31qbzl7f9b00pcylnah4pf2-isc-dhcp-4.4.3-P1/include --libdir=/gnu/store/qfndmj9gi31qbzl7f9b00pcylnah4pf2-isc-dhcp-4.4.3-P1/lib --without-python --disable-kqueue --disable-epoll --disable-devpoll --host=arm-linux-gnueabihf CC_FOR_BUILD=gcc CONFIG_SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash --with-randomdev=/dev/random --enable-full-report --8<---------------cut here---------------end--------------->8--- If you look closely, you can see that parameter `--host` is set to `arm-linux-gnueabihf` but `--build` is missing. A quick look in the configure script of bind reveals, that `BUILD_CC` is only propagated from the env, if we are in a cross-compiling context : --8<---------------cut here---------------start------------->8--- if test "yes" = "$cross_compiling"; then if test -z "$BUILD_CC"; then as_fn_error $? "BUILD_CC not set" "$LINENO" 5 fi BUILD_CFLAGS="$BUILD_CFLAGS" BUILD_CPPFLAGS="$BUILD_CPPFLAGS" BUILD_LDFLAGS="$BUILD_LDFLAGS" BUILD_LIBS="$BUILD_LIBS" else BUILD_CC="$CC" BUILD_CFLAGS="$CFLAGS" BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG" BUILD_LDFLAGS="$LDFLAGS" BUILD_LIBS="$LIBS" fi --8<---------------cut here---------------end--------------->8--- And finally if we are in a cross compiled context is checked by --8<---------------cut here---------------start------------->8--- # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi --8<---------------cut here---------------end--------------->8--- in the configure script of `bind`. Since we don't have explicitly set the `--build` parameter of the configure script, i suspect this test fails and the `BUILD_CC` variable from the environment is not picked up. One can test this quickly, by extending the the `--build` parameter in the package description in admin.scm, namely --8<---------------cut here---------------start------------->8--- (lambda _ (substitute* "configure" (("--host=\\$host") "--host=$host_alias --build=$build_alias")) ;; BIND needs a native compiler because the DHCP ;; build system uses the built 'gen' executable. (setenv "BUILD_CC" "gcc") ;; powerpc-linux needs to be told to use -latomic. ,@(if (target-ppc32?) `((setenv "LIBS" "-latomic")) '())))) --8<---------------cut here---------------end--------------->8--- And indeed, building this package description seems to fix the problem. One thing however is suspicious. Why did cross compilation for aarch64 work? I didn't figure this out. However, the following patch should fix this issue for arm32 and aarch64 crossbuild still works. Christoph Buck (1): gnu: isc-dhcp: Fix cross compilation for arm32 gnu/packages/admin.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 1f057603ef59c7b9c32f610a897321fd75dc4dad -- 2.46.0 ------------=_1734517743-11178-1--