You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to cross-compile riscv64 Hello world program in c under wsl2 #19107
wrongnull@DESKTOP-22AKPRT:~$ uname -a
Linux DESKTOP-22AKPRT 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
wrongnull@DESKTOP-22AKPRT:~$ cat test.c
#include <stdio.h>
int main() {
printf("Hello wrold\n");
}
wrongnull@DESKTOP-22AKPRT:~$ zig cc test.c -target riscv64-linux-gnu
projects/zig/build/stage3/lib/zig/libc/glibc/sysdeps/riscv/start-2.33.S:48:2: error: unknown directive
.cfi_label .Ldummy
^
In file included from test.c:1:
In file included from projects/zig/build/stage3/lib/zig/libc/include/generic-glibc/stdio.h:27:
In file included from projects/zig/build/stage3/lib/zig/libc/include/generic-glibc/bits/libc-header-start.h:33:
In file included from projects/zig/build/stage3/lib/zig/libc/include/generic-glibc/features.h:539:
projects/zig/build/stage3/lib/zig/libc/include/riscv64-linux-gnu/gnu/stubs.h:17:11: fatal error: 'gnu/stubs-lp64d.h' file not found
17 | # include <gnu/stubs-lp64d.h>
| ^~~~~~~~~~~~~~~~~~~
@kassane Yes, that PR does in fact fix this. I've used my PR to produce RISC-V glibc linked binaries. However, I have run into some other unrelated issues with RISC-V due to LLVM.
I rebuilt the compiler just now and current zig version is 0.12.0-dev.7529+bd0dbb0a1
However, the original issue is still stands but fix mentioned above works fine. Thank you @RossComputerGuy
In addition, compiling without glibc works for me.
I think I'll leave this issue open until it's fixed in master.
Activity
slonik-az commentedon Feb 27, 2024
WoW:
-dev.7512? The current nightly build is0.12.0-dev.3033+031f23117. Where are the extra 4000 commits coming from? What branch are you compiling?kassane commentedon Feb 27, 2024
possible fix:
Please, try same test on
riscv64-linux-musl, for now.RossComputerGuy commentedon Feb 27, 2024
@kassane Yes, that PR does in fact fix this. I've used my PR to produce RISC-V glibc linked binaries. However, I have run into some other unrelated issues with RISC-V due to LLVM.
nektro commentedon Feb 27, 2024
085bde6 is the most recent as of yesterday @slonik-az, am also surprised at the jump tho
wrongnull commentedon Feb 27, 2024
I rebuilt the compiler just now and current
zig versionis0.12.0-dev.7529+bd0dbb0a1However, the original issue is still stands but fix mentioned above works fine. Thank you @RossComputerGuy
In addition, compiling without glibc works for me.
I think I'll leave this issue open until it's fixed in master.
RossComputerGuy commentedon Feb 27, 2024
You're welcome, but btw this issue will likely close as this is a duplicate of #3340.