From unknown Sat Jun 21 10:42:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#72751 <72751@debbugs.gnu.org> To: bug#72751 <72751@debbugs.gnu.org> Subject: Status: [PATCH 0/2] Rework cmake cross compiling. Reply-To: bug#72751 <72751@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:42:01 +0000 retitle 72751 [PATCH 0/2] Rework cmake cross compiling. reassign 72751 guix-patches submitter 72751 Dariqq severity 72751 normal tag 72751 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 21 14:09:41 2024 Received: (at submit) by debbugs.gnu.org; 21 Aug 2024 18:09:41 +0000 Received: from localhost ([127.0.0.1]:36306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgpm8-0003UW-KA for submit@debbugs.gnu.org; Wed, 21 Aug 2024 14:09:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:54136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgpm6-0003UO-Aw for submit@debbugs.gnu.org; Wed, 21 Aug 2024 14:09:39 -0400 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 1sgplM-0006tR-Kx for guix-patches@gnu.org; Wed, 21 Aug 2024 14:08:53 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgplK-0002c9-3m for guix-patches@gnu.org; Wed, 21 Aug 2024 14:08:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BCC17240028 for ; Wed, 21 Aug 2024 20:08:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1724263723; bh=OVvGrwJQgDIG7lLhcWd1xYCRpxg6+pC8w7qh3XMOQuc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=V+U45ijoGS0nXnY30WciGttZgg0K3aVleyXWiGXUue8oxdbjtaCnS001jZ2gf1qIn OdLl0/+Qh2hKChPKAPcuW+84AqM3DJDBYV3bfr3dEIlCoDLPMmgNM++CRgh++tpvTe aU2Bm++V/PkBHSfIAdVGXIx0O9Di265jv7ObGyLlgWiyy2UAzNJvjCRSTHC95JJH1/ nSr8akCSJ4tGLklFWUeLwa0IkeqUh2Mjog1OUer+AD51JG4vOfzrr4ZlBDnnSOYFDu XOZdUwpWN0AoVd5vv0Id6zLXMqnBV+1CsMmHf1yVHlmZYma/ejgdXfDyHruHZ6VbNL ZR0YDWNBLH6dQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WpvTk6f5Jz6tsg; Wed, 21 Aug 2024 20:08:42 +0200 (CEST) From: Dariqq To: guix-patches@gnu.org Subject: [PATCH 0/2] Rework cmake cross compiling. Date: Wed, 21 Aug 2024 18:05:44 +0000 Message-ID: MIME-Version: 1.0 X-Debbugs-Cc: Efraim Flashner , Vagrant Cascadian Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.67.36.65; envelope-from=dariqq@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Dariqq 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.3 (--) Hi, This is an attempt to move the cross compile logic out of the build side. This should fix https://issues.guix.gnu.org/72697 and technically supersedes https://issues.guix.gnu.org/68366 . Also cleans up after https://issues.guix.gnu.org/69476 by removing the need for CMAKE_SYSTEM_NAME override. Main benefit is that this decouples the cmake native compilation and cmake cross compilation, i.e. if a new target needs a new CMAKE_SYSTEM_NAME we don't need to touch build code to enable it and thus don't need to rebuild everything natively for something only affecting cross building. Also use the target-*? functions and c*-for-target instead of reimplementing them in build code. The new cmake-system-name-for-target (a bit long, idk) now also supports hurd and bare-metal targets. I have tested this with the package i had troubles in #72697, and also verified that the ath9k firmware hashes are unchanged. Output of guix hash: /gnu/store/0r075s8g9pr9i6yd3pvwfjl2g4mkm7s8-ath9k-htc-ar9271-firmware-1.4.0/lib/firmware/htc_9271.fw 0bi0m4y1g8i47mal4m11pry88kjqqyk2209hw5yj2awngp31qj55 /gnu/store/msjnrh864a2c8k44hvwqs6fra7c7bb6v-ath9k-htc-ar7010-firmware-1.4.0/lib/firmware/htc_7010.fw 01hl01gv66k8g5avw85fbfyzblsy1ccmv64wq7g3zbgdwcb4ry7f Unfortunely this will cause a lot of rebuilds (but this will be hopefully easier in the future). Dariqq (2): guix: build-system: cmake: Rework cross compilation. gnu: ath9k-firmware: Remove CMAKE_SYSTEM_NAME override. gnu/packages/firmware.scm | 6 ++---- guix/build-system/cmake.scm | 19 ++++++++++++++++++- guix/build/cmake-build-system.scm | 11 ----------- 3 files changed, 20 insertions(+), 16 deletions(-) base-commit: 7a149c6003d25e8b2794b113d34062be134d7710 -- 2.45.2 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 21 14:36:38 2024 Received: (at 72751) by debbugs.gnu.org; 21 Aug 2024 18:36:38 +0000 Received: from localhost ([127.0.0.1]:36337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgqCE-0004FI-8i for submit@debbugs.gnu.org; Wed, 21 Aug 2024 14:36:38 -0400 Received: from mout02.posteo.de ([185.67.36.66]:48143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgqCC-0004F3-4S for 72751@debbugs.gnu.org; Wed, 21 Aug 2024 14:36:37 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 06829240104 for <72751@debbugs.gnu.org>; Wed, 21 Aug 2024 20:35:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1724265344; bh=WX7cW35EV/kx+3dIsleRe86Mp+Ctj5mQc/+OoFaOdfM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=kyBLL4gcdfhqwCMcckR2pDRlEbCRuwy14Us1Ojenf6CJ0QXUc4fGo0IAfmUDZdnbq XOThMv3IkXkRYqYE37/hXwuGVqtrBOCLzMHis7uI0OI3EXpyM3hbAFn7T86fM1NB7r Ix1NFZdMUMI8yc0kFtbaTRs+XYENXgea0QJWJCx8Y1U4b5m+2ilhjjozMcIJQIIpJ3 2MFFZVmwaNcgnrx4WhFWQCqsajruMGq8QYxdIxgDY/efXJbhbdiLhyY9tnJMoZ1bOu 5/VwfYqEZJFU67fzCnKGpwRlYZZxlTaCdLvj9YpbB5IJh/Ymv0bwGLY5PwX3HLyZ3+ D7HlgcDu6qNBg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wpw4v3zq4z9rxD; Wed, 21 Aug 2024 20:35:43 +0200 (CEST) From: Dariqq To: 72751@debbugs.gnu.org Subject: [PATCH 1/2] guix: build-system: cmake: Rework cross compilation. Date: Wed, 21 Aug 2024 18:34:50 +0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72751 Cc: Dariqq 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 (---) Move the extra configure flags for cross building out from the build side code and instead prepend them to the configure-flags. Use new procedure cmake-system-name-for-target to add support for hurd and bare-metal targets. * guix/build/cmake-build-system.scm (configure): Move cross build flags from here ... * guix/build-system/cmake.scm (cmake-cross-build): ... to here. (cmake-system-name-for-target): New procedure. Change-Id: Ic68acc246e543491ed147e53d47cec5de46b82cb --- guix/build-system/cmake.scm | 19 ++++++++++++++++++- guix/build/cmake-build-system.scm | 11 ----------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm index aa187c9844..fd32548342 100644 --- a/guix/build-system/cmake.scm +++ b/guix/build-system/cmake.scm @@ -39,6 +39,15 @@ (define-module (guix build-system cmake) ;; ;; Code: +(define* (cmake-system-name-for-target + #:optional (target (or (%current-target-system) + (%current-system)))) + (cond ((target-hurd? target) "GNU") + ((target-linux? target) "Linux") + ((target-mingw? target) "Windows") + ;; For avr, or1k-elf, xtensa-ath9k-elf + (else "Generic"))) + (define %cmake-build-system-modules ;; Build-side modules imported by default. `((guix build cmake-build-system) @@ -228,7 +237,15 @@ (define* (cmake-cross-build name search-path-specification->sexp native-search-paths) #:phases #$phases - #:configure-flags #$configure-flags + #:configure-flags `(#$(string-append "-DCMAKE_C_COMPILER=" + (cc-for-target target)) + #$(string-append "-DCMAKE_CXX_COMPILER=" + (cxx-for-target target)) + #$(string-append "-DCMAKE_SYSTEM_NAME=" + (cmake-system-name-for-target target)) + ,@#$(if (pair? configure-flags) + (sexp->gexp configure-flags) + configure-flags)) #:make-flags #$make-flags #:out-of-source? #$out-of-source? #:build-type #$build-type diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index d1ff5071be..61033061c6 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -62,17 +62,6 @@ (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) ,(string-append "-DCMAKE_INSTALL_RPATH=" out "/lib") ;; enable verbose output from builds "-DCMAKE_VERBOSE_MAKEFILE=ON" - - ;; Cross-build - ,@(if target - (list (string-append "-DCMAKE_C_COMPILER=" - target "-gcc") - (string-append "-DCMAKE_CXX_COMPILER=" - target "-g++") - (if (string-contains target "mingw") - "-DCMAKE_SYSTEM_NAME=Windows" - "-DCMAKE_SYSTEM_NAME=Linux")) - '()) ,@configure-flags))) (format #t "running 'cmake' with arguments ~s~%" args) (apply invoke "cmake" args)))) -- 2.45.2 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 21 14:36:43 2024 Received: (at 72751) by debbugs.gnu.org; 21 Aug 2024 18:36:43 +0000 Received: from localhost ([127.0.0.1]:36341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgqCI-0004Fb-MX for submit@debbugs.gnu.org; Wed, 21 Aug 2024 14:36:42 -0400 Received: from mout02.posteo.de ([185.67.36.66]:56085) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgqCG-0004FA-BN for 72751@debbugs.gnu.org; Wed, 21 Aug 2024 14:36:40 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 049C5240105 for <72751@debbugs.gnu.org>; Wed, 21 Aug 2024 20:35:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1724265350; bh=zjkti7Ho2ovZwsFPw9pFfg+LPdGo3Q8hOnM4LbqmkSg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=OgKb/yYqYq+48ew3ZGiX0sqIuKL4B6LSKK/6r58lyWdgOJVoYjc27u8EJcYfyBZ1+ 2qxOp7yJ8usdnHY9exGDV3u9aOY0DKzhimzwmqhH6fZMPz8Xco4GdS30pgYXCool5u 5QVuiAKHDLOvhTDwXR8/dracNy+dM4MotuxYlu94fwQl8BDpews0pLWRbRgFL5N3Tb sNXaqQXDQINTYEDXit0qAUtVVijc/yQ7CPJSPcabAXlNtze0dpuwTaviumIkFLGI+N wignXqM5MfCGMOsEJwtjGduQ5AfAIWLYvUSq0IYS+mGxp+XvVisIlu9oBOIi9uEPY3 ny0V+PI39QUdQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wpw514QZwz9rxF; Wed, 21 Aug 2024 20:35:49 +0200 (CEST) From: Dariqq To: 72751@debbugs.gnu.org Subject: [PATCH 2/2] gnu: ath9k-firmware: Remove CMAKE_SYSTEM_NAME override. Date: Wed, 21 Aug 2024 18:34:51 +0000 Message-ID: <379e18b5db626a2600cacc70615dbd308c73d29a.1724262137.git.dariqq@posteo.net> In-Reply-To: References: MIME-Version: 1.0 X-Debbugs-Cc: Efraim Flashner , Vagrant Cascadian Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72751 Cc: Dariqq 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 (---) * gnu/packages/firmware.scm (ath9k-htc-ar7010-firmware)[#:configure-flags]: Remove CMAKE_SYSTEM_NAME. (ath9k-htc-ar9271-firmware)[#:configure-flags]: Same. Change-Id: I87acb0aa781d104be511b1f368d9332c61d71627 --- gnu/packages/firmware.scm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 4348612567..183e25661d 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -116,8 +116,7 @@ (define-public ath9k-htc-ar7010-firmware (list #:target "xtensa-ath9k-elf" #:tests? #f #:configure-flags - #~'("-DCMAKE_SYSTEM_NAME=Generic" ;override default value - "-DTARGET_MAGPIE=ON") + #~'("-DTARGET_MAGPIE=ON") #:phases #~(modify-phases %standard-phases (add-before 'configure 'change-directory @@ -145,8 +144,7 @@ (define-public ath9k-htc-ar9271-firmware (substitute-keyword-arguments (package-arguments ath9k-htc-ar7010-firmware) ((#:configure-flags flags) - #~'("-DCMAKE_SYSTEM_NAME=Generic" ;override default value - "-DTARGET_K2=ON")))) + #~'("-DTARGET_K2=ON")))) (synopsis "Firmware for the Atheros AR9271 USB 802.11n NICs") (description "This is the firmware for the Qualcomm Atheros AR9271 802.11n USB NICs -- 2.45.2 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 14 08:17:06 2025 Received: (at 72751-done) by debbugs.gnu.org; 14 Jan 2025 13:17:06 +0000 Received: from localhost ([127.0.0.1]:54192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tXgn3-0005I6-Uc for submit@debbugs.gnu.org; Tue, 14 Jan 2025 08:17:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42362) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tXgml-0005Gk-A7 for 72751-done@debbugs.gnu.org; Tue, 14 Jan 2025 08:16:47 -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 1tXgme-0003G7-Pa; Tue, 14 Jan 2025 08:16:40 -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=SJd74lOV1jN322T87dfFW99SMZQFkKla7wojIACil8c=; b=deTQ5zgUBmgnj0b/ULvB GnDp4UeFxtoGWBVz0ydhagLWZqqxoy31+JJQeXmNEOgN1pcQNcbOevTXLg4NSlToC7K+ASuYdU/bv s+IWWcPC8lSjLnFakVXI/6xqxaq7i7VnNt3R+ILnMsLDmpzJFdEkEtG5n5/qixuZqYbTUsOncVbio bKOcbx23OpbDUPFCOU9/h7lzOLhXMcqkZ7x4I7GzFK99rp6GUGlzZv+XjZhuR7GrxzRHyZc8EeQfW VTVIflC8l2AgJpnR+C2FbyUMPIqWg97Pwl/C3rbGrk7lb0tHfJTzY7CgcQHU/fvDOOzSgmaWwcXxX VPPDUSKJdD3JgA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Dariqq Subject: Re: [bug#72751] [PATCH 0/2] Rework cmake cross compiling. In-Reply-To: (dariqq@posteo.net's message of "Wed, 21 Aug 2024 18:05:44 +0000") References: Date: Tue, 14 Jan 2025 14:16:37 +0100 Message-ID: <87tta18rii.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72751-done Cc: Vagrant Cascadian , 72751-done@debbugs.gnu.org, Efraim Flashner 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 (---) Finally pushed: d804997897 * gnu: ath9k-firmware: Remove CMAKE_SYSTEM_NAME override. ad672d80d7 * build-system: cmake: Rework cross compilation. Thanks, Dariqq! Ludo=E2=80=99. From unknown Sat Jun 21 10:42:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 12 Feb 2025 12:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator