From patchwork Fri Dec 8 10:09:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yujie X-Patchwork-Id: 175722 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5356389vqy; Fri, 8 Dec 2023 02:10:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVrbYvbDxA9VoaK+6a/g/3vPZ7P3o3AYO6DMIcn3HBnLhRQ3gayJG/tKQYxGtt24lUbze0 X-Received: by 2002:a05:6122:3690:b0:4b2:cd5c:40a0 with SMTP id ec16-20020a056122369000b004b2cd5c40a0mr4548224vkb.33.1702030231430; Fri, 08 Dec 2023 02:10:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702030231; cv=pass; d=google.com; s=arc-20160816; b=Yc5hWNSNijOZtb0N5dZnrjO7WocoRRBOmqsggrnEtY5pTsX5yXAvAAhVlpXzZcXp8H RKIr/FQkZAfi96p0NJOQWNxVI+Ya07bJuKR5q7xZHVXgWdgZLe5R3vBaJ06uGCr2kObV KTTJwQ/PFGckbO75GntyVSdwMThrSQtPuEPI7FipWJgo82y0zkkujIkjAF9L4UVA3pGe MUGQtpigNs1IsEotV7/KzZSTnn/dF+JWKjRvutPoO5QYTvKfJollbbEYq5hZeE0hyhnj JV42CbHCs8omY9Q5ZMVg7G7PjaPUbHPrCY4zdQ7VXNch7NkTyIMdL6YElJ0zJVcFfmMf Ljng== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:arc-filter:dmarc-filter:delivered-to; bh=OUkr3VgSgiuCI3CinoZIBuQ0+sUTynM0kDbL9C0xDbM=; fh=cJiQWbguc2oGprXvpNjf3gh0rPKu8mxTX6cRlpztnI0=; b=qOPGjzu2qf46dEJE2BlcEKFQqG/qSVeEK0n7Sb+dDMnXSFdT2/HrhRmkxyrjvDiPJM N4WOcCEEQp7yFndnnrEVPnqP2TTRIihSsKJeg713gJQWHLPsnX5FncwMLjcy32S41FPb 6HNgUFTsQcPm1QOn6CEObQ1moZcWAJJBkvTLLXLveLi/dqoUy6/SV4JmxWXepRyX5x92 hGIxbJxaf5F9B5ih+56v3DL+1PwMccOBdCRvJNKqxIg2FZ3Yz+eCAfLAjeeKtRKgeSLn UdajxTlyRh+3JfnDUAVFFPGtb0r3CYLVA9r7T+n1V8SJPeGTHHbYa5ntXQVtL9uWiU3+ +mGQ== 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 p9-20020a0cfac9000000b0067ad7adc2d8si1729366qvo.475.2023.12.08.02.10.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 02:10:31 -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 003983857354 for ; Fri, 8 Dec 2023 10:10:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 7752C3858423 for ; Fri, 8 Dec 2023 10:10:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7752C3858423 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7752C3858423 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702030202; cv=none; b=Ygvzr5rHInnCHF+Nl2mlIxvdnGYzlCLdUxra2czE9nBtrE9mCoGSdN4tG8kIbxnxSDi0btqI0AjEkLlLMooOuNyzBcrBNVE5EgC8D2bgY5tHIAikOISvr3RSqGMmAWb6gEP6rWmpIPE5RBD9lPRy4sQwuHoQR7gOYxuOsmbzhwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702030202; c=relaxed/simple; bh=+pBpcKjglEtFhfkqaURqjRVOTWf7+YayzV0apnZ/CMA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=DDuGCkyUFejnq+uXimQW+QEdmW4SKnuR8uUd/+zrjKTazsW14CTD8IsGpkAVgumKmBfLh4fQiKttJqDLp2CUCBHWRlQQQMQduMuKQuEtOA5igKSfna4ikCceBFu083z6LO1TKc36bnUB0TrvES+DrO1I7+SDEJ2hwKeWI68MMAI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBXnw-0002RX-Cx for gcc-patches@gcc.gnu.org; Fri, 08 Dec 2023 05:10:00 -0500 Received: from loongson.cn (unknown [114.243.111.185]) by gateway (Coremail) with SMTP id _____8Cxc_Bt63JlyvA_AA--.62138S3; Fri, 08 Dec 2023 18:09:49 +0800 (CST) Received: from localhost.localdomain (unknown [114.243.111.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxDC9r63JlH19YAA--.9614S3; Fri, 08 Dec 2023 18:09:48 +0800 (CST) From: Yang Yujie To: gcc-patches@gcc.gnu.org Cc: ibuclaw@gdcproject.org, xry111@xry111.site, chenglulu@loongson.cn, xuchenghua@loongson.cn, Yang Yujie Subject: [PATCH v3 1/2] libruntime: Add fiber context switch code for LoongArch. Date: Fri, 8 Dec 2023 18:09:41 +0800 Message-ID: <20231208100942.344748-2-yangyujie@loongson.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231208100942.344748-1-yangyujie@loongson.cn> References: <20231208100942.344748-1-yangyujie@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8AxDC9r63JlH19YAA--.9614S3 X-CM-SenderInfo: 51dqw5pxmlvqxorr0wxvrqhubq/1tbiAQATAGVyfSwInQAAsB X-Coremail-Antispam: 1Uk129KBj93XoWxWF4kXr18Wr1ftF17WF4UAwc_yoWrCr48pr 48Ar4DWr40yrZxJwn7t3yaqr15Gwn3Z34kAr98KFWjv34rAF1SyrnakFyak39Yq3WfG3WY v34Y9w4DAFnrGFXCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r126r1DMcIj6I8E87Iv 67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUcDDGUUUUU Received-SPF: pass client-ip=114.242.206.163; envelope-from=yangyujie@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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-Status: No, score=-10.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, SPF_FAIL, SPF_HELO_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: 1784708051980032130 X-GMAIL-MSGID: 1784708051980032130 libphobos/ChangeLog: * libdruntime/config/loongarch/switchcontext.S: New file. --- .../config/loongarch/switchcontext.S | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 libphobos/libdruntime/config/loongarch/switchcontext.S diff --git a/libphobos/libdruntime/config/loongarch/switchcontext.S b/libphobos/libdruntime/config/loongarch/switchcontext.S new file mode 100644 index 00000000000..edfb9b67e8f --- /dev/null +++ b/libphobos/libdruntime/config/loongarch/switchcontext.S @@ -0,0 +1,133 @@ +/* LoongArch support code for fibers and multithreading. + Copyright (C) 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. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +#include "../common/threadasm.S" + +/** + * Performs a context switch. + * + * $a0 - void** - ptr to old stack pointer + * $a1 - void* - new stack pointer + * + */ + +#if defined(__loongarch_lp64) +# define GPR_L ld.d +# define GPR_S st.d +# define SZ_GPR 8 +# define ADDSP(si) addi.d $sp, $sp, si +#elif defined(__loongarch64_ilp32) +# define GPR_L ld.w +# define GPR_S st.w +# define SZ_GPR 4 +# define ADDSP(si) addi.w $sp, $sp, si +#else +# error Unsupported GPR size (must be 64-bit or 32-bit). +#endif + +#if defined(__loongarch_double_float) +# define FPR_L fld.d +# define FPR_S fst.d +# define SZ_FPR 8 +#elif defined(__loongarch_single_float) +# define FPR_L fld.s +# define FPR_S fst.s +# define SZ_FPR 4 +#else +# define SZ_FPR 0 +#endif + + .text + .align 2 + .global fiber_switchContext + .type fiber_switchContext, @function +fiber_switchContext: + .cfi_startproc + ADDSP(-11 * SZ_GPR) + + // fp regs and return address are stored below the stack + // because we don't want the GC to scan them. + + // return address (r1) + GPR_S $r1, $sp, -SZ_GPR + +#if SZ_FPR != 0 + // callee-saved scratch FPRs (f24-f31) + FPR_S $f24, $sp, -SZ_GPR-1*SZ_FPR + FPR_S $f25, $sp, -SZ_GPR-2*SZ_FPR + FPR_S $f26, $sp, -SZ_GPR-3*SZ_FPR + FPR_S $f27, $sp, -SZ_GPR-4*SZ_FPR + FPR_S $f28, $sp, -SZ_GPR-5*SZ_FPR + FPR_S $f29, $sp, -SZ_GPR-6*SZ_FPR + FPR_S $f30, $sp, -SZ_GPR-7*SZ_FPR + FPR_S $f31, $sp, -SZ_GPR-8*SZ_FPR +#endif + + // callee-saved GPRs (r21, fp (r22), r23-r31) + GPR_S $r21, $sp, 0*SZ_GPR + GPR_S $fp, $sp, 1*SZ_GPR + GPR_S $s0, $sp, 2*SZ_GPR + GPR_S $s1, $sp, 3*SZ_GPR + GPR_S $s2, $sp, 4*SZ_GPR + GPR_S $s3, $sp, 5*SZ_GPR + GPR_S $s4, $sp, 6*SZ_GPR + GPR_S $s5, $sp, 7*SZ_GPR + GPR_S $s6, $sp, 8*SZ_GPR + GPR_S $s7, $sp, 9*SZ_GPR + GPR_S $s8, $sp, 10*SZ_GPR + + // swap stack pointer + GPR_S $sp, $a0, 0 + move $sp, $a1 + + GPR_L $r1, $sp, -SZ_GPR + +#if SZ_FPR != 0 + FPR_L $f24, $sp, -SZ_GPR-1*SZ_FPR + FPR_L $f25, $sp, -SZ_GPR-2*SZ_FPR + FPR_L $f26, $sp, -SZ_GPR-3*SZ_FPR + FPR_L $f27, $sp, -SZ_GPR-4*SZ_FPR + FPR_L $f28, $sp, -SZ_GPR-5*SZ_FPR + FPR_L $f29, $sp, -SZ_GPR-6*SZ_FPR + FPR_L $f30, $sp, -SZ_GPR-7*SZ_FPR + FPR_L $f31, $sp, -SZ_GPR-8*SZ_FPR +#endif + + GPR_L $r21, $sp, 0*SZ_GPR + GPR_L $fp, $sp, 1*SZ_GPR + GPR_L $s0, $sp, 2*SZ_GPR + GPR_L $s1, $sp, 3*SZ_GPR + GPR_L $s2, $sp, 4*SZ_GPR + GPR_L $s3, $sp, 5*SZ_GPR + GPR_L $s4, $sp, 6*SZ_GPR + GPR_L $s5, $sp, 7*SZ_GPR + GPR_L $s6, $sp, 8*SZ_GPR + GPR_L $s7, $sp, 9*SZ_GPR + GPR_L $s8, $sp, 10*SZ_GPR + + ADDSP(11 * SZ_GPR) + + jr $r1 // return + .cfi_endproc + .size fiber_switchContext,.-fiber_switchContext From patchwork Fri Dec 8 10:09:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yujie X-Patchwork-Id: 175723 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5356426vqy; Fri, 8 Dec 2023 02:10:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxJUYx1iPGKHzv6oGkapRrls0kYqBLcp74gMnURSBim1xAnAuCcRFqIq3aPyGm/L0/8VEg X-Received: by 2002:a05:6808:1b10:b0:3b9:e239:817d with SMTP id bx16-20020a0568081b1000b003b9e239817dmr2054846oib.81.1702030235802; Fri, 08 Dec 2023 02:10:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702030235; cv=pass; d=google.com; s=arc-20160816; b=BIBZkcbMnQj2QzrVN3hz15VdA1EkNFkgNeaZV/Orxhtgjobi+CBR4gXX9+VQ+QOw8X hzw2kSDmqRFSALaF0gpOYLXiomoH3cJtHvgGam5H4n8BDYULyORYSprnCoFOlwLGPX8M +khOxxL1IGZX2XOTIVUc6VQXGOThp1JNWfiSkaxOFKvPppU9cF+Ot9tIlzxyMfsHSGFn S8Eq7Tb+2WG1PxtC6XYyLApchzAsiy2xNczNmkjcArVgL0PYwiTLtHQw0VDvWNq8JIXI PCSOt1V4zOc4KeX5hruWN+Dk3tMtQVHmljDuGvro09q5YZdOQS6IIJBYiL0LT7joCP+E Du/w== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:arc-filter:dmarc-filter:delivered-to; bh=7zCvQeM3YAcwXCHFejgxOAFvb/qHSBTQCsHyzWa1CqI=; fh=cJiQWbguc2oGprXvpNjf3gh0rPKu8mxTX6cRlpztnI0=; b=qlgwQIY1HR7e9qZXLJA/Z8RcOF3L/kpa/ARUJ/M+CVk9iz3T0K/P9mARIr1vO1gs/d otNuDAPEqvJr9VnwkC1BK4WEmfVerJ952CzhMHHaRviy1SxJXOuxf8+B+Hm/Sji7hZcW paUs8AUOOxPb8F6ZvSJWOSODQlu+tWq5NNHdmQ911p0JtpyC2EMwNQVAJBtxbuBigICy Hb7hJOSUE0FxTdyQuqAamye3pHfojCYWn8CyzZ9dvze+miKfvfMaw5NNGiQr1b6d/eEw cgI2xrxQ4V62ZO6atHvDAELX7sYF2Pt/WIgOjZwB/NHnSgzsvxMgSN3+VGoxw2hUmmxT EBBA== 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 gb5-20020a05622a598500b004257ba56131si1946956qtb.662.2023.12.08.02.10.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 02:10:35 -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 26DF7385829F for ; Fri, 8 Dec 2023 10:10:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 0B259385841E for ; Fri, 8 Dec 2023 10:10:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B259385841E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0B259385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702030203; cv=none; b=PGhPYzSiL8cQj7FabfyNR58QBD7yG1okAZsIUvWwgK0vwnE1w1yqABkfEESNg26nXq7E6sQfUlDa3NfdG15tbMpeICc5+MR4JW1y8zvdVpMUd0Q10LSCWYWbJyhmOmbzV1AufAbAE5jscWpKsaCZM+VrlbHREBlcKJRUN5WnOJo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702030203; c=relaxed/simple; bh=XZtIQtDy9hGFgK0lb5LE8Zd+WM+WvEsqmbW6xA3rASI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=cXCfySMcG+hr8veWA8DE4xctxpKxaRWjl3cvOuZggyuOZ1iOqvuhv70J8NbmjIaYD6HiKe3ZPARe1bGcWuFytaa/wyd1ScwDmENAIxdisOAbn4wnD6VdYght/jvGBKuBNfLiFYOdUC7pzpUZpXTyp05sHLhk0teT/tlnUJJ612Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBXnw-0002Ra-AS for gcc-patches@gcc.gnu.org; Fri, 08 Dec 2023 05:10:00 -0500 Received: from loongson.cn (unknown [114.243.111.185]) by gateway (Coremail) with SMTP id _____8Axuepu63JlzfA_AA--.52286S3; Fri, 08 Dec 2023 18:09:50 +0800 (CST) Received: from localhost.localdomain (unknown [114.243.111.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxDC9r63JlH19YAA--.9614S4; Fri, 08 Dec 2023 18:09:49 +0800 (CST) From: Yang Yujie To: gcc-patches@gcc.gnu.org Cc: ibuclaw@gdcproject.org, xry111@xry111.site, chenglulu@loongson.cn, xuchenghua@loongson.cn, Yang Yujie Subject: [PATCH v3 2/2] libphobos: Update build scripts for LoongArch64. Date: Fri, 8 Dec 2023 18:09:42 +0800 Message-ID: <20231208100942.344748-3-yangyujie@loongson.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231208100942.344748-1-yangyujie@loongson.cn> References: <20231208100942.344748-1-yangyujie@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8AxDC9r63JlH19YAA--.9614S4 X-CM-SenderInfo: 51dqw5pxmlvqxorr0wxvrqhubq/1tbiAQATAGVyfSwInwAAsD X-Coremail-Antispam: 1Uk129KBj9fXoW3ur1DJr45WrW3CryrKr4xXwc_yoW8CFy7Go WrWrySqFW0gryfu3Wkt3s7KrWUWa4vqFyUAayaq397KF1kJrnxA3Wjkr15u347tFW0yrn8 XF9xuFW7Z34rA3s8l-sFpf9Il3svdjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf 9Il3svdxBIdaVrn0xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3 UjIYCTnIWjp_UUUY87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI 8IcIk0rVWrJVCq3wAFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xG Y2AK021l84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14 v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8l38UUUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=yangyujie@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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-Status: No, score=-10.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_FAIL, SPF_HELO_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: 1784708056647071467 X-GMAIL-MSGID: 1784708056647071467 libphobos/ChangeLog: * m4/druntime/cpu.m4: Support loongarch* targets. * libdruntime/Makefile.am: Same. * libdruntime/Makefile.in: Regenerate. * configure: Regenerate. --- libphobos/configure | 21 ++++++- libphobos/libdruntime/Makefile.am | 3 + libphobos/libdruntime/Makefile.in | 98 +++++++++++++++++++------------ libphobos/m4/druntime/cpu.m4 | 5 ++ 4 files changed, 87 insertions(+), 40 deletions(-) diff --git a/libphobos/configure b/libphobos/configure index 25b13bdd93e..9a59bad34ac 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -696,6 +696,8 @@ DRUNTIME_CPU_POWERPC_FALSE DRUNTIME_CPU_POWERPC_TRUE DRUNTIME_CPU_MIPS_FALSE DRUNTIME_CPU_MIPS_TRUE +DRUNTIME_CPU_LOONGARCH_FALSE +DRUNTIME_CPU_LOONGARCH_TRUE DRUNTIME_CPU_ARM_FALSE DRUNTIME_CPU_ARM_TRUE DRUNTIME_CPU_AARCH64_FALSE @@ -11865,7 +11867,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11868 "configure" +#line 11870 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11971,7 +11973,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11974 "configure" +#line 11976 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14305,6 +14307,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; arm*) druntime_target_cpu_parsed="arm" ;; + loongarch*) + druntime_target_cpu_parsed="loongarch" + ;; mips*) druntime_target_cpu_parsed="mips" ;; powerpc*) @@ -14336,6 +14341,14 @@ else DRUNTIME_CPU_ARM_FALSE= fi + if test "$druntime_target_cpu_parsed" = "loongarch"; then + DRUNTIME_CPU_LOONGARCH_TRUE= + DRUNTIME_CPU_LOONGARCH_FALSE='#' +else + DRUNTIME_CPU_LOONGARCH_TRUE='#' + DRUNTIME_CPU_LOONGARCH_FALSE= +fi + if test "$druntime_target_cpu_parsed" = "mips"; then DRUNTIME_CPU_MIPS_TRUE= DRUNTIME_CPU_MIPS_FALSE='#' @@ -15997,6 +16010,10 @@ if test -z "${DRUNTIME_CPU_ARM_TRUE}" && test -z "${DRUNTIME_CPU_ARM_FALSE}"; th as_fn_error $? "conditional \"DRUNTIME_CPU_ARM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${DRUNTIME_CPU_LOONGARCH_TRUE}" && test -z "${DRUNTIME_CPU_LOONGARCH_FALSE}"; then + as_fn_error $? "conditional \"DRUNTIME_CPU_LOONGARCH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${DRUNTIME_CPU_MIPS_TRUE}" && test -z "${DRUNTIME_CPU_MIPS_FALSE}"; then as_fn_error $? "conditional \"DRUNTIME_CPU_MIPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index 23205fd3301..ca43a0753c4 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -83,6 +83,9 @@ endif if DRUNTIME_CPU_ARM DRUNTIME_SOURCES_CONFIGURED += config/arm/switchcontext.S endif +if DRUNTIME_CPU_LOONGARCH + DRUNTIME_SOURCES_CONFIGURED += config/loongarch/switchcontext.S +endif if DRUNTIME_CPU_MIPS DRUNTIME_SOURCES_CONFIGURED += config/mips/switchcontext.S endif diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 410245d71ca..f52bf36c282 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -124,12 +124,13 @@ target_triplet = @target@ # CPU specific sources @DRUNTIME_CPU_AARCH64_TRUE@am__append_11 = config/aarch64/switchcontext.S @DRUNTIME_CPU_ARM_TRUE@am__append_12 = config/arm/switchcontext.S -@DRUNTIME_CPU_MIPS_TRUE@am__append_13 = config/mips/switchcontext.S -@DRUNTIME_CPU_POWERPC_TRUE@am__append_14 = config/powerpc/switchcontext.S -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__append_15 = config/mingw/switchcontext.S -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__append_16 = config/x86/switchcontext.S -@DRUNTIME_CPU_SYSTEMZ_TRUE@am__append_17 = config/systemz/get_tls_offset.S -@DRUNTIME_CPU_S390_TRUE@am__append_18 = config/s390/get_tls_offset.S +@DRUNTIME_CPU_LOONGARCH_TRUE@am__append_13 = config/loongarch/switchcontext.S +@DRUNTIME_CPU_MIPS_TRUE@am__append_14 = config/mips/switchcontext.S +@DRUNTIME_CPU_POWERPC_TRUE@am__append_15 = config/powerpc/switchcontext.S +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__append_16 = config/mingw/switchcontext.S +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__append_17 = config/x86/switchcontext.S +@DRUNTIME_CPU_SYSTEMZ_TRUE@am__append_18 = config/systemz/get_tls_offset.S +@DRUNTIME_CPU_S390_TRUE@am__append_19 = config/s390/get_tls_offset.S subdir = libdruntime ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ @@ -485,46 +486,50 @@ am__objects_23 = core/sys/solaris/dlfcn.lo core/sys/solaris/elf.lo \ @DRUNTIME_OS_SOLARIS_TRUE@am__objects_24 = $(am__objects_23) @DRUNTIME_CPU_AARCH64_TRUE@am__objects_25 = config/aarch64/libgdruntime_la-switchcontext.lo @DRUNTIME_CPU_ARM_TRUE@am__objects_26 = config/arm/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_MIPS_TRUE@am__objects_27 = config/mips/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_POWERPC_TRUE@am__objects_28 = config/powerpc/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_29 = config/mingw/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_30 = config/x86/libgdruntime_la-switchcontext.lo -@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_31 = config/systemz/libgdruntime_la-get_tls_offset.lo -@DRUNTIME_CPU_S390_TRUE@am__objects_32 = config/s390/libgdruntime_la-get_tls_offset.lo -am__objects_33 = $(am__objects_6) $(am__objects_8) $(am__objects_10) \ +@DRUNTIME_CPU_LOONGARCH_TRUE@am__objects_27 = config/loongarch/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_MIPS_TRUE@am__objects_28 = config/mips/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_POWERPC_TRUE@am__objects_29 = config/powerpc/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_30 = config/mingw/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_31 = config/x86/libgdruntime_la-switchcontext.lo +@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_32 = config/systemz/libgdruntime_la-get_tls_offset.lo +@DRUNTIME_CPU_S390_TRUE@am__objects_33 = config/s390/libgdruntime_la-get_tls_offset.lo +am__objects_34 = $(am__objects_6) $(am__objects_8) $(am__objects_10) \ $(am__objects_12) $(am__objects_14) $(am__objects_16) \ $(am__objects_18) $(am__objects_20) $(am__objects_22) \ $(am__objects_24) $(am__objects_25) $(am__objects_26) \ $(am__objects_27) $(am__objects_28) $(am__objects_29) \ - $(am__objects_30) $(am__objects_31) $(am__objects_32) -am__objects_34 = gcc/config.lo gcc/libbacktrace.lo -am__objects_35 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \ - $(am__objects_4) $(am__objects_33) $(am__objects_34) -am_libgdruntime_la_OBJECTS = $(am__objects_35) + $(am__objects_30) $(am__objects_31) $(am__objects_32) \ + $(am__objects_33) +am__objects_35 = gcc/config.lo gcc/libbacktrace.lo +am__objects_36 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_34) $(am__objects_35) +am_libgdruntime_la_OBJECTS = $(am__objects_36) libgdruntime_la_OBJECTS = $(am_libgdruntime_la_OBJECTS) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -am__objects_36 = core/stdc/libgdruntime_convenience_la-errno_.lo \ +am__objects_37 = core/stdc/libgdruntime_convenience_la-errno_.lo \ etc/valgrind/libgdruntime_convenience_la-valgrind_.lo -@DRUNTIME_OS_MINGW_TRUE@am__objects_37 = $(am__objects_21) \ +@DRUNTIME_OS_MINGW_TRUE@am__objects_38 = $(am__objects_21) \ @DRUNTIME_OS_MINGW_TRUE@ config/mingw/libgdruntime_convenience_la-msvc.lo -@DRUNTIME_CPU_AARCH64_TRUE@am__objects_38 = config/aarch64/libgdruntime_convenience_la-switchcontext.lo -@DRUNTIME_CPU_ARM_TRUE@am__objects_39 = config/arm/libgdruntime_convenience_la-switchcontext.lo -@DRUNTIME_CPU_MIPS_TRUE@am__objects_40 = config/mips/libgdruntime_convenience_la-switchcontext.lo -@DRUNTIME_CPU_POWERPC_TRUE@am__objects_41 = config/powerpc/libgdruntime_convenience_la-switchcontext.lo -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_42 = config/mingw/libgdruntime_convenience_la-switchcontext.lo -@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_43 = config/x86/libgdruntime_convenience_la-switchcontext.lo -@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_44 = config/systemz/libgdruntime_convenience_la-get_tls_offset.lo -@DRUNTIME_CPU_S390_TRUE@am__objects_45 = config/s390/libgdruntime_convenience_la-get_tls_offset.lo -am__objects_46 = $(am__objects_6) $(am__objects_8) $(am__objects_10) \ +@DRUNTIME_CPU_AARCH64_TRUE@am__objects_39 = config/aarch64/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_ARM_TRUE@am__objects_40 = config/arm/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_LOONGARCH_TRUE@am__objects_41 = config/loongarch/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_MIPS_TRUE@am__objects_42 = config/mips/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_POWERPC_TRUE@am__objects_43 = config/powerpc/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_TRUE@am__objects_44 = config/mingw/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_X86_TRUE@@DRUNTIME_OS_MINGW_FALSE@am__objects_45 = config/x86/libgdruntime_convenience_la-switchcontext.lo +@DRUNTIME_CPU_SYSTEMZ_TRUE@am__objects_46 = config/systemz/libgdruntime_convenience_la-get_tls_offset.lo +@DRUNTIME_CPU_S390_TRUE@am__objects_47 = config/s390/libgdruntime_convenience_la-get_tls_offset.lo +am__objects_48 = $(am__objects_6) $(am__objects_8) $(am__objects_10) \ $(am__objects_12) $(am__objects_14) $(am__objects_16) \ - $(am__objects_18) $(am__objects_20) $(am__objects_37) \ - $(am__objects_24) $(am__objects_38) $(am__objects_39) \ - $(am__objects_40) $(am__objects_41) $(am__objects_42) \ - $(am__objects_43) $(am__objects_44) $(am__objects_45) -am__objects_47 = $(am__objects_1) $(am__objects_36) $(am__objects_3) \ - $(am__objects_4) $(am__objects_46) $(am__objects_34) -am__objects_48 = $(am__objects_47) -am_libgdruntime_convenience_la_OBJECTS = $(am__objects_48) + $(am__objects_18) $(am__objects_20) $(am__objects_38) \ + $(am__objects_24) $(am__objects_39) $(am__objects_40) \ + $(am__objects_41) $(am__objects_42) $(am__objects_43) \ + $(am__objects_44) $(am__objects_45) $(am__objects_46) \ + $(am__objects_47) +am__objects_49 = $(am__objects_1) $(am__objects_37) $(am__objects_3) \ + $(am__objects_4) $(am__objects_48) $(am__objects_35) +am__objects_50 = $(am__objects_49) +am_libgdruntime_convenience_la_OBJECTS = $(am__objects_50) libgdruntime_convenience_la_OBJECTS = \ $(am_libgdruntime_convenience_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) @@ -799,7 +804,7 @@ DRUNTIME_SOURCES_CONFIGURED = $(am__append_1) $(am__append_2) \ $(am__append_9) $(am__append_10) $(am__append_11) \ $(am__append_12) $(am__append_13) $(am__append_14) \ $(am__append_15) $(am__append_16) $(am__append_17) \ - $(am__append_18) + $(am__append_18) $(am__append_19) # Provide __start_minfo, __stop_minfo if linker doesn't. @DRUNTIME_OS_MINFO_BRACKETING_FALSE@DRTSTUFF = gcc/drtbegin.o gcc/drtend.o @@ -1953,6 +1958,11 @@ config/arm/$(am__dirstamp): @: > config/arm/$(am__dirstamp) config/arm/libgdruntime_la-switchcontext.lo: \ config/arm/$(am__dirstamp) +config/loongarch/$(am__dirstamp): + @$(MKDIR_P) config/loongarch + @: > config/loongarch/$(am__dirstamp) +config/loongarch/libgdruntime_la-switchcontext.lo: \ + config/loongarch/$(am__dirstamp) config/mips/$(am__dirstamp): @$(MKDIR_P) config/mips @: > config/mips/$(am__dirstamp) @@ -1995,6 +2005,8 @@ config/aarch64/libgdruntime_convenience_la-switchcontext.lo: \ config/aarch64/$(am__dirstamp) config/arm/libgdruntime_convenience_la-switchcontext.lo: \ config/arm/$(am__dirstamp) +config/loongarch/libgdruntime_convenience_la-switchcontext.lo: \ + config/loongarch/$(am__dirstamp) config/mips/libgdruntime_convenience_la-switchcontext.lo: \ config/mips/$(am__dirstamp) config/powerpc/libgdruntime_convenience_la-switchcontext.lo: \ @@ -2017,6 +2029,8 @@ mostlyclean-compile: -rm -f config/aarch64/*.lo -rm -f config/arm/*.$(OBJEXT) -rm -f config/arm/*.lo + -rm -f config/loongarch/*.$(OBJEXT) + -rm -f config/loongarch/*.lo -rm -f config/mingw/*.$(OBJEXT) -rm -f config/mingw/*.lo -rm -f config/mips/*.$(OBJEXT) @@ -2150,6 +2164,9 @@ config/aarch64/libgdruntime_la-switchcontext.lo: config/aarch64/switchcontext.S config/arm/libgdruntime_la-switchcontext.lo: config/arm/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/arm/libgdruntime_la-switchcontext.lo `test -f 'config/arm/switchcontext.S' || echo '$(srcdir)/'`config/arm/switchcontext.S +config/loongarch/libgdruntime_la-switchcontext.lo: config/loongarch/switchcontext.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/loongarch/libgdruntime_la-switchcontext.lo `test -f 'config/loongarch/switchcontext.S' || echo '$(srcdir)/'`config/loongarch/switchcontext.S + config/mips/libgdruntime_la-switchcontext.lo: config/mips/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/mips/libgdruntime_la-switchcontext.lo `test -f 'config/mips/switchcontext.S' || echo '$(srcdir)/'`config/mips/switchcontext.S @@ -2174,6 +2191,9 @@ config/aarch64/libgdruntime_convenience_la-switchcontext.lo: config/aarch64/swit config/arm/libgdruntime_convenience_la-switchcontext.lo: config/arm/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/arm/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/arm/switchcontext.S' || echo '$(srcdir)/'`config/arm/switchcontext.S +config/loongarch/libgdruntime_convenience_la-switchcontext.lo: config/loongarch/switchcontext.S + $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/loongarch/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/loongarch/switchcontext.S' || echo '$(srcdir)/'`config/loongarch/switchcontext.S + config/mips/libgdruntime_convenience_la-switchcontext.lo: config/mips/switchcontext.S $(AM_V_CPPAS)$(LIBTOOL) $(AM_V_lt) $(libgdruntime_convenience_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o config/mips/libgdruntime_convenience_la-switchcontext.lo `test -f 'config/mips/switchcontext.S' || echo '$(srcdir)/'`config/mips/switchcontext.S @@ -2226,6 +2246,7 @@ clean-libtool: -rm -rf .libs _libs -rm -rf config/aarch64/.libs config/aarch64/_libs -rm -rf config/arm/.libs config/arm/_libs + -rm -rf config/loongarch/.libs config/loongarch/_libs -rm -rf config/mingw/.libs config/mingw/_libs -rm -rf config/mips/.libs config/mips/_libs -rm -rf config/powerpc/.libs config/powerpc/_libs @@ -2391,6 +2412,7 @@ distclean-generic: -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f config/aarch64/$(am__dirstamp) -rm -f config/arm/$(am__dirstamp) + -rm -f config/loongarch/$(am__dirstamp) -rm -f config/mingw/$(am__dirstamp) -rm -f config/mips/$(am__dirstamp) -rm -f config/powerpc/$(am__dirstamp) diff --git a/libphobos/m4/druntime/cpu.m4 b/libphobos/m4/druntime/cpu.m4 index db3a92c15fa..3461b2d3c51 100644 --- a/libphobos/m4/druntime/cpu.m4 +++ b/libphobos/m4/druntime/cpu.m4 @@ -15,6 +15,9 @@ AC_DEFUN([DRUNTIME_CPU_SOURCES], ;; arm*) druntime_target_cpu_parsed="arm" ;; + loongarch*) + druntime_target_cpu_parsed="loongarch" + ;; mips*) druntime_target_cpu_parsed="mips" ;; powerpc*) @@ -34,6 +37,8 @@ AC_DEFUN([DRUNTIME_CPU_SOURCES], [test "$druntime_target_cpu_parsed" = "aarch64"]) AM_CONDITIONAL([DRUNTIME_CPU_ARM], [test "$druntime_target_cpu_parsed" = "arm"]) + AM_CONDITIONAL([DRUNTIME_CPU_LOONGARCH], + [test "$druntime_target_cpu_parsed" = "loongarch"]) AM_CONDITIONAL([DRUNTIME_CPU_MIPS], [test "$druntime_target_cpu_parsed" = "mips"]) AM_CONDITIONAL([DRUNTIME_CPU_POWERPC],