Skip to content

Unable to cross-compile riscv64 Hello world program in c under wsl2 #19107

Closed
@wrongnull

Description

@wrongnull

Zig Version

0.12.0-dev.7512+085bde688

Steps to Reproduce and Observed Behavior

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>
      |           ^~~~~~~~~~~~~~~~~~~

Expected Behavior

Compiles successfully

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-riscv32-bit and 64-bit RISC-VbugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions