tommmy
New Contributor
4 years agoFix Newlib compile error on Windows Platform [Version > 18.1 Use WSL]
copy tool chain "H-x86_64-pc-linux-gnu" from linux platform
and edit "niso2_command_shell.sh" like this:
# if grep -q Microsoft /proc/version; then
if [ -d "${SOPC_KIT_NIOS2}/bin/gnu/H-x86_64-mingw32/bin" ]; then
env_var_prepend ${SOPC_KIT_NIOS2}/bin/gnu/H-x86_64-mingw32/bin
else
env_var_prepend ${SOPC_KIT_NIOS2}/bin/gnu/H-i686-mingw32/bin
fi
# else
if [ -d "${SOPC_KIT_NIOS2}/bin/gnu/H-x86_64-pc-linux-gnu/bin" ]; then
env_var_prepend ${SOPC_KIT_NIOS2}/bin/gnu/H-x86_64-pc-linux-gnu/bin
else
env_var_prepend ${SOPC_KIT_NIOS2}/bin/gnu/H-i686-pc-linux-gnu/bin
fi
# fi
comment if-else-if
and doses not need edit any thing in "nios2-newlib-gen"
Be brief:
there are two methods to solve these issues caused by wsl enviroment:
1. just use nios2eds with Qurtus 18.1 pro, which use cygwin shell enviroment, works perfect on windows platform.
2. copy tool chain "H-x86_64-pc-linux-gnu" form linux version's Quartus Pro to directory "niso2eds/bin/gnu/", so in makefile, use tool chain "H-x86_64-mingw32" and when compile newlib, use "H-x86_64-pc-linux-gnu" by itself.
[Advice]:
it is too complicated to use var WINDOWS_EXE,
If Qurtus really want try WSL or WSL2, WHY NOT JUST MINGRATE LINUX TOOL CHAIN AND ERVERY RELATED SCRIPT to WSL enviroment and DISCARD "H-x86_64-mingw32" TOOL CHAIN!!!!!!!!
OR
JUST rollback to cygwin!
these issues had been existed for three years since quartus discarded cygwin and started to use WSL. CAN ANYBODY FIX IT ?
some other issues can be solved by add
sed -i "s/^APP_LDFLAGS += -msys-lib=\$(call adjust-path-mixed\,\$(SYS_LIB)).*/APP_LDFLAGS += -msys-lib=\$(SYS_LIB)/g" Makefile
to your own auto-build script