-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cannot compile: gnu/stubs-ilp32.h: No such file or directory #1399
Comments
Did that help at all @capiman? |
I created an empty gnu/stubs-ilp32.h then it continued compiling, but next was missing nano.specs and nosys.specs I meanwhile put my own compiling on hold and use a pre-compiled version from https://github.com/hydrausb3/riscv-none-elf-gcc-xpack I am now compiling on Windows, scp created binary to RPI5 and flash CH569&test there. |
Aren't those files part of the bare-metal/Newlib toolchain but you seem to be using the Linux/Glibc toolchain?
That's a bare-metal toolchain.
OK - I will close this issue so since you seem to have overcome or at least circumvented the original issue - which is probably an issue for the upstream GCC/Glibc in any case. |
I confirmed that this is the case by looking at the contents of the latest CI builds of the Linux/Glibc and bare-metal/Newlib toolchains. Only the latter bundles those specs files. I think that there may be some confusion here about the appropriate toolchain to use. |
Many thanks for checking! Have I just selected the wrong content of the parameters for the configure step? |
This repo can build various bare-metal and Linux toolchains for RISC-V as illustrated by the CI/CT builds: and as explained in the readme:
If you want to compile specifically for a bare-metal
and then compile your code as follows:
|
Many thanks! This looks very good. I was able to compile gcc with the suggested commands on Raspberry Pi 5 64 bit bookworm. Is https://github.com/riscv-collab/riscv-gnu-toolchain the right place to commit such a patch, |
Support or But there is an attempt to standardize a more generic model to tell the compiler about prestacked registers of an IRQ handler in riscv-non-isa/riscv-c-api-doc#53. In this repo, we don't take any patches on top of upstream sources. |
@capiman perhaps you need to be using the WCH fork of the RISC-V GCC toolchain that supports propriety extensions of theirs such as this? If you can find/get their forked sources that is... |
I added the above mentioned patch to local version of gcc. |
Yes, applying the patch manually is one way to do this but
BTW, judging by commentary elsewhere, even their mod for |
Thanks for all (and @cmuellner) your feedback! I will follow @cmuellner suggestion. If I can help somewhere, I will do. For the time being, till a better way is available, the local version must be sufficient. |
I am using a Raspberry Pi 5 (64 bit) with OS release bookworm.
I first tried this:
git clone https://github.com/riscv/riscv-gnu-toolchain
./configure --prefix=/opt/riscv
make linux
Compile worked. But I had an error, when compiling my app source code:
(from https://github.com/hydrausb3 )
/opt/riscv/bin/riscv64-unknown-linux-gnu-gcc -march=rv32imac_zicsr -mabi=ilp32 -msmall-data-limit=8 -O3 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -DDEBUG=1 -I"../wch-ch56x-bsp/rvmsis" -I"../wch-ch56x-bsp/drv" -I"../wch-ch56x-bsp/board" -I"../wch-ch56x-bsp/usb/usb_devbulk" -I"./User" -std=gnu99 -MMD -MP -MT"build/core_riscv.o" -c -o "build/core_riscv.o" "../wch-ch56x-bsp/rvmsis/core_riscv.c"
In file included from /opt/riscv/sysroot/usr/include/features.h:527,
from /opt/riscv/sysroot/usr/include/bits/libc-header-start.h:33,
from /opt/riscv/sysroot/usr/include/stdint.h:26,
from /opt/riscv/lib/gcc/riscv64-unknown-linux-gnu/13.2.0/include/stdint.h:9,
from ../wch-ch56x-bsp/rvmsis/core_riscv.c:11:
/opt/riscv/sysroot/usr/include/gnu/stubs.h:8:11: fatal error: gnu/stubs-ilp32.h: No such file or directory
8 | # include <gnu/stubs-ilp32.h>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:103: build/core_riscv.o] Error 1
trio@adapter-radio:~/risc-v/hydrausb3_fw_qmi/HydraUSB3_USB $
I assumed, I need something different:
make clean
./configure --prefix=/opt/riscv --with-arch=rv32gc --with-abi=ilp32
make linux
But after some time of compiling I got this (same!) error:
/home/trio/riscv-gnu-toolchain/build-gcc-linux-stage1/./gcc/xgcc -B/home/trio/riscv-gnu-toolchain/build-gcc-linux-stage1/./gcc/ -B/opt/riscv/riscv32-unknown-linux-gnu/bin/ -B/opt/riscv/riscv32-unknown-linux-gnu/lib/ -isystem /opt/riscv/riscv32-unknown-linux-gnu/include -isystem /opt/riscv/riscv32-unknown-linux-gnu/sys-include -O2 -mcmodel=medlow -O2 -O2 -mcmodel=medlow -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fPIC -I. -I. -I../.././gcc -I../../.././gcc/libgcc -I../../.././gcc/libgcc/. -I../../.././gcc/libgcc/../gcc -I../../.././gcc/libgcc/../include -DHAVE_CC_TLS -fvisibility=hidden -DHIDE_EXPORTS -c eh_dummy.c
-o eh_dummy.o;
objects=eh_dummy.o;
fi;
/opt/riscv/riscv32-unknown-linux-gnu/bin/ar rc libgcc.a $objects
/opt/riscv/riscv32-unknown-linux-gnu/bin/ranlib libgcc.a
/home/trio/riscv-gnu-toolchain/build-gcc-linux-stage1/./gcc/xgcc -B/home/trio/riscv-gnu-toolchain/build-gcc-linux-stage1/./gcc/ -B/opt/riscv/riscv32-unknown-linux-gnu/bin/ -B/opt/riscv/riscv32-unknown-linux-gnu/lib/ -isystem /opt/riscv/riscv32-unknown-linux-gnu/include -isystem /opt/riscv/riscv32-unknown-linux-gnu/sys-include -O2 -mcmodel=medlow -O2 -O2 -mcmodel=medlow -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fPIC -I. -I. -I../.././gcc -I../../.././gcc/libgcc -I../../.././gcc/libgcc/. -I../../.././gcc/libgcc/../gcc -I../../.././gcc/libgcc/../include -DHAVE_CC_TLS -o _gcov_merge_add.o -MT _gcov_merge_add.o -MD -MP -MF _gcov_merge_add.dep -DL_gcov_merge_add -c ../../.././gcc/libgcc/libgcov-merge.c
In file included from /opt/riscv/sysroot/usr/include/features.h:527,
from /opt/riscv/sysroot/usr/include/sys/mman.h:22,
from ../../.././gcc/libgcc/libgcov.h:49,
from ../../.././gcc/libgcc/libgcov-merge.c:26:
/opt/riscv/sysroot/usr/include/gnu/stubs.h:8:11: fatal error: gnu/stubs-ilp32.h: No such file or directory
8 | # include <gnu/stubs-ilp32.h>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:924: _gcov_merge_add.o] Error 1
make[2]: Leaving directory '/home/trio/riscv-gnu-toolchain/build-gcc-linux-stage1/riscv32-unknown-linux-gnu/libgcc'
make[1]: *** [Makefile:12883: all-target-libgcc] Error 2
make[1]: Leaving directory '/home/trio/riscv-gnu-toolchain/build-gcc-linux-stage1'
make: *** [Makefile:434: stamps/build-gcc-linux-stage1] Error 2
trio@adapter-radio:~/riscv-gnu-toolchain $
The text was updated successfully, but these errors were encountered: