From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gOs4H4OadmI9xgAAbAwnHQ (envelope-from ) for ; Sat, 07 May 2022 18:12:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kMRLHoOadmKO4wAAG6o9tA (envelope-from ) for ; Sat, 07 May 2022 18:12:51 +0200 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 47D3F2AC52 for ; Sat, 7 May 2022 18:12:50 +0200 (CEST) Received: from localhost ([::1]:46366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnN33-00077o-9j for larch@yhetil.org; Sat, 07 May 2022 12:12:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnN2J-00068U-Sy for guix-patches@gnu.org; Sat, 07 May 2022 12:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnN2J-00038k-KQ for guix-patches@gnu.org; Sat, 07 May 2022 12:12:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnN2J-0006NV-GL for guix-patches@gnu.org; Sat, 07 May 2022 12:12:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55220] [PATCH v2 5/6] platform: Add glibc-dynamic-linker field. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 May 2022 16:12:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55220 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55220@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 55220-submit@debbugs.gnu.org id=B55220.165193991124456 (code B ref 55220); Sat, 07 May 2022 16:12:03 +0000 Received: (at 55220) by debbugs.gnu.org; 7 May 2022 16:11:51 +0000 Received: from localhost ([127.0.0.1]:52805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnN26-0006MG-SH for submit@debbugs.gnu.org; Sat, 07 May 2022 12:11:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnN22-0006L4-HQ for 55220@debbugs.gnu.org; Sat, 07 May 2022 12:11:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnN1x-00033f-9t for 55220@debbugs.gnu.org; Sat, 07 May 2022 12:11:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=iJ2hUUxT8dVix1N0+ohoD9UTEm2bdNNKZrFFXsOBfdw=; b=gpgbkUT76M5JlVcXDROv FVHE1/ekDzNQdRrHZ7CsBic1epLIRRZCChzS7gncO/fNxGHNnXQURNVvJa3fnnXxT56CffuQ106UH CAtdJoEV9c4MoVWw4nXnAoBO68Sy5EC3wosr1e1+gj77qkQvL87RjJg2mO3hNncLoBgpeuvFA60gU CIXLZbSsXdz7WSIF+wcXrdKqkWIzBG4XxYvNhIRNWxtC5yebxqRBPhWYYH0znuE5Q8CdKJ/oDWMrA x8mEoE7B+UxLB6+g+6EGb3Ya728u5/mDIeXw7qIXLBu/wqHFiSoaswXvynS3UmQgteDNBJje5K+++ Uxzf4Fhz0OBBBg==; Received: from 71.125.192.77.rev.sfr.net ([77.192.125.71]:40324 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnN1w-0004uM-Sv; Sat, 07 May 2022 12:11:41 -0400 From: Mathieu Othacehe Date: Sat, 7 May 2022 18:11:25 +0200 Message-Id: <20220507161126.14553-6-othacehe@gnu.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220507161126.14553-1-othacehe@gnu.org> References: <20220507161126.14553-1-othacehe@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651939970; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=pcbNia51/1+lW28iJcfQWKNzQCvQgFmco8GH1TZYxlM=; b=WkHXQEcI52d0m/JJLkibN6Pv65+ZRTN4hFucI+k9RqdpClq5QqljciPC0iBM/qJh+lRHE5 PYHskeS3QyceMFU4Z8ClVL/cfjz0YxXrMubM4RB2v1BionHMSu0wPIRtfpcBhBweNUxTIB ziUZdPPUPzc6p4kW66FCWjviVtvsnqghDm9wCNNnnbdP7cZFwz1ZjOFFiqH8IzE0b7ZZZ3 VYB4OByhSRa9mgfssUDoYqBJPO6U+bPvr815r333Bwgkn7ghjPpMqCoRZxrWLa5/BXQK6v 0w52vz0milYguSHTE27hNCS46aEYkcIWDbuD6y3GvPLBVAlQ6njj7ltH44yFQw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651939970; a=rsa-sha256; cv=none; b=XWjL4pZpgHqkm+9meDQfbTlfuCG0Ur13JAxRN0vbEvaEU/t4g65UT2yKlf1VTr8ALuow+w YVH9Z+QPjNzeyNoBh6qOSxSVd2I/z6COt2QY03r2yVcPgIt1XQ86ExFXRNn7ZOCXd6tvxF X9K7riNHhjfVvVI8VFHlYSceQSx+wQMrdCBynTygP41LwkwfFTUcbmPnDy4mETuQvVXCXv yGBbdea+eKx0a4I0Q8doF06cN/lCSBv8+/fnMIMXh9QZJ7ucYZJLzU/tSSMcHBm3jQry4/ gbufs7RNnjORpXcCkF/OU1WpL7rh0Oz0aq2QHgULiisfktx4Rvd3O6T9qLvmgQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=gpgbkUT7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=gpgbkUT7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 47D3F2AC52 X-Spam-Score: -2.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: uFAtURQsi4t9 * gnu/platform.scm ()[glibc-dynamic-linker]: New field. (platform-glibc-dynamic-linker, lookup-platform-by-system): New procedures. * gnu/platforms/arm.scm (armhf-linux, aarch64-linux): Add the glibc-dynamic-linker field. * gnu/platforms/hurd.scm (hurd): Ditto. * gnu/platforms/intel.scm (intel32-linux, intel64-linux, intel32-mingw, intel64-linux): Ditto. * gnu/platforms/mips.scm (mips64el-linux): Ditto. * gnu/platforms/powerpc.scm (powerpc-linux, powerpc64-linux): Ditto. * gnu/platforms/riscv.scm (riscv64-linux): Ditto. * gnu/platforms/s390.scm (riscv64-linux): Ditto. * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Adapt it. --- gnu/packages/bootstrap.scm | 47 ++++++++++++++++++-------------------- gnu/platform.scm | 14 ++++++++---- gnu/platforms/arm.scm | 6 +++-- gnu/platforms/hurd.scm | 3 ++- gnu/platforms/intel.scm | 12 ++++++---- gnu/platforms/mips.scm | 3 ++- gnu/platforms/powerpc.scm | 6 +++-- gnu/platforms/riscv.scm | 3 ++- gnu/platforms/s390.scm | 3 ++- 9 files changed, 56 insertions(+), 41 deletions(-) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 8bd0c4eaf3..5337617a53 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -26,6 +26,7 @@ (define-module (gnu packages bootstrap) #:use-module (guix licenses) #:use-module (gnu packages) + #:use-module (gnu platform) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system) @@ -314,33 +315,29 @@ (define* (glibc-dynamic-linker (%current-system)))) "Return the name of Glibc's dynamic linker for SYSTEM." ;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc. - (cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2") - ((string=? system "i686-linux") "/lib/ld-linux.so.2") - ((string=? system "armhf-linux") "/lib/ld-linux-armhf.so.3") - ((string=? system "mips64el-linux") "/lib/ld.so.1") - ((string=? system "i586-gnu") "/lib/ld.so.1") - ((string=? system "i686-gnu") "/lib/ld.so.1") - ((string=? system "aarch64-linux") "/lib/ld-linux-aarch64.so.1") - ((string=? system "powerpc-linux") "/lib/ld.so.1") - ((string=? system "powerpc64-linux") "/lib/ld64.so.1") - ((string=? system "powerpc64le-linux") "/lib/ld64.so.2") - ((string=? system "alpha-linux") "/lib/ld-linux.so.2") - ((string=? system "s390x-linux") "/lib/ld64.so.1") - ((string=? system "riscv64-linux") "/lib/ld-linux-riscv64-lp64d.so.1") + (let ((platform (lookup-platform-by-system system))) + (cond + ((platform? platform) + (platform-glibc-dynamic-linker platform)) - ;; XXX: This one is used bare-bones, without a libc, so add a case - ;; here just so we can keep going. - ((string=? system "arm-elf") "no-ld.so") - ((string=? system "arm-eabi") "no-ld.so") - ((string=? system "xtensa-elf") "no-ld.so") - ((string=? system "avr") "no-ld.so") - ((string=? system "propeller-elf") "no-ld.so") - ((string=? system "i686-mingw") "no-ld.so") - ((string=? system "x86_64-mingw") "no-ld.so") - ((string=? system "vc4-elf") "no-ld.so") + ;; TODO: Define those as platforms. + ((string=? system "i686-gnu") "/lib/ld.so.1") + ((string=? system "powerpc64-linux") "/lib/ld64.so.1") + ((string=? system "alpha-linux") "/lib/ld-linux.so.2") - (else (error "dynamic linker name not known for this system" - system)))) + ;; XXX: This one is used bare-bones, without a libc, so add a case + ;; here just so we can keep going. + ((string=? system "arm-elf") "no-ld.so") + ((string=? system "arm-eabi") "no-ld.so") + ((string=? system "xtensa-elf") "no-ld.so") + ((string=? system "avr") "no-ld.so") + ((string=? system "propeller-elf") "no-ld.so") + ((string=? system "i686-mingw") "no-ld.so") + ((string=? system "x86_64-mingw") "no-ld.so") + ((string=? system "vc4-elf") "no-ld.so") + + (else (error "dynamic linker name not known for this system" + system))))) ;;; diff --git a/gnu/platform.scm b/gnu/platform.scm index 4c5211e107..fdc3685e7c 100644 --- a/gnu/platform.scm +++ b/gnu/platform.scm @@ -27,6 +27,7 @@ (define-module (gnu platform) platform-target platform-system platform-linux-architecture + platform-glibc-dynamic-linker platform-modules platforms @@ -58,12 +59,17 @@ (define-module (gnu platform) ;; ;; The 'linux-architecture' is only relevant if the kernel is Linux. In that ;; case, it corresponds to the ARCH variable used when building Linux. +;; +;; The 'glibc-dynamic-linker' field is the name of Glibc's dynamic linker for +;; the corresponding system. (define-record-type* platform make-platform platform? - (target platform-target) ;"x86_64-linux-gnu" - (system platform-system) ;"x86_64-linux" - (linux-architecture platform-linux-architecture ;"x86" - (default #f))) + (target platform-target) + (system platform-system) + (linux-architecture platform-linux-architecture + (default #f)) + (glibc-dynamic-linker platform-glibc-dynamic-linker)) + ;;; ;;; Platforms. diff --git a/gnu/platforms/arm.scm b/gnu/platforms/arm.scm index 1e61741a35..bf68b2d00f 100644 --- a/gnu/platforms/arm.scm +++ b/gnu/platforms/arm.scm @@ -27,10 +27,12 @@ (define armv7-linux (platform (target "arm-linux-gnueabihf") (system "armhf-linux") - (linux-architecture "arm"))) + (linux-architecture "arm") + (glibc-dynamic-linker "/lib/ld-linux-armhf.so.3"))) (define aarch64-linux (platform (target "aarch64-linux-gnu") (system "aarch64-linux") - (linux-architecture "arm64"))) + (linux-architecture "arm64") + (glibc-dynamic-linker "/lib/ld-linux-aarch64.so.1"))) diff --git a/gnu/platforms/hurd.scm b/gnu/platforms/hurd.scm index 0e5c58fd08..328e9818ad 100644 --- a/gnu/platforms/hurd.scm +++ b/gnu/platforms/hurd.scm @@ -25,4 +25,5 @@ (define-module (gnu platforms hurd) (define hurd (platform (target "i586-pc-gnu") - (system "i586-gnu"))) + (system "i586-gnu") + (glibc-dynamic-linker "/lib/ld.so.1"))) diff --git a/gnu/platforms/intel.scm b/gnu/platforms/intel.scm index ee9fe003a7..5b58d953ae 100644 --- a/gnu/platforms/intel.scm +++ b/gnu/platforms/intel.scm @@ -29,20 +29,24 @@ (define intel32-linux (platform (target "i686-linux-gnu") (system "i686-linux") - (linux-architecture "i386"))) + (linux-architecture "i386") + (glibc-dynamic-linker "/lib/ld-linux.so.2"))) (define intel64-linux (platform (target "x86_64-linux-gnu") (system "x86_64-linux") - (linux-architecture "x86_64"))) + (linux-architecture "x86_64") + (glibc-dynamic-linker "/lib/ld-linux-x86-64.so.2"))) (define intel32-mingw (platform (target "i686-w64-mingw32") - (system #f))) + (system #f) + (glibc-dynamic-linker #f))) (define intel64-mingw (platform (target "x86_64-w64-mingw32") - (system #f))) + (system #f) + (glibc-dynamic-linker #f))) diff --git a/gnu/platforms/mips.scm b/gnu/platforms/mips.scm index 84a492699d..174657da13 100644 --- a/gnu/platforms/mips.scm +++ b/gnu/platforms/mips.scm @@ -26,4 +26,5 @@ (define mips64-linux (platform (target "mips64el-linux-gnu") (system "mips64el-linux") - (linux-architecture "mips"))) + (linux-architecture "mips") + (glibc-dynamic-linker "/lib/ld.so.1"))) diff --git a/gnu/platforms/powerpc.scm b/gnu/platforms/powerpc.scm index 8fadfe88de..1d0b5cb666 100644 --- a/gnu/platforms/powerpc.scm +++ b/gnu/platforms/powerpc.scm @@ -27,10 +27,12 @@ (define powerpc-linux (platform (target "powerpc-linux-gnu") (system "powerpc-linux") - (linux-architecture "powerpc"))) + (linux-architecture "powerpc") + (glibc-dynamic-linker "/lib/ld.so.1"))) (define powerpc64le-linux (platform (target "powerpc64le-linux-gnu") (system "powerpc64le-linux") - (linux-architecture "powerpc"))) + (linux-architecture "powerpc") + (glibc-dynamic-linker "/lib/ld64.so.2"))) diff --git a/gnu/platforms/riscv.scm b/gnu/platforms/riscv.scm index 29a34402a2..c2b4850e55 100644 --- a/gnu/platforms/riscv.scm +++ b/gnu/platforms/riscv.scm @@ -26,4 +26,5 @@ (define riscv64-linux (platform (target "riscv64-linux-gnu") (system "riscv64-linux") - (linux-architecture "riscv"))) + (linux-architecture "riscv") + (glibc-dynamic-linker "/lib/ld-linux-riscv64-lp64d.so.1"))) diff --git a/gnu/platforms/s390.scm b/gnu/platforms/s390.scm index c8caafbe45..d3b1133974 100644 --- a/gnu/platforms/s390.scm +++ b/gnu/platforms/s390.scm @@ -26,4 +26,5 @@ (define s390x-linux (platform (target "s390x-linux-gnu") (system "s390x-linux") - (linux-architecture "s390"))) + (linux-architecture "s390") + (glibc-dynamic-linker "/lib/ld64.so.1"))) -- 2.36.0