From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id qDIOOg8NUmb4iwAAqHPOHw:P1 (envelope-from ) for ; Sat, 25 May 2024 18:08:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id qDIOOg8NUmb4iwAAqHPOHw (envelope-from ) for ; Sat, 25 May 2024 18:08:48 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=icepic.de header.s=x header.b=SofX0FD2; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716653327; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=XSX/9KVTTVIYVmvhDMOuNUN7DsMIIOfMLcY573ML698=; b=Gx5fuJRu9HR3x30TjGEwkoUy21HqmIKhfTERBnfPyuplZP2o3q2/KgLyNKceIYByvB10o8 aPJO2ybT5tr2aOU8HINkC7GdXK7k2B6Tcj9nXKc76d7AN6YgWg2gX9tSMTETMKjmCPqv7x w5vudHeEqL/Rs87DumqGigP1vFToZ49TCtDfxpgCqq43poD9RP0LpOB4HAalrIl3UspmpE nz2BmJcNlKvCsUmXHITQDEtEaRgbnUZUxpDfx2aH3yELkqnI2ShWXpaTfQxjpqUr+l/Y+T zdgOy+kWg8wJmC4p1Ibgk1I44hyPPJZW5aCuDk9rEmxdTwWJRWY6sdaaUEjCbQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=icepic.de header.s=x header.b=SofX0FD2; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716653327; a=rsa-sha256; cv=none; b=HlTq/supZChbn/5YUE1bSjmoTTxbfQSfvXid3agsTmYZ3xViMHMmwP1q9JZmPPbz4a8lBJ J9CmNSZBCB0b988mI5vsdgQb3zr7kFYDtdz9RWk1wnPapD9wMU12+6ovCTO/mAvn2goeYz LcoicLTCvpAS8WuH0wUxv9BtQsBlHhpg0cNVBqkVQrIrkEc6cdvskan9Eg8HblSsbo8LiE iSTkmRvK5LXj3O3GcwKzI08CGs3xM5TJlIIe2jBXWi7O0lKkzOpvqhmJDSN5ZmGb8QwG7G 1qXgI6+Tmt73QerHaGFrOSsVKDt8r0G2tZJ2Othiq39/dLxtkynT8Owi8iTOGg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B480954415 for ; Sat, 25 May 2024 18:08:47 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAtwA-00061C-Tv; Sat, 25 May 2024 12:08:02 -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 1sAXPd-0007vd-9n for bug-guix@gnu.org; Fri, 24 May 2024 12:04:57 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAXPb-0004A4-TY for bug-guix@gnu.org; Fri, 24 May 2024 12:04:56 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sAXPi-0001Cz-Iv for bug-guix@gnu.org; Fri, 24 May 2024 12:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#71174: libb2 fails to build during cross-compilation Resent-From: Christoph Buck Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 24 May 2024 16:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71174 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 71174@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17165666874625 (code B ref -1); Fri, 24 May 2024 16:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 May 2024 16:04:47 +0000 Received: from localhost ([127.0.0.1]:37858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAXPS-0001CX-DV for submit@debbugs.gnu.org; Fri, 24 May 2024 12:04:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:52392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sAWs1-0000um-2B for submit@debbugs.gnu.org; Fri, 24 May 2024 11:30:13 -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 1sAWrs-0007QN-KK for bug-guix@gnu.org; Fri, 24 May 2024 11:30:04 -0400 Received: from mail-108-mta138.mxroute.com ([136.175.108.138]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAWrq-0006Qx-8W for bug-guix@gnu.org; Fri, 24 May 2024 11:30:04 -0400 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta138.mxroute.com (ZoneMTA) with ESMTPSA id 18fab3479c5000efce.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 24 May 2024 15:24:54 +0000 X-Zone-Loop: ea5c7cda501819e500dd163389aea144195adfe1f6cc 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-Type:MIME-Version:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding: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=XSX/9KVTTVIYVmvhDMOuNUN7DsMIIOfMLcY573ML698=; b=SofX0FD2KILz+AXiujyf/Kyead ZWPSNqY4M2QMUrv/wU3dMk/okIGGIGnVsLKrqYdYkC1/hqicjT+JhnPX3fUlpgGuQ2C6JDpvPcNzg guYK+qECH27J+HcYq+GCOfLEAdQZ2YUmCB8ep+SNJO67iFqIZqY7cUNU9aQ7xbNb6uugCzwtkSPm0 kVr2u5cQlZbM642lyxXIhmhIAvTqfECt1AsK4kKW+NVplYZ61GV8hAlyJaiFj3aShWsVVOqu5y91l bSaaZtcUlqStF1nq7096615/kLuLo2zrbTnCraJGZvUjaVm0V8S67zM8VCFhUDJ7LxswK/NdEHMsa RrjsozjA==; From: Christoph Buck User-Agent: mu4e 1.12.0; emacs 30.0.50 Date: Fri, 24 May 2024 17:24:50 +0200 Message-ID: <874jantepp.fsf@icepic.de> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: dev@icepic.de Received-SPF: pass client-ip=136.175.108.138; envelope-from=dev@icepic.de; helo=mail-108-mta138.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 24 May 2024 12:04:45 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 25 May 2024 12:07:46 -0400 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.55 X-Spam-Score: -1.55 X-Migadu-Queue-Id: B480954415 X-Migadu-Scanner: mx13.migadu.com X-TUID: IDrwub6UpI6v Hi! The package libb2 in `(gnu packages crypto)` fails during cross-compilation from `x86_64-linux-gn` to `aarch64-linux-gnu`, but possible more combinations are broken. Steps to reproduce: > git log --oneline HEAD^..HEAD > 9901416233 (origin/master, origin/HEAD) gnu: ctl: Update to 1.5.3. > ./pre-inst-env guix build libb2 --system=x86_64-linux > --target=aarch64-linux-gnu --no-substitutes --no-grafts > [...] > checking for objdir... .libs > checking if aarch64-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no > checking for aarch64-linux-gnu-gcc option to produce PIC... -fPIC -DPIC > checking if aarch64-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes > checking if aarch64-linux-gnu-gcc static flag -static works... yes > checking if aarch64-linux-gnu-gcc supports -c -o file.o... yes > checking if aarch64-linux-gnu-gcc supports -c -o file.o... (cached) yes > checking whether the aarch64-linux-gnu-gcc linker (/gnu/store/kh7kl57h5i3vzx9hbbairnkkgnx7kf61-gcc-cross-aarch64-linux-gnu-11.3.0/libexec/gcc/aarch64-linux-gnu/ld) supports shared libraries... yes > checking whether -lc should be explicitly linked in... no > checking dynamic linker characteristics... GNU/Linux ld.so > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... yes > checking whether C compiler accepts -O3... yes > checking whether C compiler accepts -msse2... no > configure: error: Compiler does not know -msse2. > error: in phase 'configure': uncaught exception: > %exception #<&invoke-error program: "/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" arguments: ("./configure" "CC_FOR_BUILD=gcc" "CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "--prefix=/gnu/store/5cy4lw70ilgwbrmav12xli0lyqzwvmk5-libb2-0.98.1" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" "--host=aarch64-linux-gnu" "--enable-fat" "--disable-native") exit-status: 1 term-signal: #f stop-signal: #f> > phase `configure' failed after 1.2 seconds > command "/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "./configure" "CC_FOR_BUILD=gcc" "CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash" "--prefix=/gnu/store/5cy4lw70ilgwbrmav12xli0lyqzwvmk5-libb2-0.98.1" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" "--host=aarch64-linux-gnu" "--enable-fat" "--disable-native" failed with status 1 > builder for `/gnu/store/rlhm80fld1h2xszn3yh7x5fvr295x6qh-libb2-0.98.1.drv' failed with exit code 1 > build of /gnu/store/rlhm80fld1h2xszn3yh7x5fvr295x6qh-libb2-0.98.1.drv failed > Could not find build log for '/gnu/store/rlhm80fld1h2xszn3yh7x5fvr295x6qh-libb2-0.98.1.drv'. > guix build: error: build of > `/gnu/store/rlhm80fld1h2xszn3yh7x5fvr295x6qh-libb2-0.98.1.drv' failed Root-cause: The `configure-flags` in the package definition of libb2 are broken for cross-compilation. > `(#:configure-flags > (list > ,@(if (any (cute string-prefix? <> (or (%current-system) > (%current-target-system))) > '("x86_64" "i686")) > ;; fat only checks for Intel optimisations > '("--enable-fat") > '()) > "--disable-native")) Shot-circuit evaluation of the `or` operator leads to enabling of `fat` as long as `%current-system` is set to `x86_64/i686` regardless of the value of `%current-target-system`. If `%current-target-system` is set for example to the `aarch64-linux-gnu` triplet, `--enable-fat` is added to the configure flags which in turn will break compilation. I am not entirley sure, what `enable-fat` does. From my understanding this flag enables fat binaries (or multiarchitecture binaries), which seems to require the `sse2` instruction set. The cross compile toolchain for aarch64-linux-gnu (and mostlikey other toolchains as well) does not support this instruction set. As a quick workaround, i came up with the following patch: > `(#:configure-flags > (list > ,@(let ((check-x86 (lambda (triplet) (any (cute string-prefix? <> triplet) '("x86_64" "i868"))))) > (if (%current-target-system) > (if (check-x86 (%current-target-system)) > '("--enable-fat") > '()) > (if (check-x86 (%current-system)) > '("--enable-fat") > '()))) > "--disable-native")) This enables fat binaries if the target system is set to `x86_64/i868` regardless of the value of `%current-system`. If the target system is not set, fat binaries are only enabled if the `%current-system` is set to `x86_64/i868`. Most likely there is a cleaner way to write this, but i am a total scheme newbee. If required, i can submit a real patch. Best regards Christoph