From patchwork Sat Dec 21 22:24:48 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: 852745 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp2744391wrq; Sat, 21 Dec 2024 14:25:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWrqfklETLGb0r8H5R8PiW1AGMfgaDCGmRFYnSJEC5AZl/MAq8gKS09NK52x4BVR+n5h6MbGg==@linaro.org X-Google-Smtp-Source: AGHT+IEsUClg/sVTBYniO6PPzzSiMViupyvT2DMZZjcb5MBpP15OCOzir8R/0rJ+42JGYZjCs90A X-Received: by 2002:a05:6214:3001:b0:6d8:8e16:7c29 with SMTP id 6a1803df08f44-6dd2334ae65mr142558096d6.14.1734819910813; Sat, 21 Dec 2024 14:25:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1734819910; cv=pass; d=google.com; s=arc-20240605; b=fDzrF8NPf7cPhfu/b7WGbShLROAclZAlexbM1OyZFV+Cx8hsvbJCK4Dm9rvhH1YGAy 1cgFKKFXNkE1dm/PAuuVD6DWXzAJsUXn0XmA+wZLvDnqLCuL0TiXnPBckYjXyiPZZK2L 4kUbIdzrNZAP66wHyYAqN1yCWFMZV2cDIfzBb7ot0SK5h4D9F8FBid1iDDcrgA3aJ7oh 93Cz4+vx4uOuBVl+wUVipyqjWMwLS5POM+c47okI4QaOU4XVWgvEcJAuEiYHKBCaFtlW 6oAsCdKSWatBMNzlBNI18MnDRjnK4rDqTldnmFMt0SE+P5xNnfc8A6q5J0l+D4voouCE C4Bg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:dkim-signature :dkim-filter:arc-filter:dmarc-filter:delivered-to:dkim-filter; bh=RpuisbkRxcSdbowgmto5FE6zaSKGDSx8rl2k+7KgybU=; fh=rJtIiWzkCr5V2GvQGQWdJX+wkLY3kEXmUtQZbZqt0f0=; b=W/nle6Qe6H2V9h95tktb74Yp0K9Y1idtBmQozhgYDZnOlDknUm+U/WZPRWdMc4F9cM U/Ctgnm/7WNtgHq1m381n79XTQ7f2RB8LhKTCrn6f/vxCTILdQjSuQAGViuobgms1Tw3 iq1yYlMnOffnqQxAsrgfGuu5WPyBim13uBDf5v9Qrq+eBhFTgrfc6GH8YMX5NK0LgFSA K0vgdTdgdNFgEI2vvT3EpiDkYVOpZ2O2pHKtg9AtssxMlk7LEZhr7561sqwwU9go+wun 9NXDuXMQY9/bDuTVBZxCZ5BWWqUhZS5xg65nvVzzaTIwK6p1SrW0G+/hgDq8lU6Zs78y 2Jbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Y+gockDL; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id 6a1803df08f44-6dd1825436esi80666276d6.377.2024.12.21.14.25.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 14:25:10 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Y+gockDL; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A2C8385840F for ; Sat, 21 Dec 2024 22:25:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A2C8385840F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Y+gockDL X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 80B413858D3C for ; Sat, 21 Dec 2024 22:24:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 80B413858D3C 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 80B413858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734819895; cv=none; b=hXfHpyAp4d0VDWHjObIUd5b3dLRV7NjhIPGIjS6gFlIGkScl9hthLxrlLYoWbfIDZngexVFlT7lmkfZaHWp0/fJbHZLGTwF8+U6JvO9DUEP2T439v6N/hq3Y0+juwTFPOooHhDwoDPfMrwXjSAcQLdwKXkjAZuUgsr42CCM+034= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734819895; c=relaxed/simple; bh=28uJJQSrUgYUwwDLXz9InYAfd67IHTZWuM4pSBhi63g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZtJMWIfRPj5XKXk2qHZsIJWVwVGwTjfkmRg+b14sjk9Ok0u8crTKs7gUSmtfjdncQ4GPgcrZB+HW3eK/JjBVtekSvSN61DifIzzoPz0+mUAutJf28SxDeIyoZneTnN2bDwknYLPmEgK/t0xPqIF9Xt1ifQmGDr9xt4GLBZc3dVk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80B413858D3C Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-728eedfca37so3327316b3a.2 for ; Sat, 21 Dec 2024 14:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734819894; x=1735424694; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RpuisbkRxcSdbowgmto5FE6zaSKGDSx8rl2k+7KgybU=; b=Y+gockDLXTfoGlAcTYheV7XVImsk7jfhMHlw2iem1YxeNLseasrJ5LaFV0FBNtXPLh Wf4TDdUrDng00xaiBl7GVhQ0kQd5TuCo3xmJbeEgiART9+I3HUJKRvUOHYE5NsL6uQRW 3H2zXPv6Nf/yqknExvHA1PJvqxMDIiw3lCSIRRU2FoqJSof0lTXVcKTe5ZerBZv/hAA5 rQ8gFZLjTAm8vypq0ij4KLIxB69IXqUTBFVU9ydhrfg8+OSFss+m5XAgjdEIkZ3HqwmF LDk/vX/WaA4D98IZ/+kGM0rgE+V+eggobvRM2E8EpEfB19wwdOCmba1usGm5yAY1xXE3 Nhqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734819894; x=1735424694; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RpuisbkRxcSdbowgmto5FE6zaSKGDSx8rl2k+7KgybU=; b=ViLdt62NeY7JM3yzEejLYwuGSGFNJF+pesw+m5C2FTgRI0tadeLyEJDCzA2UWRbt2K HFrq/REW2mloXQjo7s7Q0AN9f7pBbbEHb8K+R3qumEP0ZFW7FEYjLzExJo6uRl0WeVN/ jafKp8Qc3o+NqKSOXbfricsPHYx4Ji/FIYtQwdwUxdm+07dyE/4bz6JKKJ4RicEpdHc4 0WKy1tv+fm9wEwkvBdTk9j98h1OTF2AD0wrluX+x+VJHM8Q0vHE8rEyMu0egynKEdJZ0 Ujd9EaEIzKkKaqzipglDF/rTyinyJ4D7HK+alktXjadDD3t1gI5rdn9zLjfQMd/R+YUI PqkQ== X-Gm-Message-State: AOJu0YxNvctYgvqCG42NoA/n2fXFlqwW2wz5gtjpSQqWDlJBTj/EHpzP xsYncRMaH9P9FVx/4YpKKcZeWuutjR/3MQOfkJ21lf02Ek/KBXfLB7fVferBelNwaw== X-Gm-Gg: ASbGncu4EW/6C8BBgFb1hA0i94WOMPRSFErQZk3COWQDXvBSHMzbRNB7GDuo9+CG63H DKzY9oMd3uX80qKT/O8ZFjfNRQw7WlNjASp88XlIApbSVERA72jVXdh1WmLWHN9GTI7K8It0+Bu tQa6hG/5XDESxd2iwdE88Q2gdTKwxQr30vOOYX+tDuC/9HAtFGNSiHgy2NWOyKkDTraiXL0Jxg4 EozmBL8pljgzHPBRChZJSsBEwW49YKwhG5YOk0MPQ3hslJRKfNIfSZ0GvsbiLkx+FLLDfQ= X-Received: by 2002:a05:6a21:1517:b0:1e1:adb9:d1a6 with SMTP id adf61e73a8af0-1e5e08439e8mr13672764637.41.1734819894404; Sat, 21 Dec 2024 14:24:54 -0800 (PST) Received: from gnu-tgl-3.localdomain ([120.204.185.181]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad84877bsm5189310b3a.84.2024.12.21.14.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Dec 2024 14:24:54 -0800 (PST) Received: from gnu-tgl-3.lan (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 21C70C028A; Sun, 22 Dec 2024 06:24:51 +0800 (CST) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: Adhemerval Zanella Subject: [PATCH] elf: Suppress clang warning on tst-unique4 Date: Sun, 22 Dec 2024 06:24:48 +0800 Message-ID: <20241221222448.753529-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 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~patch=linaro.org@sourceware.org From: Adhemerval Zanella clang warns that the instantiation of the variable is required, but no definition is available. They are implemented on tst-unique4lib.so. Checked on x86_64-linux-gnu. --- elf/tst-unique4.cc | 6 ++++++ elf/tst-unique4lib.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/elf/tst-unique4.cc b/elf/tst-unique4.cc index 575c70d3a1..ab727b8dbb 100644 --- a/elf/tst-unique4.cc +++ b/elf/tst-unique4.cc @@ -2,7 +2,12 @@ #include "tst-unique4.h" #include +#include +/* clang warns that the instatiation of the variable is required, but no + definition is available. They are implemented on tst-unique4lib.so. */ +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wundefined-var-template"); static int a[24] = { S<1>::i, S<2>::i, S<3>::i, S<4>::i, S<5>::i, S<6>::i, S<7>::i, S<8>::i, @@ -10,6 +15,7 @@ static int a[24] = S<16>::i, S<17>::i, S<18>::i, S<19>::i, S<20>::i, S<21>::i, S<22>::i, S<23>::i, S<24>::i }; +DIAG_POP_NEEDS_COMMENT_CLANG; int main (void) diff --git a/elf/tst-unique4lib.cc b/elf/tst-unique4lib.cc index 17a7cdf567..2829e75cee 100644 --- a/elf/tst-unique4lib.cc +++ b/elf/tst-unique4lib.cc @@ -2,7 +2,7 @@ #include "tst-unique4.h" template -int S::i = N; +int S::i __attribute__ ((used)) = N; template const int S::j __attribute__ ((used)) = -1;