public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich <geomatsi@gmail.com>
To: thecharlesjenkins@gmail.com
Cc: Shuah Khan <shuah@kernel.org>, Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Andy Chiu <andybnac@gmail.com>, Deepak Gupta <debug@rivosinc.com>,
	linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/4] selftests: riscv: Fix compilation issues for v_ptrace and cfi
Date: Tue, 10 Mar 2026 00:21:14 +0300	[thread overview]
Message-ID: <aa85yl-c2suNF5LO@curiosity> (raw)
In-Reply-To: <20260305-fix_selftests-v1-0-61b62d23500b@gmail.com>

Hello Charlie,

On Thu, Mar 05, 2026 at 12:11:28AM -0800, Charlie Jenkins via B4 Relay wrote:
> There are a couple of compilation issues of the riscv selftests.
> Coincidentally two of the issues are independent problems with not
> including the header that includes the BIT() macro and the other issue
> is from checkpatch incorrectly suggesting to remove non-redundant
> braces.
> 
> Signed-off-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
> ---
> Charlie Jenkins (4):
>       selftests: riscv: Add definition of BIT() macro
>       selftests: riscv: Add braces around EXPECT_EQ()
>       riscv: ptrace: Fix BIT() compilation issues
>       selftests: riscv: Add license to cfi selftest
> 
>  arch/riscv/include/uapi/asm/ptrace.h                     |  1 +
>  tools/testing/selftests/riscv/cfi/Makefile               |  2 ++
>  tools/testing/selftests/riscv/vector/Makefile            |  2 ++
>  tools/testing/selftests/riscv/vector/validate_v_ptrace.c | 16 ++++++++++------
>  4 files changed, 15 insertions(+), 6 deletions(-)
> ---
> base-commit: c107785c7e8dbabd1c18301a1c362544b5786282
> change-id: 20260304-fix_selftests-c3f0ae46b3c7
> 
> Best regards,
> -- 
> Charlie Jenkins <thecharlesjenkins@gmail.com>

Thanks for catching this !

On rc3 I can also reproduce the issue reported by the kernel test robot
for v_exec_initval_nolibc.c and vstate_exec_nolibc.c. The following
addition to your fixes seems to resolve it:

diff --git a/tools/testing/selftests/riscv/vector/Makefile b/tools/testing/selftests/riscv/vector/Makefile
index 92c4cfe5f34d..48d6cd5e72f6 100644
--- a/tools/testing/selftests/riscv/vector/Makefile
+++ b/tools/testing/selftests/riscv/vector/Makefile
@@ -22,15 +22,13 @@ $(OUTPUT)/vstate_prctl: vstate_prctl.c $(OUTPUT)/sys_hwprobe.o $(OUTPUT)/v_helpe
 	$(CC) -static -o$@ $(CFLAGS) $(LDFLAGS) $^
 
 $(OUTPUT)/vstate_exec_nolibc: vstate_exec_nolibc.c
-	$(CC) -nostdlib -static -include ../../../../include/nolibc/nolibc.h \
-		-Wall $(CFLAGS) $(LDFLAGS) $^ -o $@ -lgcc
+	$(CC) -static -o$@ $(CFLAGS) $(LDFLAGS) $^
 
 $(OUTPUT)/v_initval: v_initval.c $(OUTPUT)/sys_hwprobe.o $(OUTPUT)/v_helpers.o
 	$(CC) -static -o$@ $(CFLAGS) $(LDFLAGS) $^
 
 $(OUTPUT)/v_exec_initval_nolibc: v_exec_initval_nolibc.c
-	$(CC) -nostdlib -static -include ../../../../include/nolibc/nolibc.h \
-		-Wall $(CFLAGS) $(LDFLAGS) $^ -o $@ -lgcc
+	$(CC) -static -o$@ $(CFLAGS) $(LDFLAGS) $^
 
 $(OUTPUT)/vstate_ptrace: vstate_ptrace.c $(OUTPUT)/sys_hwprobe.o $(OUTPUT)/v_helpers.o
 	$(CC) -static -o$@ $(CFLAGS) $(LDFLAGS) $^
diff --git a/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c b/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c
index 4dde05e45a04..e3f062c85452 100644
--- a/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c
+++ b/tools/testing/selftests/riscv/vector/v_exec_initval_nolibc.c
@@ -9,6 +9,10 @@
  * To be "clean" all values must be all zeroes.
  */
 
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
 #define __stringify_1(x...)	#x
 #define __stringify(x...)	__stringify_1(x)
 
diff --git a/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c b/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c
index 12f1b1b1c7aa..ecd687bb8359 100644
--- a/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c
+++ b/tools/testing/selftests/riscv/vector/vstate_exec_nolibc.c
@@ -1,6 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
-#include <linux/wait.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <sys/prctl.h>
+#include <sys/wait.h>
 
 #define THIS_PROGRAM "./vstate_exec_nolibc"


Regards,
Sergey

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2026-03-09 21:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05  8:11 [PATCH 0/4] selftests: riscv: Fix compilation issues for v_ptrace and cfi Charlie Jenkins via B4 Relay
2026-03-05  8:11 ` [PATCH 1/4] selftests: riscv: Add definition of BIT() macro Charlie Jenkins via B4 Relay
2026-03-05 16:10   ` kernel test robot
2026-03-05  8:11 ` [PATCH 2/4] selftests: riscv: Add braces around EXPECT_EQ() Charlie Jenkins via B4 Relay
2026-03-05  8:11 ` [PATCH 3/4] riscv: ptrace: Fix BIT() compilation issues Charlie Jenkins via B4 Relay
2026-03-05  8:11 ` [PATCH 4/4] selftests: riscv: Add license to cfi selftest Charlie Jenkins via B4 Relay
2026-03-09 21:21 ` Sergey Matyukevich [this message]
2026-03-10  1:45   ` [PATCH 0/4] selftests: riscv: Fix compilation issues for v_ptrace and cfi Charlie Jenkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa85yl-c2suNF5LO@curiosity \
    --to=geomatsi@gmail.com \
    --cc=andybnac@gmail.com \
    --cc=debug@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=shuah@kernel.org \
    --cc=thecharlesjenkins@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox