From patchwork Tue Dec 31 18:26:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 854386 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7048313wrq; Tue, 31 Dec 2024 10:27:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXc7U1xkGMVpvPoNLAriz/NiFSIYqEPMkmylz/IKtnkz+Cde12d+0C141D5wdNg7P5l9OLqgg==@linaro.org X-Google-Smtp-Source: AGHT+IGB427cQA5zGXJehdYN5AiTGIu3LU3TBRujLVY6LUbFTquVJNdLEYe4dS5E6EGP+GLSOa62 X-Received: by 2002:a05:6214:c4f:b0:6cb:20b6:f398 with SMTP id 6a1803df08f44-6dd2334c4c4mr591604086d6.21.1735669642589; Tue, 31 Dec 2024 10:27:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1735669642; cv=pass; d=google.com; s=arc-20240605; b=aNe33xkMOJW853aKWaMTKktDrBK9QoHPivWev9jaJFnW04snjpp894nhvnYf9Sx+wc 1CT15+Ei51uzgHqOtokXythXoNLB2WE02hfWWZUmlHjoiVA2a+l+rIoz1XLBsg+OBBU3 U2/qTWRI+vEBSawxTOH3lzeEuallhivmJVB06DcJ2fuJLnc6WmkZCF7GZ0lzn+bh/D+N G5vMIpTW9cw8g2cwOW0eMrafGhiH/AmfbvfF7r/tB4ymCxktCCExQqRg6N12gZP2thaL dWZRQa947eNxBRSu+lXu748QEVjlYpaZLbVBzvrIHV5miBCvIvvdpmmKKU1VJO8i9J/7 h5yg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter:arc-filter:dmarc-filter :delivered-to:dkim-filter; bh=RxukHwZqjI2ZLvMNuFcyK3eIn86L5cWKbLJxgON8enQ=; fh=d7KdQ+eBG5Owb97PZQUBRjccSsV/hB6hMlyGG6W37vA=; b=RidDxdjYqW+ZuESBEjVZRLNH7kbSiqoR0ABVeyJ3xdf97wp1eT5JY1eR64ztK/kvu9 BcMPC3ZpKS1i027X8OwMqTa/jbybTVZI1MB8Wju3TljIbXtb59rDcI6dgHY6vYEMRqlx uz9A8teqnuBVy+SCXxhm0ADqOh2PzPEHVDI3gWhzt7ShJEpWOHmlN8endCP3TlKKUszQ krOJaR+Lb/rlBesmidz9jCsZQxdupqxMs4s6x8EQPpR+1VC89JzSfjZhgqfDmWWPLE4E xfoMJyaMje/bsNS8hY4l0nCSQoYtAy7YSdDJ1JhsRdbRNw3pGFo57VphZgAeCegyezL8 qSqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UZJm9BSE; 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=NONE dis=NONE) header.from=linaro.org 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-6dd18234c09si294640746d6.251.2024.12.31.10.27.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Dec 2024 10:27:22 -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=@linaro.org header.s=google header.b=UZJm9BSE; 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=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F85A3858C2B for ; Tue, 31 Dec 2024 18:27:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F85A3858C2B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=UZJm9BSE X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 123A23858D20 for ; Tue, 31 Dec 2024 18:26:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 123A23858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 123A23858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735669618; cv=none; b=bHSbE4GL38jOtQocjaAz4y4hTnj8HNWDFaCe7tNG+34Fudcv7CxYsRXmE2iRDlrv2t1NqJJMVKCCR+iqHaURxAHoO9cZLInxMiNA/DMvc5jK+P/px1bflXmL98CV8QKGtYj3AjL7R3FA4TrzC73RazQx7G4ZmsjbzEzptUsOmfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735669618; c=relaxed/simple; bh=t88mJ5HDBDMhYHu5Cr9YWPv69Vja78iW/V+5jUUyf1I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=W8EFAcmVtq9Cfpe3rP9GjcNW6XKa+slhXDQ+fJZI8opypJs2jVfxnRnAqij3LWGhcflsXAu+RD+w8jmAw8R6cJWZ+3pzgIrDqoVRzL2tZnSuAdZr/DUDJk9KeMSpHc6tEHQKmXbpKiV9p4/yfW+mcMJZmrJXfJj40dfbZPNK9pY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 123A23858D20 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2161eb94cceso95669815ad.2 for ; Tue, 31 Dec 2024 10:26:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735669616; x=1736274416; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RxukHwZqjI2ZLvMNuFcyK3eIn86L5cWKbLJxgON8enQ=; b=UZJm9BSE6uWIUYUnC8QG0HKcGinoeP+fhob77mFUcL2O7PfoxNTkPsUd/bQ6nKi4Bu qI8JJN9RRRux0et3c4A/YLp1hhjxHnJgM1l/lHaiYRCFdUpjsDiCL9RFTNV3CKbqwEKW Wc4wlJVV7/b05uGq/xKE2s11KMtCCWT0wRatVKLE1UmjzcLZJJa/jx1pY86BbnrxSxY/ SUNZE7Nple1VFUnjn2FNdzSNnIWESajEr4AI6cYAJRv6sBvAmW2w+F/zRbGY8DBEo/NF R9qy+vEH3Boy0reL97txXKVo7KPK7gfwnsnfCWxmOmNVKRQ2wdyop+/nrtMXVSf3Q0fP DlzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735669616; x=1736274416; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RxukHwZqjI2ZLvMNuFcyK3eIn86L5cWKbLJxgON8enQ=; b=NwxeingwTQI79zN6idsMbUCljCuGra2pLVVnCBM7SD1t9KIzQZQZGUFmOJcQUxJVJr uJFP1XjIbWRYx80zyGkraXpgr3ytwqGJlLDc8AkvmawIT9ZebQ6fxhhZuiyUTbxH+JUa QwW4ZvGNpQGiooMfXckHxa+E8Nggx1HipHzri2ZJIgpvHc5/UIfS14zcB0nHdTCqL5iP tJn3kP4QwSVO9a4thnSCWTyygz7cA/t7VRD7qK7tGkRcgKSChRZnK5YJ0zqSYbHZbAar LGj7HHRJQkcSFX7uVpizn2EVwCWfwgzRxnEB0KVEnwcoBefbWofyowZ/JNC/mgGgO1SO cJqw== X-Gm-Message-State: AOJu0Yx3xZfwYe+VgsBOu8nIKiKvBlbmfxprRDbHyCC5Us1I4MhpqFq5 HffHxIKnHo4bn1pLLBfeQ0e5fCVkVHKVa9zxg6cy0PWPEZD+pA7jdIHc7EfJgCC6E24xNFVZ2ST E X-Gm-Gg: ASbGnctOwbaz598r4wYZ6PEK1ipLGuucEdOA5AwYRsleIJNG37Qnto9xcAa9OZsCkZC XXMi2hAMSISkt1/7KdJBXKXQWnbvlp3WgxfNktMdtK/6X8yZK2QxyqmtrQkXRv1AM3d4dWsgbV0 Tej6i0KfPeRFl/o5eVr4mfxLyyaEIxLsaYxw64sNe+tlDcN7IJsx5ePd+vonXOFiFJ1HWjWY+Q9 QdDp1YY9YWXNiQYpeg6Qac7s3a3cfOV3iRR7ZDfxhjItvaWM6JS5YjsQ4zj4+ZrN8Yal03sxF/w 5Z05YrYXPFNWDMDglLgwLLlT5ln1 X-Received: by 2002:a17:902:ce92:b0:215:5ea2:6544 with SMTP id d9443c01a7336-219e6e8c365mr480376315ad.7.1735669616343; Tue, 31 Dec 2024 10:26:56 -0800 (PST) Received: from ubuntu-vm.. (201-92-184-234.dsl.telesp.net.br. [201.92.184.234]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9f5046sm198693105ad.179.2024.12.31.10.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Dec 2024 10:26:55 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Sam James , "H . J . Lu" Subject: [PATCH 1/7] Fix internal tests when building with clang Date: Tue, 31 Dec 2024 15:26:07 -0300 Message-ID: <20241231182649.1811734-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241231182649.1811734-1-adhemerval.zanella@linaro.org> References: <20241231182649.1811734-1-adhemerval.zanella@linaro.org> 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 When building internal tests, clang fails with: ../include/string.h:183:44: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] 183 | extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy"); | ^ ../string/bits/string_fortified.h:42:8: note: previous definition is here 42 | __NTH (mempcpy (void *__restrict __dest, const void *__restrict __src, | ^ Because memcpy might be already defined if glibc is build with fortify support. The straighforward solution is just to avoid this indirection for internal tests, since it is not required. Checked on aarch64-linux-gnu. --- include/string.h | 4 +++- scripts/gen-as-const.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/string.h b/include/string.h index 3b4c6007d7..003636b75b 100644 --- a/include/string.h +++ b/include/string.h @@ -175,7 +175,9 @@ extern __typeof (strnlen) strnlen attribute_hidden; extern __typeof (strsep) strsep attribute_hidden; #endif -#if (!IS_IN (libc) || !defined SHARED) \ +/* Also exclude tests and related modules. */ +#if ((!IS_IN (libc) || !defined SHARED) \ + && !(IS_IN (testsuite_internal) || IS_IN (extramodules))) \ && !defined NO_MEMPCPY_STPCPY_REDIRECT /* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call __mempcpy and __stpcpy if not inlined. */ diff --git a/scripts/gen-as-const.py b/scripts/gen-as-const.py index 2f6b09d05b..17d08dd5a2 100644 --- a/scripts/gen-as-const.py +++ b/scripts/gen-as-const.py @@ -38,7 +38,8 @@ def gen_test(sym_data): for arg in sym_data: if isinstance(arg, str): if arg == 'START': - out_lines.append('#include \n' + out_lines.append('#define NO_MEMPCPY_STPCPY_REDIRECT\n' + '#include \n' '#include \n' '#include \n' '#if __WORDSIZE == 64\n'