From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CB8B3382FE for ; Wed, 18 Feb 2026 22:51:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771455111; cv=none; b=rcdLiQHIoIND+hwUD/5jUJhpjO6KHEGM0tcVger/bvH1Sa5607eS20/qVv4Al9jmHCsRiEJjBMSzkLhn9gdZisVmhC9As5cLMEEoweSUCk0RT33N7n4gXalSv5BDMnPY3qy7kwP8WawzUSvYKrq3SfItelBF9LBpkMLmxKTDPx0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771455111; c=relaxed/simple; bh=gEGKZ8wN2zAEJ6fEX3ZvJZ1dmMDbXOcnShQF9T52kac=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=B0RQc5f/6QRfgtfe5DJ0m+yg2/iMNp5nrij7/KaLXPP3gTPfMv3BXAJCgGSSQcCrv2Gqk1cm1d7AaNLnyOYaA8FpsTz4Ews0DREJ90zL49XRH/CmbCuUXm9F/ZWvcNtSUWRNj0LmeGf5WuWYjyReHlbvKKTcMSukhx96tQbbD60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PE/Tgyf5; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PE/Tgyf5" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-43622089851so280790f8f.3 for ; Wed, 18 Feb 2026 14:51:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771455109; x=1772059909; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=lMD6wBn50cMY8YmFFBKo4THWNDSyvRuBcYyTOdb87Mo=; b=PE/Tgyf58pX6rrTJ9wVYn3/INB2Z3Cy3ozxonY+CAQRmTIo75vAjpFKV/s1CIWrK4D YnAjGHVOAc4h+h55IjR2u+SMJCu/8n8XPFnya+Az5jyS2oB0B4ZjIIvVv8+ifSEgsiSh YfADZBnL8FzZWL+hQlm30yAhvxpPgWRgFOK6kxnkAQF/fWjAIv9RB87EngPq50fZlquX t9hMrOfZKbdok15Ekyz/EnkgHZIPC0ifxt5bN0dAiKXXfCDfPIwRndieHHfIS1GhcjW+ Y7EdcLvL+b4sFIeY2ATxjRgw9UYhGiv15/p90qbSC9ymakhA0i0bU7ZbW9tmQh44wo4T tK3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771455109; x=1772059909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lMD6wBn50cMY8YmFFBKo4THWNDSyvRuBcYyTOdb87Mo=; b=ksH6q9o+C8hiYRoaXI5zzeHIrKvWYfmeFuaGnsr8DZi0Z18h3RVK6OZ0ZautENzbyt LkKDqjE1dvoZSN/qxj68vgpD9JHRnplIzBeESd3xvQR8AlQ3kgwVGg8FKL7tZFhIbjEM H8UzLYtnr2IoXG/e5V2XnSN3cZEdWXNPmPOLMPXoy+bgK9FLlucyvDjIKypJoH/j+wIn 1p+ZStSMKH/hMnFrCxg4gtS4vj9k6w7fmJz1B5MXlKDUCPk5797ikYi4uOe+CgCTs4Qq BdxlTLe86Ex25EXZTSb06GgWxv64XqMUrjw1t0UFSB1xmQq8mJcWNwrZBDo1NegoKa/N yCPw== X-Forwarded-Encrypted: i=1; AJvYcCVwpXPRMUbAVkjJ4rhr6o4/j8cBARH7Fp4ezJLYbofFvmbydwNgczYBy83gTT9sYORQUKC6smgGqakIbGY=@vger.kernel.org X-Gm-Message-State: AOJu0Yyox7oeTsxbN3LY/XAkMjfJsisow4J0CW0nU7c8QrEvo479tJlJ MpXPTZCnJdjWXN+r5IUPRotiPevzGJbAC7QoLgDaUvvm8BogiFffSCx/S0wWgMnT X-Gm-Gg: AZuq6aJjJiLxBI4+rB+pC5EY1GCSWTzGBvR+m1IA4yzzWBQ7R/bKsQcCmNkmL6MgQKy Y4Q/EZYndChgAf6TLhemt+ViC+RyQ+LsmLXPgUu+vNh/t9KToQvqB5AgcBfSSJaaLyiPNLLenfT M8v9htrXX9CThzBRAnbu2eeyRGMt8bFA+S1air2mGtYDPIBpA8ew58zewf/4nqtJ8rqspmrLbZ+ mNU61ETSILyrUuLIgOWq47jwQIWccdHpo6r2DR7n5oMbysdV2nfS6bkHlxMaVlFwu96Bvx3LmZ8 fbbXtpS2XLCG6lb3kGE0s3wPX1wd8qCw1+vR6R0IFMst0z1j3dVL0NsB4HQTU1V0CQkhaZBsbu8 8yaSCfeFua4bsrbgcA6EvB8mHikpssVmw5OzdppzMtFGrYX3qwjwfoaMCito2M4msRH96f7Rrjr 7qR/Jw4iB4yt8uuDPBb1avURdU4MuB0stWtM+vDBrP0Amr6U3Qd3VzcG5k/ZkvoxAF X-Received: by 2002:a5d:4488:0:b0:439:5e4d:baa3 with SMTP id ffacd0b85a97d-4395e4dbac7mr1885879f8f.11.1771455108533; Wed, 18 Feb 2026 14:51:48 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796abd259sm47238538f8f.24.2026.02.18.14.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 14:51:48 -0800 (PST) Date: Wed, 18 Feb 2026 22:51:46 +0000 From: David Laight To: Thomas =?UTF-8?B?V2Vpw59zY2h1aA==?= Cc: Willy Tarreau , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH] selftests/nolibc: Fix build with host headers and libc Message-ID: <20260218225146.0cd1970c@pumpkin> In-Reply-To: <42fdf959-8c65-4a7b-b877-0fbc32b6362b@t-8ch.de> References: <20260214115724.3305-1-david.laight.linux@gmail.com> <5f38b16b-1abf-4e22-92f1-9dc086c72e55@t-8ch.de> <20260216222118.5bc39904@pumpkin> <42fdf959-8c65-4a7b-b877-0fbc32b6362b@t-8ch.de> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 18 Feb 2026 18:23:33 +0100 Thomas Wei=C3=9Fschuh wrote: > On 2026-02-16 22:21:18+0000, David Laight wrote: > > On Mon, 16 Feb 2026 19:51:24 +0100 > > Thomas Wei=C3=9Fschuh wrote: > > =20 > > > On 2026-02-14 11:57:24+0000, david.laight.linux@gmail.com wrote: =20 > > > > From: David Laight > > > >=20 > > > > Many systems don't have strlcpy() or strlcat(). > > > > Change is_nolibc to a #define so that the calls are optimised out. > > > > Create #define wrappers so the code is syntactially valid. > > > >=20 > > > > Additionall readdir_r() is likely to be marked deprecated. =20 > > >=20 > > > "Additionally" > > > =20 > > > > So disable "-Wdeprecated-declarations". =20 > > >=20 > > > Could you split this into multiple patches? > > > =20 > > > > Fixes: 6fe8360b16acb ("selftests/nolibc: also test libc-test throu= gh regular selftest framework") > > > > Signed-off-by: David Laight > > > > --- > > > > tools/testing/selftests/nolibc/nolibc-test.c | 13 +++++++++---- > > > > 1 file changed, 9 insertions(+), 4 deletions(-) > > > >=20 > > > > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/t= esting/selftests/nolibc/nolibc-test.c > > > > index 1b9d3b2e2491..eb2421b42e75 100644 > > > > --- a/tools/testing/selftests/nolibc/nolibc-test.c > > > > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > > > > @@ -66,13 +66,18 @@ static const char *argv0; > > > > /* will be used by constructor tests */ > > > > static int constructor_test_value; > > > > =20 > > > > -static const int is_nolibc =3D > > > > #ifdef NOLIBC > > > > - 1 > > > > +#define is_nolibc 1 > > > > #else > > > > - 0 > > > > +#define is_nolibc 0 > > > > +/* strlcat() and strlcpy() may not be in the system headers. */ > > > > +#undef strlcat > > > > +#undef strlcpy > > > > +#define strlcat(d, s, l) 0 > > > > +#define strlcpy(d, s, l) 0 > > > > +/* readdir_r() is likely to be marked deprecated */ > > > > +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" > > > > #endif =20 > > >=20 > > > I'd prefer to disable this via $(cc-option) in the Makefile. > > > Unknown pragmas tend to introduce more warnings. =20 > >=20 > > There is already a similar pragma in the file and this one isn't a new = one warning. =20 >=20 > Fair enough, then this is fine. Maybe I'll clean it up at some point. That one is actually to avoid the warnings for a visible function with no p= rototype. The readir_r() test is probably best made is_nolibc only and a #define used so that the code compiles. Changing is_nolibc to #define isn't enough to help either. It isn't needed if the strcpy/strlcat/readdir_r are #defined away. David >=20 > (...)