Hi,

From: Martijn van Duren <openbsd+po...@list.imperialat.at>
Date: Mon, 14 Sep 2020 10:43:28 +0200

> I did some bisecting and it seems that the update to clang 10 broke
> valgrind. Specifically /usr/local/lib/valgrind/memcheck-amd64-openbsd:
> 
> $ ktrace -i /usr/local/lib/valgrind/memcheck-amd64-openbsd
> Abort trap 
> $ kdump 
>  12913 ktrace   RET   ktrace 0
>  12913 ktrace   CALL  execve(0x7f7ffffc6fca,0x7f7ffffc6e68,0x7f7ffffc6e78)
>  12913 ktrace   NAMI  "/usr/local/lib/valgrind/memcheck-amd64-openbsd"
>  12913 ktrace   ARGS  
>         [0] = "/usr/local/lib/valgrind/memcheck-amd64-openbsd"

Now, I am debugging this problem.

> Compiling valgrind with CC=gcc gives the same result, so my guess is
> that the linker does something unexpected.

Your guess is correct.

Anyway, the following changes seems to work correctly.
I will report the patch to this mailing list in the next few days.

--- a/devel/valgrind/patches/patch-coregrind_link_tool_exe_openbsd_in
+++ b/devel/valgrind/patches/patch-coregrind_link_tool_exe_openbsd_in
@@ -10,7 +10,7 @@
 +# strip command rewrite offset and align in ELF file. Therefor, when valgrind
 +# launch memcheck-amd64-openbsd, an Abort trap occurs in the execvp() system
 +# call.
-+my $cmd = sprintf "$cc -static -nopie -Wl,--strip-all -Wl,-Ttext=0x%x 
-Wl,-T,$temp", $textbase;
++my $cmd = sprintf "$cc -static -nopie -Wl,--strip-all -Wl,-Ttext=0x%x", 
$textbase;
  
  # Add the rest of the parameters
  foreach my $n (2 .. $#ARGV) {
--
ASOU Masato

Reply via email to