From patchwork Mon Apr 8 19:41:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1921026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=YHuggAJH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VCzy00lX5z1yYb for ; Tue, 9 Apr 2024 05:42:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D6173858408 for ; Mon, 8 Apr 2024 19:42:13 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 38EDE3858D28 for ; Mon, 8 Apr 2024 19:41:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 38EDE3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 38EDE3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712605320; cv=none; b=MZDzKIF9BBCAELPiYPavopMMIgtuxFCEQ2UvhOISrDxJVTPYlqfSoqnnQPHCQ/7UGT8Ng7pa8wKa4/9RM5MrvaIhRdZPB6cj4irLHazURK/Ea8q5uDJvVeEzU8M200mvHtG5SfgmRYzVY66C4IR/3nT2+BB4wcHWnQeLnxqqM7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712605320; c=relaxed/simple; bh=bjz1pU2hzFCViir4fKKiRqStjL6iF7OT8JtbxqDNxwU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Quq7iJnIRRokraUq8K3IXTXxb3xLIBzAUsxQiudpW7dkh3bBIyvuR51P7+Gq6JztjbVL7jBfu2Fnaax8T8zouTUa5+nc2sxMQV3szHBX/E5khzF0bps3wP95KdOMJBDOEgH3RepuEyg4AKd00/PmWxw85LGWAvjjFTQEsXRMYAo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1e3c9300c65so24871095ad.0 for ; Mon, 08 Apr 2024 12:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712605317; x=1713210117; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+lzbbB+HYvo40ryBQPgVL1ovQ9TfhvGqg79PJXV69Wc=; b=YHuggAJHwyO3BVuNS3RdXmbb1+4IV596CI/bRuhG8rFD8XgO3jYo9xYXOM46Es4ZtI Q3Va/Bduj0Gpd+6mF0IuIBM4DvtKNRUKn8hZEB8yL9xYQfYDXCVaUhOSEkC8VQG+3nDF Jl2HNFlov58NmZZk+H3UBI3hCMXp1yY1R5lBW+d/B0tzo6ooV73U1ogOJkvw0V95X9w9 RSF4U2VjNKgobdWEFHTKhglXJSoahA1WBGogE6E7T7JVk5EDm1cJk4bj5tc1Zzv92Hvb Uv+Ip2+kafbXkFjFrBlhnq5nbdTHOKjIU7xH6RtK9ABT3t+IA5YoH+4SGVqOcUKwXNf/ IQ9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712605317; x=1713210117; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+lzbbB+HYvo40ryBQPgVL1ovQ9TfhvGqg79PJXV69Wc=; b=lbqWxoKnhfKAZjV85yfVP72KTmKZCREtI4hsh2pIV9cIgHXwIKJ6ZKsEB9Kpd8Fm0m IBeNLUedQepp0I/XhCk3PT0AgcfSByZIQN6Gfojd3uqdH9kDpOHAqwfbe+YY8tSszHlU YyHrxVAz6HTF8aQvcROnU3o9ciKDqtBgGHJgzgvukPSMGifthYZXvmSGoagj6mgdfwK+ DW9SX6jkjjZsUALuHEzAAWLVl6TvUZtHuxKD71W6YONtJt13cvr+7aVDcr/d0eFzpRpP r+inZkFA67l8HYpBcCFjTw6J8wqaS5NHRxLbuLCb2tO2mndptvA5yD5hW8MGDPZRqRWJ BRZg== X-Gm-Message-State: AOJu0YwrVGbPCM2q8zolgNdxOoLMjBCPi4hS0KYvCMf2AGvkNhq6F8mD 3MunobHGyJCtyUni1dQo5cS3VLwY78jzbTqjbdiNTydbqfooRxBiv61gMrH5 X-Google-Smtp-Source: AGHT+IErt26IAPqVn81dxF3Qt57mo1kbO8z5HiFLmozYDXg8y9ajktnrcZbIKR16KSATzOtnr+WrtQ== X-Received: by 2002:a17:902:d4c8:b0:1e3:f923:e257 with SMTP id o8-20020a170902d4c800b001e3f923e257mr6691548plg.49.1712605316712; Mon, 08 Apr 2024 12:41:56 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.56.169.48]) by smtp.gmail.com with ESMTPSA id kh6-20020a170903064600b001dee0e175c1sm7407170plb.118.2024.04.08.12.41.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 12:41:56 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 0876E740270 for ; Mon, 8 Apr 2024 12:41:55 -0700 (PDT) From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH] nptl: Add tst-pthread-key1-static for BZ #21777 Date: Mon, 8 Apr 2024 12:41:54 -0700 Message-ID: <20240408194154.3271318-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3020.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_PASS, TXREP 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Add a static pthread static tests to verify that BZ #21777 is fixed. --- nptl/Makefile | 2 ++ nptl/tst-pthread-key1-static.c | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 nptl/tst-pthread-key1-static.c diff --git a/nptl/Makefile b/nptl/Makefile index bf09603e7b..fd4eaf68d2 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -315,6 +315,7 @@ tests = \ tst-pthread-defaultattr-free \ tst-pthread-gdb-attach \ tst-pthread-gdb-attach-static \ + tst-pthread-key1-static \ tst-pthread-timedlock-lockloop \ tst-pthread_exit-nothreads \ tst-pthread_exit-nothreads-static \ @@ -533,6 +534,7 @@ link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \ tests-static += \ tst-cancel24-static \ + tst-pthread-key1-static \ tst-mutex8-static \ tst-mutexpi8-static \ tst-pthread-gdb-attach-static \ diff --git a/nptl/tst-pthread-key1-static.c b/nptl/tst-pthread-key1-static.c new file mode 100644 index 0000000000..1d02996c86 --- /dev/null +++ b/nptl/tst-pthread-key1-static.c @@ -0,0 +1,37 @@ +/* Verify that static pthread executable works. + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +pthread_key_t k; + +static int +do_test (void) +{ + int rc; + + rc = pthread_key_create (&k, NULL); + TEST_VERIFY (rc == 0); + rc = pthread_setspecific(k, NULL); + TEST_VERIFY (rc == 0); + + return 0; +} + +#include