From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1917E15957D; Wed, 28 Aug 2024 11:36:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724844967; cv=none; b=sRZbs5cFMEv86bARfuuMUsscdbgiMYx7MoFQ7pSuwf8XkwwYEQxwUbXlaPcfJJnYF8zJUhSZB5vlFUvLorPmrgQLSNZedBptWzXvulR0U25GWwL2Zh/FYQ7zwmedMYLw0QLH0HavjsO1DAdlKA2f0zpyfvWthoc3xa6uooQ3aSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724844967; c=relaxed/simple; bh=MCX8KbsK5VIxrU/S+71wstTVdHgKSX2vfDlE+H6TXds=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lg137s0TJpqdBi/Bh8TwWZJ7CzC9/hRmO/wYSXBlYiucVugE3loEsymuegLs0y830yEbxYFEdfX1ZpH2V6AT3WO6gqeaECYVYAfw3WeEcinL73oFJpp66rsadP9rTqMstCFjF6BOb6m0Xu3fLooTeBOeyDHJ29YnkKioSfcMl6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b=pKfSIyCn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="pKfSIyCn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87737C98ECC; Wed, 28 Aug 2024 11:36:05 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="pKfSIyCn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1724844963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0cLAo5gHHcmsu8sLuh4KjlSFYke2JQqCM5R6rEMln4U=; b=pKfSIyCnSkeyDjQPIhtTOMpBEItpbkMJXA92xNABSqzabCNC47+FJQfR2ozwxnhbQy3DKl XMWWZYm4uFKSfGx1P32BjX3PIsAGSEbSQRGYWvZH9oplcykdn85qa33DxdsLHTW6dMrwyd rtsMdo9s4GIyWFqFn1zhRrKGHrYlO68= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 82d6876f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 28 Aug 2024 11:36:03 +0000 (UTC) Date: Wed, 28 Aug 2024 13:36:03 +0200 From: "Jason A. Donenfeld" To: Xi Ruoyao Cc: Christophe Leroy , Huacai Chen , WANG Xuerui , "linux-crypto@vger.kernel.org" , "loongarch@lists.linux.dev" , Jinyang He , Tiezhu Yang , Arnd Bergmann , "tglx@linutronix.de" , "linux-kselftest@vger.kernel.org" Subject: Re: [PATCH v4 3/4] selftests/vDSO: Use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom Message-ID: References: <019268d4-c177-49e7-aab3-b8fa431905ca@cs-soprasteria.com> <0730ca3a-e158-44ea-bb9e-1a7716b45360@csgroup.eu> <0b540679ec8cfccec75aeb3463810924f6ff71e6.camel@xry111.site> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Aug 27, 2024 at 05:29:56PM +0200, Jason A. Donenfeld wrote: > On Tue, Aug 27, 2024 at 5:29 PM Xi Ruoyao wrote: > > Or, I can add $(KHDR_INCLUDES) but also keep > > -isystem $(top_srcdir)/include/uapi, so "make -C tools/testing/selftests > > TARGETS=vDSO" will still (happens to) work on x86 and ppc (without > > headers in kernel-tree/usr). > > Oh, the porquenolosdos solution. That sounds good to me. Does the below work for you? >From 0a769491e0193cdf9728a23d02be5e6be975b513 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 28 Aug 2024 13:29:57 +0200 Subject: [PATCH] selftests/vDSO: use KHDR_INCLUDES to locate UAPI headers for vdso_test_getrandom Building test_vdso_getrandom currently leads to following issue: In file included from /home/xry111/git-repos/linux/tools/include/linux/compiler_types.h:36, from /home/xry111/git-repos/linux/include/uapi/linux/stddef.h:5, from /home/xry111/git-repos/linux/include/uapi/linux/posix_types.h:5, from /usr/include/asm/sigcontext.h:12, from /usr/include/bits/sigcontext.h:30, from /usr/include/signal.h:301, from vdso_test_getrandom.c:14: /home/xry111/git-repos/linux/tools/include/linux/compiler-gcc.h:3:2: error: #error "Please don't include directly, include instead." 3 | #error "Please don't include directly, include instead." | ^~~~~ It's because the compiler_types.h inclusion in include/uapi/linux/stddef.h is expected to be removed by the header_install.sh script, as compiler_types.h shouldn't be used from user space. Add KHDR_INCLUDES before the existing include/uapi inclusion so that usr/include takes precedence if it's populated. Signed-off-by: Xi Ruoyao Signed-off-by: Jason A. Donenfeld --- tools/testing/selftests/vDSO/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile index d1452c7d6d4f..13a626ef64f7 100644 --- a/tools/testing/selftests/vDSO/Makefile +++ b/tools/testing/selftests/vDSO/Makefile @@ -39,6 +39,7 @@ $(OUTPUT)/vdso_test_correctness: LDFLAGS += -ldl $(OUTPUT)/vdso_test_getrandom: parse_vdso.c $(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \ + $(KHDR_INCLUDES) \ -isystem $(top_srcdir)/include/uapi $(OUTPUT)/vdso_test_chacha: $(top_srcdir)/tools/arch/$(ARCH)/vdso/vgetrandom-chacha.S -- 2.46.0