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
I'm trying to compile a sample app in Rust targeting riscv64. It is essentially a copy of "hello_world" from "samples" dir, without modifications. Everything seems to proceed just fine until I get the error, as shown below:
$ west build -b qemu_riscv64
[1/9] Building Rust application
Finished `release` profile [optimized] target(s) in 3.21s
[2/7] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/cordawyn/projects/zephyrproject/try-zephyr/build/zephyr/zephyr_pre0.map
: && ccache /home/cordawyn/zephyr-sdk-0.17.0/riscv64-zephyr-elf/bin/riscv64-zephyr-elf-gcc -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/riscv/core/offsets/offsets.c.obj -T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=/home/cordawyn/projects/zephyrproject/try-zephyr/build/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/riscv/core/libarch__riscv__core.a zephyr/lib/libc/picolibc/liblib__libc__picolibc.a zephyr/lib/libc/common/liblib__libc__common.a zephyr/drivers/interrupt_controller/libdrivers__interrupt_controller.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a -L/home/cordawyn/projects/zephyrproject/try-zephyr/build/zephyr -lgcc -Wl,--allow-multiple-definition rust/target/riscv64imac-unknown-none-elf/release/librustapp.a zephyr/arch/common/libisr_tables.a -mcmodel=medany -mabi=lp64 -march=rv64imac_zicsr_zifencei -fuse-ld=bfd -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -Wl,-no-pie -specs=picolibc.specs -DPICOLIBC_LONG_LONG_PRINTF_SCANF -L"/home/cordawyn/zephyr-sdk-0.17.0/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/rv64imac_zicsr_zifencei/lp64/medany" -lc -lgcc && cd /home/cordawyn/projects/zephyrproject/try-zephyr/build/zephyr && /usr/bin/cmake -E true
/home/cordawyn/zephyr-sdk-0.17.0/riscv64-zephyr-elf/bin/../lib/gcc/riscv64-zephyr-elf/12.2.0/../../../../riscv64-zephyr-elf/bin/ld.bfd: cannot find rust/target/riscv64imac-unknown-none-elf/release/librustapp.a: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /mnt/e/projects/zephyrproject/try-zephyr/build
(Before you get confused, "/home/cordawyn/projects" is a softlink to "/mnt/e/projects", but different tools seem to prefer different "true paths").
No other errors were encountered during the build process so far.
... which seemed to have succeeded, but it still did not result in getting "librustapp.a" anywhere.
I tried looking through any possible CMakeFiles.txt or build.ninja files produced, but couldn't find any clues.
It should probably be noted that I'm not an experienced developer in this area, just trying my first steps. So I could be missing something obvious. Your help would be much appreciated!
If it helps, here's some numbers:
Host OS: Ubuntu 22.04 (WSL)
Target board: qemu_riscv64
"riscv64imac-unknown-none-elf" target is installed with rustup
Zephyr SDK: 0.17.0 (includes the toolchain for "riscv64-zephyr-elf")
West: 1.3.0
Rustc: 1.83.0
Clang: 14.0.0
Ninja: 1.10.1
CMake: 3.22.1
The text was updated successfully, but these errors were encountered:
After some poking around I discovered that the build actually produces a couple of libtry_zephyr.{a,d} files in build/rust/target/riscv64imac-unknown-none-elf/release/ ("try-zephyr" is the name of my project). I renamed those files to librustapp.{a,d} and the build proceeded just fine, producing the final zephyr.elf. I ran it with QEMU and it worked just fine.
Update: I later successfully recompiled the whole project again by changing the "name" to "rustapp" in Cargo.toml.
So I assume that "librustapp" is a placeholder which did not get replaced with the project name during the build configuration phase? I suppose this should be the actual issue reported here.
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I'm trying to compile a sample app in Rust targeting riscv64. It is essentially a copy of "hello_world" from "samples" dir, without modifications. Everything seems to proceed just fine until I get the error, as shown below:
(Before you get confused, "/home/cordawyn/projects" is a softlink to "/mnt/e/projects", but different tools seem to prefer different "true paths").
No other errors were encountered during the build process so far.
I also tried building "librustapp" using:
... which seemed to have succeeded, but it still did not result in getting "librustapp.a" anywhere.
I tried looking through any possible
CMakeFiles.txt
orbuild.ninja
files produced, but couldn't find any clues.It should probably be noted that I'm not an experienced developer in this area, just trying my first steps. So I could be missing something obvious. Your help would be much appreciated!
If it helps, here's some numbers:
The text was updated successfully, but these errors were encountered: