From patchwork Thu Nov 16 10:01:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yujie X-Patchwork-Id: 165744 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3104629vqg; Thu, 16 Nov 2023 02:02:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRgvg07HS66TncEemvxJQHtsZofY6dSOZtMLumsqOuOrhIcGyNY4qH44KfyxPZtaFdcB2r X-Received: by 2002:a05:620a:228f:b0:76e:f62e:45cc with SMTP id o15-20020a05620a228f00b0076ef62e45ccmr6990751qkh.32.1700128963672; Thu, 16 Nov 2023 02:02:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700128963; cv=pass; d=google.com; s=arc-20160816; b=hA8wXNZ8IC9i18N7wsvD6K31SvffOEnwJjRpzwLYA7rWnEtvps2k/EYSfWAqIu7eT+ z2hrEcGxreP0nKD2T81RQAjx+xZYcb/rsMsNBgGBSSqDlS0p0Hi737ldSsZhLsySCWFp hbabt29d/X1UAOEBwCLoaI/coCFJemKSEqu14ot1wh/YoWIAE0Jjjv+fcC4BR1p9tFId 4D86rrXF1CO17na2IqQaqdcqKYCLl88NyoIk28XXzlGJono/uYmpRA661+hKN2DVGyuq d17rZertyxoIkRIZBjDEeY9SnnSuV8CENDOtv/z9/Pt/ZYadmR35x2mb1swR//HljPvt e0AQ== 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:message-id:date:subject:cc:to:from:arc-filter :dmarc-filter:delivered-to; bh=46irfLq5cbFdxr2KkIWD4XihVKvSWwDBxb3qTSrE5wg=; fh=QbGL6D6sAUY6kL43rE4lX4Z/Mms1W+XK6LMDTN2V+eU=; b=IWiXgh5kEWVsgBefZm36uOcIWBBLLj2SI/4FNSOdwYQblj6j94ZKBcOIKvzVOpRtxp eThnboUEqCHpGC0tCavfoVRxb6GguNn2MLxV3oB3mY3XRjkF3Qx1ADhc6Xk80LUHiSXD qw2DQXLvB3aaaEH6+tqteZcIl4Lqvmyn18Y2uWKXAsl9IqgDy/lgWXwbUm7l6e0l5r8e c4gAwmr5J1ofhQe4TTN2ZPV/kiY0bzwBLzCs9XIuuJtXMomUWv4ryV/SYNN6AylyDFbT QH8UgIsocpqOaZ6ZYF5MN7Efvw3CWZqITXIEyMcdiCtbql5JFHh1Xh92/oNUFsGsqh59 p/bw== 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 de41-20020a05620a372900b007759399e39dsi11486571qkb.692.2023.11.16.02.02.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 02:02:43 -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 71FC33858C66 for ; Thu, 16 Nov 2023 10:02:43 +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 7F0C83858D3C for ; Thu, 16 Nov 2023 10:02:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F0C83858D3C 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 7F0C83858D3C 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=1700128940; cv=none; b=VxUNqlFv0YX7FRBsYj7B7+M0swFijBCLZd9dsMT4oBj8OHkGttee+T5ot9qIYgmQCGQDGAt7gQsT8L7zEZ05brPo2nVyTP8ntRM0f7QSqQ5KFVqB46G+hhAQBSeQejmC3aTNp2vJ7rL/HlDG+BYtamSoswF1k9yG2oYlZKaP8jU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700128940; c=relaxed/simple; bh=KF/jrn8oD2BTd/ei5VO6qn8VEQSEEBySlK7qCa36J3I=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=sepe4yAenPMfuzn6+dF1NjpeMKJIJAjphfRaq9yeC1XgdhcgcbSfHQuUY4BKq8X8ONWh4c78T+Yw84kRCP0JoFymirW58WpSqamG3cFTzNrN89absp+SvB6CbadklFk7ROWHXFlNtvURPI0XQub7WlfvuU2CpuCVe8BN8XSKIWU= 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 1r3ZCP-0004lO-LQ for gcc-patches@gcc.gnu.org; Thu, 16 Nov 2023 05:02:19 -0500 Received: from loongson.cn (unknown [114.243.104.185]) by gateway (Coremail) with SMTP id _____8Dx_+uY6FVlJ4Q6AA--.48537S3; Thu, 16 Nov 2023 18:02:01 +0800 (CST) Received: from localhost.localdomain (unknown [114.243.104.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx3t6X6FVlB_5DAA--.7709S2; Thu, 16 Nov 2023 18:01:59 +0800 (CST) From: Yang Yujie To: gcc-patches@gcc.gnu.org Cc: Yang Yujie Subject: [PATCH] libphobos: Fix static build. Date: Thu, 16 Nov 2023 18:01:55 +0800 Message-ID: <20231116100155.2460745-1-yangyujie@loongson.cn> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx3t6X6FVlB_5DAA--.7709S2 X-CM-SenderInfo: 51dqw5pxmlvqxorr0wxvrqhubq/1tbiAQARAGVVfCoEQwAWsn X-Coremail-Antispam: 1Uk129KBj9xXoWrZF15CF48CF18Ww4furWUWrX_yoWfZrc_Ww 1Sgr4YgrsxWrZrtws5AF4UJryFgas8Jr4fXr15tF1xtr15K3WkJFsrXFZ3AF1Y9r4UCa4f WFWfGayFvF1xJosvyTuYvTs0mTUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27w Aqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE 14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x 0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E 7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41lIxAIcV C0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF 04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7 CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU1CPfJUUUUU== 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.5 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: 1782714428526935887 X-GMAIL-MSGID: 1782714428526935887 This is a temporary solution to https://forum.dlang.org/thread/bug-12268-3@https.d.puremagic.com%2Fissues%2F libphobos/ChangeLog: * libdruntime/gcc/sections/elf.d: Removes reference to __tls_get_addr for static libdruntime. --- libphobos/libdruntime/gcc/sections/elf.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libphobos/libdruntime/gcc/sections/elf.d b/libphobos/libdruntime/gcc/sections/elf.d index 5376957befd..46234ae7229 100644 --- a/libphobos/libdruntime/gcc/sections/elf.d +++ b/libphobos/libdruntime/gcc/sections/elf.d @@ -1091,7 +1091,9 @@ void[] getTLSRange(size_t mod, size_t sz) nothrow @nogc addr = addr + cast(c_ulong)__builtin_thread_pointer(); return addr[0 .. sz]; } - else + else version (Shared) return (__tls_get_addr(&ti)-TLS_DTV_OFFSET)[0 .. sz]; + else + return null; } }