Forum Discussion
For anyone wondering for the solution, check my attached file
Please rename it to nios2-newlib-gen and overwrite the file at the location:
C:\intelFPGA_lite\23.1std\nios2eds\sdk2\bin
The change which has been done is adding the option:
--disable-dependency-tracking
to the configure call.
So instead:
/bin/sh "$SRCDIR/configure" --prefix="$LIBDIR" --target=$TARGET 2>&1 | tee -a "$LOGFILE" >&3
it is
/bin/sh "$SRCDIR/configure" --disable-dependency-tracking --prefix="$LIBDIR" --target=$TARGET 2>&1 | tee -a "$LOGFILE" >&3
For the ones curious to know why this is needed:
make (executable) is called in wsl, which understands linux paths.
the gcc toolchain is a windows native toolchain which is spawned from wsl make, the gcc toolchain therefore understands only windows paths. If you check your nios application Makefile carefully you will see this section:
ifdef WINDOWS_EXE
adjust-path = $(if $1,$(shell wslpath "$1"),)
adjust-path-mixed = $(if $(call eq,$(shell echo $1 | head -c 5),/mnt/),$(shell echo $1 | sed 's/\/mnt\///g;s/\//:\//1'),$1)
else # !WINDOWS_EXE
adjust-path = $1
adjust-path-mixed = $1
endif
Altera has provided a solution in the user project to adjsut the path between linux and windows, but the newlib code does not have such a thing, being this is some really strange setup to have mixed linux and windows calls.
Because the dependency tracking is enabled per default in newlib 4.3, the dependency files are being generated from windows gcc, which then can not be read by wsl make, and you get the error:
libc/argz/.deps/libc_a-argz_add.Po:1: *** target pattern contains no '%'. Stop.
My 2 cents would be:
I would have provided a linux native toolchain, placed in the folder here:
C:\intelFPGA_lite\23.1std\nios2eds\bin\gnu\H-x86_64-mingw32\bin
wsl make then would spawn linux gcc tools for building, which would end the confusion between linux and windows paths.
And I would still have provided a windows native nios2-elf-gdb.exe in order to be able to debug from windows eclipse.
Cheers!