From patchwork Mon Nov 27 14:48:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 170212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3177835vqx; Mon, 27 Nov 2023 06:49:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFm5imDLuU4PSeY6FDbHz8s2WfuEMcA0mJ1tONdETHRFif7uuQ02KMslt1JlHnQ5D8f3SJ1 X-Received: by 2002:ac8:5dcc:0:b0:423:6d73:8e69 with SMTP id e12-20020ac85dcc000000b004236d738e69mr16674138qtx.54.1701096555765; Mon, 27 Nov 2023 06:49:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701096555; cv=pass; d=google.com; s=arc-20160816; b=ADgvYEhEV8SZi5y43uC3Jl4kuRCRe9DozbZH7FLNsHhX2XsRevSnnm+toeOdfMttYu jCK22eav5MLiKGkBJ3UPzIXP0EfNEuxK/QL/h+10p5PZiyzmsrPJTIgUyuompZjJ9lXk mC5OuxQw70YR1xcjutDvlSrX9UqKqLLROXX90Z9auAzHTA5hSIB7Bzm4N4bl8/cT101K IOfGlmV83bAunHhE/9u+Qur4M6M+lMCJXinq7HtxlI6W7oIKaLWhG0Ypx32Iea4dPe7w akSDESxTOjG0PQxvl1SPP0XbSk+VhThDutHFMU/+/LaD/WJdlajlUFNX0T2/XGR2at10 Bf9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:ironport-sdr :arc-filter:dmarc-filter:delivered-to; bh=MFzslr30aFDP5xmpRIz/v3mJnAekSq1X3O5DPB4ky2I=; fh=yxuASnO8uE3vdod7hhP+Xa0QZuXN0mNx56fCIqp+xQY=; b=AU5UYwMFamnQLGl04jmVogdnSU4aAge0R2YcAtQ55nQD7tjWIa2GmxFXKXKarn9YfE ZspDO0/rnMRX5ZSKdXr9kgJ26nNAXd+Wrag2VCMHIVM0+YV82E7zmtvJQwmkXc2Nf2QH 7d3x+9QIZkWfxm6OuPcVeS5y85gheKVLaJqE3Kim7A+FsnrL3GOxjPEGnEYwF45eERAD HxsBfd53kw4RuScSldwBfiGT3WScGMjaOsHiMsxDembbXuXkU6dmNvh1PWlnZmGfcGKw SBZm/ZnljlyQ8tFLOKX7UsSgiuXnDnhj4Qtq6+UjyB8h+VjMXsMwi4EkWn/IwjgaiRr8 JYog== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d7-20020a05622a15c700b004237b1fca88si9209353qty.737.2023.11.27.06.49.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 06:49:15 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 840F4385770C for ; Mon, 27 Nov 2023 14:49:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id B1A52385841E for ; Mon, 27 Nov 2023 14:48:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B1A52385841E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B1A52385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.180 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701096534; cv=none; b=BaaZVNnkkBGDi/6V6nUXm0Scc9bW7WoRqm8U7jK+H2TBhpu3JHLO15ZDRFY4nQIsXzXUZphosXEHlkRTE00zDEDJN0w3jePe+3i0YzRQ37wgJa293AYj5FmMVGA/JkWeM+ozG5WoSLFrTBuQs0rk+Msa7Lk+cCRPZp+AizYIBTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701096534; c=relaxed/simple; bh=Wgug1XUIjX+STALVwijn4dNuM+1nQivq8GEKluyhFUc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=m+RZF8C3cZtiR3gxyOh303xNoaRDS0zEyD1bWWH7io3YwKmzaZ5XVsta+KqupcqDPSEoyM+itXdVujG1WJoGNgsquYbdNl44VycJFFe62nmlAQ4Zaeb4DzVbN6ZxqzmbE2MLDRcQ6x7H+3rOiTYK0/hISwvco0lK1ezeyQPQl14= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: ZJQf56QPSlWPJVGbfU1d5A== X-CSE-MsgGUID: zZqbaa8IRL6WAfgmudavvw== X-IronPort-AV: E=Sophos;i="6.04,231,1695715200"; d="scan'208,223";a="23795270" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 27 Nov 2023 06:48:40 -0800 IronPort-SDR: qGLCX+hp/Yg8/ialpyD2xHZO2YePrSiBwZVDEQcG7+YK06Kv7Hm0Zu5J1MAwscai9jeBEebe9g u8qQ9iRlpYmtTpDnv0lh68K3BfDezggBSUFlbTQ6sfRoHMkOTsl2wiSnLiJ19XLz/5QOtDtk5Q 8Mlke8c8H6gwMeX0SyLI8WXvRg4bLeJN85ECBCMCoP+s489T+sN6mNAh9ELqEMl2BZg7GebajV MxYNWMu74dE+bGBLxP26+rlMbUuQe6DfqAwscF4CkJWSn12WY/NY+y5t7NZHxtZUx9HF9zxgPR rNw= From: Thomas Schwinge To: Samuel Thibault , CC: Subject: hurd: Add multilib paths for gnu-x86_64 In-Reply-To: <20231028191959.wqxrjpps6z5ij3nz@begin> References: <20231028191959.wqxrjpps6z5ij3nz@begin> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Mon, 27 Nov 2023 15:48:33 +0100 Message-ID: <87msuzs14u.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781028175608552844 X-GMAIL-MSGID: 1783729022294533252 Hi! On 2023-10-28T21:19:59+0200, Samuel Thibault wrote: > We need the multilib paths in gcc to find e.g. glibc crt files on > Debian. ACK. > This is essentially based on t-linux64 version. Yes, but isn't the overall setup diverged from GNU/Linux? Currently, x86_64 GNU/Hurd first gets 'i386/t-linux64', whose definitons are only later: > --- a/gcc/config.gcc > +++ b/gcc/config.gcc > @@ -5828,6 +5828,9 @@ case ${target} in > visium-*-*) > target_cpu_default2="TARGET_CPU_$with_cpu" > ;; > + x86_64-*-gnu*) > + tmake_file="$tmake_file i386/t-gnu64" > + ;; > esac ... then here (effectively) overwritten by 'i386/t-gnu64'. Instead, I suppose, we should handle 'i386/t-linux64' and 'i386/t-gnu64' alike, and resolve relevant configuration differences. As fas a I can tell, 'i386/t-linux64' is also used for multilib-enabled ('test x$enable_targets = xall') x86 GNU/Linux, and that's not (correspondingly) done for x86 GNU/Hurd? However, such things can certainly be resolved incrementally, later on. I understand that your change does work for you as-is, so I've now pushed that to master branch in commit 5707e9db9c398d311defc80c5b7822c9a07ead60 "hurd: Add multilib paths for gnu-x86_64", see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 5707e9db9c398d311defc80c5b7822c9a07ead60 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 6 May 2023 13:50:36 +0200 Subject: [PATCH] hurd: Add multilib paths for gnu-x86_64 We need the multilib paths in gcc to find e.g. glibc crt files on Debian. This is essentially based on t-linux64 version. gcc/ChangeLog: * config/i386/t-gnu64: New file. * config.gcc [x86_64-*-gnu*]: Add i386/t-gnu64 to tmake_file. --- gcc/config.gcc | 3 +++ gcc/config/i386/t-gnu64 | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 gcc/config/i386/t-gnu64 diff --git a/gcc/config.gcc b/gcc/config.gcc index 3000379cafc..e62849c1230 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -5973,6 +5973,9 @@ case ${target} in visium-*-*) target_cpu_default2="TARGET_CPU_$with_cpu" ;; + x86_64-*-gnu*) + tmake_file="$tmake_file i386/t-gnu64" + ;; esac t= diff --git a/gcc/config/i386/t-gnu64 b/gcc/config/i386/t-gnu64 new file mode 100644 index 00000000000..23ee6823d65 --- /dev/null +++ b/gcc/config/i386/t-gnu64 @@ -0,0 +1,38 @@ +# Copyright (C) 2002-2023 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# On Debian, Ubuntu and other derivative distributions, the 32bit libraries +# are found in /lib32 and /usr/lib32, /lib64 and /usr/lib64 are symlinks to +# /lib and /usr/lib, while other distributions install libraries into /lib64 +# and /usr/lib64. The LSB does not enforce the use of /lib64 and /usr/lib64, +# it doesn't tell anything about the 32bit libraries on those systems. Set +# MULTILIB_OSDIRNAMES according to what is found on the target. + +# To support i386, x86-64 and x32 libraries, the directory structrue +# should be: +# +# /lib has i386 libraries. +# /lib64 has x86-64 libraries. +# /libx32 has x32 libraries. +# +comma=, +MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG)) +MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS))) +MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-gnu) +MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-gnu) +MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-gnux32) -- 2.34.1