From patchwork Sat Jan 25 19:45:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Wellons X-Patchwork-Id: 105388 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7D2713858424 for ; Sat, 25 Jan 2025 19:54:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D2713858424 X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail.nullprogram.com (mail.nullprogram.com [192.241.191.137]) by sourceware.org (Postfix) with ESMTPS id 24A563858C33 for ; Sat, 25 Jan 2025 19:54:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24A563858C33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nullprogram.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nullprogram.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 24A563858C33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.241.191.137 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737834857; cv=none; b=EF0MH9BZf8FqVmAJY/mns99rnIo/Xot8ygVNarp7u3djLbpxrAKDSr59tAnrY4nfk3AeeJPKK10m9c9SeNpik+WfXA9q6ki9CVR6kHlSSKWZK94i834G881qtD9jECLYpWmmjnxMmTJa90DsebMy+AYIciutWVZbK7Fb4jnlZ3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1737834857; c=relaxed/simple; bh=r3Oh1WYIIbAsl+/ZGrlnKGqTe5Zqy4FIadqT6TIhJgM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=l7ohJlTphwPEr9lKunHPOposhQSk5xwVaECHrU/uBeB4qds5sI3h3ES7P9yy6Lfd1/px3AxN+FAc5Qd0m1mmUIQ98UTV2jwfRgQlHTJa4csiJnXec9//5jce4udTtHgbLXgx2QEXtSJT2aSGxKzhjK1U/5HydnRkZKYmf/+l8v8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24A563858C33 Received: from bee.zeus.nullprogram.com (localhost [127.0.0.1]) by mail.nullprogram.com (Postfix) with ESMTP id 40302C98CE; Sat, 25 Jan 2025 14:54:16 -0500 (EST) From: Christopher Wellons To: binutils@sourceware.org Cc: Christopher Wellons Subject: [PATCH] Exclude libpthread from automatic export generation Date: Sat, 25 Jan 2025 14:45:20 -0500 Message-Id: <20250125194519.2576321-1-wellons@nullprogram.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, LIKELY_SPAM_FROM, SPF_HELO_NONE, SPF_PASS, 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org Before this change, static linking libwinpthread, commonly distributed as part of Mingw-w64, while using automatic symbol exports would export the entire threading API, which is never wanted. This is always the case when static linking libstdc++ built against libpthread. --- I only added libpthread because it has such a big impact, but libucrtapp should probably be listed as well. The following Mingw-w64 libraries all also contain at least one definition beyond DLL exports: libdloadhelper, libdxerr8, libdxerr9, libgmon, libmsvcr100, libmsvcr110, libmsvcr120, libmsvcr120_app, libmsvcr120d, libmsvcr80, libmsvcr90, and libmsvcr90d. But they're rather unusual and have little impact. It's probably worth blanket-excluding the entire sysroot. ld/pe-dll.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ld/pe-dll.c b/ld/pe-dll.c index d888a0b6373..f24b8716ae2 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -382,6 +382,8 @@ static const autofilter_entry_type autofilter_liblist[] = { STRING_COMMA_LEN ("libmsvcrt-os") }, { STRING_COMMA_LEN ("libucrt") }, { STRING_COMMA_LEN ("libucrtbase") }, + { STRING_COMMA_LEN ("libpthread") }, + { STRING_COMMA_LEN ("libwinpthread") }, { NULL, 0 } };