From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iAk8GViFSmCEXwAA0tVLHw (envelope-from ) for ; Thu, 11 Mar 2021 21:02:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 2I4LFViFSmDAewAA1q6Kng (envelope-from ) for ; Thu, 11 Mar 2021 21:02:16 +0000 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 01BD510E0B for ; Thu, 11 Mar 2021 22:02:16 +0100 (CET) Received: from localhost ([::1]:56648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKSRi-0003lw-Tg for larch@yhetil.org; Thu, 11 Mar 2021 16:02:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKSRX-0003kJ-Ly for guix-patches@gnu.org; Thu, 11 Mar 2021 16:02:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKSRW-0001aT-VI for guix-patches@gnu.org; Thu, 11 Mar 2021 16:02:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lKSRW-00042q-Ta for guix-patches@gnu.org; Thu, 11 Mar 2021 16:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46725] [PATCH] gnu: guile-lib: Fix cross compilation. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Mar 2021 21:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46725 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 46725-done@debbugs.gnu.org Received: via spool by 46725-done@debbugs.gnu.org id=D46725.161549652115533 (code D ref 46725); Thu, 11 Mar 2021 21:02:02 +0000 Received: (at 46725-done) by debbugs.gnu.org; 11 Mar 2021 21:02:01 +0000 Received: from localhost ([127.0.0.1]:55018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKSRU-00042T-KP for submit@debbugs.gnu.org; Thu, 11 Mar 2021 16:02:00 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:42940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKSRQ-000422-HE for 46725-done@debbugs.gnu.org; Thu, 11 Mar 2021 16:01:59 -0500 Received: by mail-qv1-f49.google.com with SMTP id 30so3243994qva.9 for <46725-done@debbugs.gnu.org>; Thu, 11 Mar 2021 13:01:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=omSOh8DusFMymk7CdEur2mLi4vHIoCq6DZ+DXuuN/FA=; b=eAgnGzxAJ7QDixDAKJyhltSTN1zTdmZk7EuGttB6WkwTJm28i8naWrw/YmIn3jXXoR mQctCKg3YgUl9hTfQ/5GoZ0lG7YYLwbZXFLOtqd1xeTs8lOCzrBb0vS1+dtbuo/AjAoZ KszjLGh+DonkWArrIUmva30/nzPFhxKrwleRwjE82cjRjSMaoLUOwYmXxuv2NHaAfiOa 7gkS00j2JSW6QaFKnhOZ32GU0BQQhmMW+RLF7AIiMJVV0i11bfjXJy1slUVM6v72jL8z u8cpRhFBPqvxSyB2f19L6ywdYe9SiQ4LlsvUEBM0GNp5SUQwN8z3grtMKd/b5AMYP1Nm chnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=omSOh8DusFMymk7CdEur2mLi4vHIoCq6DZ+DXuuN/FA=; b=WceFr0MhVz7HvhpfClg45eHmK1sCBIcmw4k6d6q7OUjlT+R7sfin/Lu5YhelhRcKN6 e897LZCgtYykyqn5TCaeFas2TEyU59iZNlAXZFaFQG4/k9FjbPHvaDk5VQcDGpg7WWG3 xOFqQgSgcqeE1d00yPYu0iX3Tq+UP3j0cKAitpmR1YlsJwEPxNWk8BQZMHjZlu3Ph7Ej Zl7gk2SCnbyEm5TWoQVezTsAACfxzGg1YGBceGwAbQO11yVSf8dWa4fbp0XRR4lWz6D0 jsZXq5tiE/eSLz3DirYSCzpvWObNwJCmqk5Avj+ODAVihoKggkVsi2ZDq/RkP96mAepb cnEg== X-Gm-Message-State: AOAM530AwLuNlCwDL4GKNe1zkmgswvu1J0Ht0mG8b58PwlkbRLM7qfEf olBnYBAmil6l0KekZX0gIJGyCkWDZrzlCQ== X-Google-Smtp-Source: ABdhPJzbpR6L+KbKar1rsLVpgU2vxxg8Ip+QWioM/4Hz3MtINXRcBUZ880CF6Whts0Bpqg5VOiulsQ== X-Received: by 2002:a0c:a404:: with SMTP id w4mr9468119qvw.45.1615496510857; Thu, 11 Mar 2021 13:01:50 -0800 (PST) Received: from hurd (dsl-10-135-21.b2b2c.ca. [72.10.135.21]) by smtp.gmail.com with ESMTPSA id b17sm1243526qtp.73.2021.03.11.13.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 13:01:50 -0800 (PST) From: Maxim Cournoyer References: <20210223200755.29532-1-mail@cbaines.net> <20210224083709.9342-1-mail@cbaines.net> <87v9a9uzub.fsf_-_@gnu.org> <87zgzjoy7y.fsf_-_@gmail.com> <874khld8to.fsf@gnu.org> <87k0qhb8jt.fsf@cbaines.net> Date: Thu, 11 Mar 2021 16:01:49 -0500 In-Reply-To: <87k0qhb8jt.fsf@cbaines.net> (Christopher Baines's message of "Mon, 08 Mar 2021 22:11:02 +0000") Message-ID: <87wnudtneq.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615496536; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=omSOh8DusFMymk7CdEur2mLi4vHIoCq6DZ+DXuuN/FA=; b=Od3F8ssH6kuS2kZEhlsRunNT/S9YaxrBfMrRPYOhgpoqeK2U8nOamR6PvcT3rroV1H2jav FOjEL5IpV4LoWR97JrtaKqC3XcNYRLmuulmNFQmrV5/pA9urYdj1cGaUPIkZ8IyaKmOH6a bYtxhkr9Wh6i/ia3QGgHx8xz05WCR5qw9/owZ40np2igi1ztCmsR5fgrvKe7HgEXDvwkMJ w88wlAB4PLZmrkHZOfsTEHtk8it8dVx/ubUS+0lXxjoqlUELbj447YS6Z/1H9lw5Q26P8q nnYYrJlclWnXAzpu13ijfAskxz5IJNdf8lXE8MytBtUOBgENuE3q8FcF1fhI/w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615496536; a=rsa-sha256; cv=none; b=R388G4jlqhZldqAx9CX3Iu+89g/JP8vS2PYzNv6qOREeht1QUB7fUIZH+OnK1vXkHrlefD PvEVY4GwAIGnjhATKzy9xMj4aBkLx2szC43tZdRnNGM+mt5bLTnvvmDH9cMZjnD4859KYI UET7Hpjq3vBm3nO0xROkVScceJVjT3ew8qzviTfqZ4GStviIjUAlyJPBFG7Tn/TC36ZFpz wc+5chEzpf4FkRsbE88ttkHVz1RiEKLg/HMccmiaO5hnJV8AUCFU0lyTULTg+vZXrh9Tnd z0mDIG/t5QeeZ74jNK/SyuJ8npL20eH3+Pp9tDuPhS5GPE0p0Ig77T4n6wF8CA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=eAgnGzxA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.29 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=eAgnGzxA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 01BD510E0B X-Spam-Score: -1.29 X-Migadu-Scanner: scn0.migadu.com X-TUID: estFV9tE4hYX Hi Chris, Christopher Baines writes: > Ludovic Court=C3=A8s writes: > >> Hi, >> >> Maxim Cournoyer skribis: >> >>> Ludovic Court=C3=A8s writes: >>> >>>> Hi! >>>> >>>> Christopher Baines skribis: >>>> >>>>> These changes were sent upstream as >>>>> https://lists.gnu.org/archive/html/guile-devel/2021-02/msg00004.html >>>>> >>>>> Without this change, the .go files are built for the host architectur= e, rather >>>>> than the target. I noticed this when cross building the >>>>> guix-build-coordinator (for which guile-lib is an input) to the Hurd. >>>>> >>>>> * gnu/packages/guile-xyz.scm (guile-lib)[arguments]: Add >>>>> 'patch-for-cross-compilation phase. >>>>> [native-inputs]: Add autoconf, automake and gettext. >>>>> (guile2.0-lib): Adjust to use alist-replace. >>>>> (guile2.2-lib): Adjust to use alist-replace. >>>> >>>> [...] >>>> >>>>> + (substitute* "configure.ac" >>>>> + (("GUILE_FLAGS") >>>>> + "GUILE_FLAGS >>>>> +if test \"$cross_compiling\" !=3D no; then >>>>> + GUILE_TARGET=3D\"--target=3D$host_alias\" >>>>> + AC_SUBST([GUILE_TARGET]) >>>>> +fi >>>> >>>> You could even set =E2=80=98GUILE_TARGET=E2=80=99 unconditionally. >>> >>> It seems a conditional is needed, because info >>> '(autoconf)Canonicalizing' says: >>> >>> The variables =E2=80=98build_alias=E2=80=99, =E2=80=98host_alias=E2= =80=99, and =E2=80=98target_alias=E2=80=99 are >>> always exactly the arguments of =E2=80=98--build=E2=80=99, =E2=80= =98--host=E2=80=99, and =E2=80=98--target=E2=80=99; in >>> particular, they are left empty if the user did not use them, even = if >>> the corresponding =E2=80=98AC_CANONICAL=E2=80=99 macro was run. >>> >>> I.e. without the condition '--target=3D' could be passed to guild, which >>> probably wouldn't work. >> >> Ah true. In Guile-{Gcrypt,zlib,=E2=80=A6}, =E2=80=98--target=E2=80=99 i= s passed conditionally. >> Apologies for the confusion! >> >>> So it seems that nowadays the build, host, and target would take default >>> values as guessed by config.guess, and that the earlier section of the >>> manual should be updated? >> >> Dunno; but in hindsight, what Chris did seemed right. > > I don't really get the change I'm making, but I'm confident it has the > desired effect, I just copied it other Guile libraries. Anyway, I think > this is still useful, so I've gone ahead and pushed as > a0b24d5f8c5813329986b1bd690ed50b5308cc78. > > If there are better ways to get the cross compiling to work, then that > can be put in place upstream, and then these changes removed. > > Thanks, > > Chris FYI, I have sent to the Guile patches tracker commits (keeping original authorship) of all the Guix-specific changes to guile-lib; the version of your patch is slightly modified to test the value about to be used, but otherwise it behaves the same. Maxim