Port-RISCV archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: cross compiling for riscv64
On Fri, Nov 06, 2026 at 04:36:54PM -0500, Jesse Rhodes wrote:
> I'm coming from linux so I don't really know the assumptions I should have
> reading something like this. I did figure out (through trial and error) that
> I needed the comp, text, and most of the source sets, but may still be
> missing something, because the distribution build fails.
Unless you know exactly what you are doing, you need *all* source sets.
> # compile libgcc/_eprintf.o
> /usr/src/obj/tooldir.NetBSD-11.1-amd64/bin/riscv64--netbsd-gcc -O2 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wsystem-headers -Wno-traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wformat=2 -Wno-format-zero-length -Werror --sysroot=/usr/src/obj/destdir.riscv -I/usr/src/external/gpl3/gcc/lib/libgcc/libgcc -I/usr/src/external/gpl3/gcc/lib/libgcc/arch/riscv64 -I/usr/src/external/gpl3/gcc/usr.bin/gcc/arch/riscv64 -DIN_GCC -DIN_LIBGCC2 -I/usr/src/external/gpl3/gcc/dist/libgcc -I/usr/src/external/gpl3/gcc/dist/libgcc/. -I/usr/src/external/gpl3/gcc/dist/libgcc/../gcc -I/usr/src/external/gpl3/gcc/dist/libgcc/../include -fPIC -fbuilding-libgcc -fno-stack-protector -I/usr/src/external/gpl3/gcc/dist/gcc/ginclude -I/usr/src/external/gpl3/gcc/dist/libgcc -I/usr/src/external/gpl3/gcc/dist/libgcc/config -I/usr/src/external/gpl3/gcc/dist/libgcc/config/riscv -I/usr/src/external/gpl3/gcc/dist/gcc -I/usr/src/external/gpl3/gcc/dist/include -I. -DHAVE_CC_TLS -I/usr/src/external/gpl3/gcc/usr.bin/backend/obj -c _eprintf.c -o _eprintf.o.tmp1
> In file included from _eprintf.c:2:
> /usr/src/external/gpl3/gcc/dist/libgcc/libgcc2.c: In function '__eprintf':
> /usr/src/external/gpl3/gcc/dist/libgcc/libgcc2.c:2245:3: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
> 2245 | fprintf (stderr, string, expression, line, filename);
> | ^~~~~~~
> cc1: all warnings being treated as errors
>
> *** Failed target: _eprintf.o
> *** Failed command: /usr/src/obj/tooldir.NetBSD-11.1-amd64/bin/riscv64--netbsd-gcc -O2 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wsystem-headers -Wno-traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wformat=2 -Wno-format-zero-length -Werror --sysroot=/usr/src/obj/destdir.riscv -I/usr/src/external/gpl3/gcc/lib/libgcc/libgcc -I/usr/src/external/gpl3/gcc/lib/libgcc/arch/riscv64 -I/usr/src/external/gpl3/gcc/usr.bin/gcc/arch/riscv64 -DIN_GCC -DIN_LIBGCC2 -I/usr/src/external/gpl3/gcc/dist/libgcc -I/usr/src/external/gpl3/gcc/dist/libgcc/. -I/usr/src/external/gpl3/gcc/dist/libgcc/../gcc -I/usr/src/external/gpl3/gcc/dist/libgcc/../include -fPIC -fbuilding-libgcc -fno-stack-protector -I/usr/src/external/gpl3/gcc/dist/gcc/ginclude -I/usr/src/external/gpl3/gcc/dist/libgcc -I/usr/src/external/gpl3/gcc/dist/libgcc/config -I/usr/src/external/gpl3/gcc/dist/libgcc/config/riscv -I/usr/src/external/gpl3/gcc/dist/gcc -I/usr/src/external/gpl3/gcc/dist/include -I. -DHAVE_CC_TLS -I/usr/src/external/gpl3/gcc/usr.bin/backend/obj -c _eprintf.c -o _eprintf.o.tmp1
> *** Error code 1
Are you sure that you are actually using the 11.1 sources?
What is your build.sh command line that triggers this?
Do you have any special settings in /etc/mk.conf?
This failure does not show up on our build cluster (which cross-compiles
on an amd64 host to riscv64), so it must be something in your compile
environment that makes it special.
And you seem to be already past the critical stage, i.e. the tools
required for the build have been created and installed
(otherwise the host compiler would be used instead of the tooldir gcc).
Martin
Home |
Main Index |
Thread Index |
Old Index