-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
riscv gnu tool chain Compile error #418
Comments
Also how to get gcc prefix as "riscv64-unknown-elf-gcc"? |
To keep the linker happy, you can use For the HiFive1 and Arty 31/51 boards, you can generate functional projects within Eclipse with the SiFive Project Templates. If you want to use |
@ilg-ul . |
It defines empty functions for all those names that triggered errors. |
@ilg-ul |
The reason why those names trigger errors is because the application should define them, to provide the desired functionality, like redirecting the printf() output to some device (POSIX retargetting). If the application is not interrested in such functionality, for convenience, it can use the empty functions, which obviously do nothing, but at least the linker will no longer complain. |
Please close this ticket, since it is not related to a toolchain bug. For questions and support, use the forums. |
@ilg-ul |
You're welcome. |
16:55:11 **** Incremental Build of configuration Debug for project Hello World ****
make all
Building target: Hello World.elf
Invoking: GNU RISC-V Cross C Linker
riscv-none-embed-gcc -march=rv64imafc -mabi=lp64f -mcmodel=medlow -msmall-data-limit=8 -mno-save-restore -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g3 -Xlinker --gc-sections -Wl,-Map,"Hello World.map" -o "Hello World.elf" ./src/main.o
c:/users/aharshadbhai/appdata/roaming/xpacks/@gnu-mcu-eclipse/riscv-none-gcc/8.1.0-2.1/.content/bin/../lib/gcc/riscv-none-embed/8.1.0/../../../../riscv-none-embed/lib\libg.a(lib_a-exit.o): In function
.L0 ': exit.c:(.text.exit+0x20): undefined reference to
_exit'c:/users/aharshadbhai/appdata/roaming/xpacks/@gnu-mcu-eclipse/riscv-none-gcc/8.1.0-2.1/.content/bin/../lib/gcc/riscv-none-embed/8.1.0/../../../../riscv-none-embed/lib\libg.a(lib_a-sbrkr.o): In function
.L0 ': sbrkr.c:(.text._sbrk_r+0xe): undefined reference to
_sbrk'c:/users/aharshadbhai/appdata/roaming/xpacks/@gnu-mcu-eclipse/riscv-none-gcc/8.1.0-2.1/.content/bin/../lib/gcc/riscv-none-embed/8.1.0/../../../../riscv-none-embed/lib\libg.a(lib_a-writer.o): In function
.L0 ': writer.c:(.text._write_r+0x14): undefined reference to
_write'c:/users/aharshadbhai/appdata/roaming/xpacks/@gnu-mcu-eclipse/riscv-none-gcc/8.1.0-2.1/.content/bin/../lib/gcc/riscv-none-embed/8.1.0/../../../../riscv-none-embed/lib\libg.a(lib_a-closer.o): In function
.L0 ': closer.c:(.text._close_r+0xe): undefined reference to
_close'c:/users/aharshadbhai/appdata/roaming/xpacks/@gnu-mcu-eclipse/riscv-none-gcc/8.1.0-2.1/.content/bin/../lib/gcc/riscv-none-embed/8.1.0/../../../../riscv-none-embed/lib\libg.a(lib_a-lseekr.o): In function
.L0 ': lseekr.c:(.text._lseek_r+0x14): undefined reference to
_lseek'c:/users/aharshadbhai/appdata/roaming/xpacks/@gnu-mcu-eclipse/riscv-none-gcc/8.1.0-2.1/.content/bin/../lib/gcc/riscv-none-embed/8.1.0/../../../../riscv-none-embed/lib\libg.a(lib_a-readr.o): In function
.L0 ': readr.c:(.text._read_r+0x14): undefined reference to
_read'c:/users/aharshadbhai/appdata/roaming/xpacks/@gnu-mcu-eclipse/riscv-none-gcc/8.1.0-2.1/.content/bin/../lib/gcc/riscv-none-embed/8.1.0/../../../../riscv-none-embed/lib\libg.a(lib_a-fstatr.o): In function
.L0 ': fstatr.c:(.text._fstat_r+0x12): undefined reference to
_fstat'c:/users/aharshadbhai/appdata/roaming/xpacks/@gnu-mcu-eclipse/riscv-none-gcc/8.1.0-2.1/.content/bin/../lib/gcc/riscv-none-embed/8.1.0/../../../../riscv-none-embed/lib\libg.a(lib_a-isattyr.o): In function
.L0 ': isattyr.c:(.text._isatty_r+0xe): undefined reference to
_isatty'collect2.exe: error: ld returned 1 exit status
make: *** [makefile:44: Hello World.elf] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
The text was updated successfully, but these errors were encountered: