From patchwork Tue Dec 17 22:55:35 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: 103310 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 8929C385841C for ; Tue, 17 Dec 2024 22:56:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8929C385841C 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=Ple3Qjer X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id 8BC1A3858C51 for ; Tue, 17 Dec 2024 22:55:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BC1A3858C51 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 8BC1A3858C51 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734476140; cv=none; b=GonKCjW9Lq2YmYZgq/tbGmdtj8w0xqAkY9JLcJy1bA7xjsg0z6hGuJa9a6HjtCS212qUT0TL9wOEWxJ6zP+l928u89m/A28RQrW1UIlzUUBJM3LhiVnklu0+iogeqmzcVMlqH5llLDyryVZhoc5q1IuP6P3CKfNUBG63w/v0DM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734476140; c=relaxed/simple; bh=cq04BUPFYGM+OS0GekuWdkC4uL54UHcsuKU8qjCRVPI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=yAuBF4m0Vy2qdqmFcbbeT2HnALV//VZnRNDcntvWbCCrmQGTAZh/iD4YXoIExsa/MFbxEHANomTTP0WOExvvJlx+slouJvSQ1UIdcfvR4kE17C8gwavIklTc6mckvrkyvnpBuA2p4LwQqOiX9OPLK1H5WsuGLxBfWGas+cjQQKA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BC1A3858C51 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-3ad272538e8so789095ab.1 for ; Tue, 17 Dec 2024 14:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734476140; x=1735080940; 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=A7hpHsnS+f7EMFf9qz75RifvCYCjNvUsvulvaGtclo8=; b=Ple3Qjer2C8QdsFRLZzuYUyFTSacfRQ9mpR7pUobU/Zx6QBV4tvB9i1zsR7hpU2jOy +c31NXFU7VUkMRjbshkCskotXVNX+9aN1pJP1URFBDp1zemkcepF6G6IbJqLa5WR0+Ef p5YhwDJl3+OGYs/w7qJrTl7DO6FxDqOTxK24znpz43t0OH9cy9n0jmOl75n9bffkojsB KuWBZVD4YeRuEigxGpqAsweKgRUF7EpfZ7zS8DNFKs6lBrW0YSgBs3dMnADMPwGOJW0+ dxXbJGmWPcDxGxZ+Jmq/xL7vwYj5iSf03tb8G0EBvonZX0M0/PvAaikZIdRxYEQjpUho bhFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734476140; x=1735080940; 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=A7hpHsnS+f7EMFf9qz75RifvCYCjNvUsvulvaGtclo8=; b=cbpMVwukpItHJ03/n4uraICi8n57EphmqpHDjxxGKuyjxnb0VSN1AKUgC/v5eIGhA0 BKiaE8+R/Trjiw+2C/TPh+9ya0oCwbaaYfgZID0DRRJGGdqkcyi1nkGm0DkBWA79i51O R9ChTX0t05SkKpHzUBFoW95UqUm8BPqop9BLbik4fRIu0wZCkvAcsYtFK3YwRXCyjOrH fRZIUgZJkyKkAxSPv2vZXJZuuAmlxt5Kv2M19odQma1dcl2F6T1cYecHFIaJfnYlZXKA swJ/pYMmztgLFY3i928yiD3qtUK8Xek5tI6/XVT0zG7axPIoduMeZa+9tx19oWCqNLGp Gi3w== X-Gm-Message-State: AOJu0YxqLqW0devrLDwqAEEhjqXRLFN3wGvg/gk62o+3T+UshQ8pUu7q 5I6qoF7Xim9L0caNAno7PQU56uUbaw/AixKroS7N1526sI+xlF5tSPVoRDCelhaTRH/N X-Gm-Gg: ASbGncsYOer3jwz08EZkGtHYWOPpqfFy6Hy+mi5v+j9pDStKIFFoz/KFd1lU3ghs16u /eHVNX6SDf03ShXDXsFg/1W5qQXLoE3/V/PsG6XHo7dMxUY+SKmzXfZvJ6o+Loe8kvK8r5qJpz5 Hm9zKeAGfB/ngBFn9i+G63f4sOQwi8e/8DSzcqtMBN19RH/zqaiv2WJGSRXTy7HqmOao0IZlnjM VtpiLcPeHHZPdH7lgD6fh7/cwLhYUKRmv91jem26xqvbjPq+VnzenqHSfbAVPc01h77QBDUkdwM +kUm5pyWhnuiy5Y= X-Google-Smtp-Source: AGHT+IFfFcdSAepeptGhZpA9Zilda3skx77BCiIOqz5k/ddrysjB61WRohzQFnlgB/DCY+Vl1cDMGg== X-Received: by 2002:a05:6e02:d42:b0:3a9:d32c:d312 with SMTP id e9e14a558f8ab-3bb0a54e1c0mr36664795ab.9.1734476139753; Tue, 17 Dec 2024 14:55:39 -0800 (PST) Received: from gnu-tgl-3.localdomain ([172.58.27.61]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e5e036866fsm1919722173.22.2024.12.17.14.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 14:55:39 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 9A8BDC013B; Wed, 18 Dec 2024 06:55:35 +0800 (CST) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: sam@gentoo.org Subject: [PATCH v2] Replace __strcpy_chk with __builtin___strcpy_chk Date: Wed, 18 Dec 2024 06:55:35 +0800 Message-ID: <20241217225535.2558707-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3017.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, 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~patchwork=sourceware.org@sourceware.org Although _chk functions are exported in libc.so.6, their prototypes aren't provided. Their built versions are supported by compiler. Replace __strcpy_chk with __builtin___strcpy_chk to silence Clang error: ./tst-gnuglob-skeleton.c:225:3: error: call to undeclared function '__strcpy_chk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 225 | __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX); | ^ Signed-off-by: H.J. Lu Reviewed-by: Siddhesh Poyarekar --- posix/tst-glob_lstat_compat.c | 3 ++- posix/tst-gnuglob-skeleton.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c index 6ea3b062f0..752a8c8707 100644 --- a/posix/tst-glob_lstat_compat.c +++ b/posix/tst-glob_lstat_compat.c @@ -173,7 +173,8 @@ my_readdir (void *gdir) dir->d.d_type = filesystem[dir->idx].type; - __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX); + __builtin___strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, + NAME_MAX); ++dir->idx; diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c index 145744199b..31e0c136b8 100644 --- a/posix/tst-gnuglob-skeleton.c +++ b/posix/tst-gnuglob-skeleton.c @@ -222,7 +222,8 @@ my_readdir (void *gdir) dir->d.d_type = filesystem[dir->idx].type; - __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX); + __builtin___strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, + NAME_MAX); if (test_verbose > 0) printf ("info: my_readdir ({ level: %d, idx: %ld })"