Forum Discussion
Can you fix stupid scripts error from 19.1 to 20.3?
i can not use nios2 command to generate newlib, do you really checked the nios2eds scripts? such as nios2-newlib-gen, it can not work correctly at all! can you fix this?
and your script not compatible with wsl2 just because these lines:
5 Replies
- EricMunYew_C_Intel
Frequent Contributor
Can you follow below to install:
1. install WSL for windows
i. https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/nios2/n2sw_nii5v2gen2.pdf (chapter 2.1)
Note: Windows 10 build version 16215.0 or higher is the recommended operating system version.
ii. After installation has successfully completed, launch Ubuntu 18.04.
iii. Install additional distro packages required for Nios II EDS using the following commands:
a. sudo apt-get update
b. sudo apt install wsl
c. sudo apt install dos2unix
d. sudo apt install make
2. install nios2 eclipse folder
3. After re-installation, can you download the patch from below KDB:
- tommmy
New Contributor
I installed Quartus Prime Pro 20.2.0.50, please check the scripts file such as "nios2-newlib-gen"
- EricMunYew_C_Intel
Frequent Contributor
can I have your log?
- EricMunYew_C_Intel
Frequent Contributor
can you try below:
Modify <installation location>/nios2eds/sdk/bin/nios2-newlib-gen:
include the following on the top of the script, before "usage()"
uname=$(uname -r | tr A-Z a-z)
if [[ $uname =~ "microsoft" ]]; then
windows_exe=.exe
fi
- tommmy
New Contributor
I had tried before, not work.
I am pretty sure, the function build_newlib() in this script file is not right. the STAGE_WRAPPER file not generated correctly.
STAGE_WRAPPER=$BLDDIR/build-newlib-stage-wrapper
in file " build-newlib-stage-wrapper"
#!/bin/bash
#
# A script to intercept and short-circuit the --print-multi-lib option
#
ORIGINAL_ARGS=$(echo $* | sed -e 's,/cygdrive/\([a-zA-Z]\)/,\1:/,g')
CUSTOM=
if [ "x$1" = "xnios2-elf-gcc" ]
then
CUSTOM=" -O3 -g -Wall -mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global -fno-math-errno -mcustom-fabss=224 -mcustom-fadds=253 -mcustom-fcmpeqs=227 -mcustom-fcmpges=228 -mcustom-fcmpgts=229 -mcustom-fcmples=230 -mcustom-fcmplts=231 -mcustom-fcmpnes=226 -mcustom-fdivs=255 -mcustom-fixsi=249 -mcustom-floatis=250 -mcustom-fmuls=252 -mcustom-fnegs=225 -mcustom-fsubs=254 "
fi
while [ $# -gt 0 ]
do
case "$1" in
--print-multi-lib)
echo ".;"
exit 0
;;
*)
;;
esac
shift
done
eval $ORIGINAL_ARGS $CUSTOMerror log :[my private path]/newlib-build-tmp/build-newlib-stage-wrapper: line 23: nios2-elf-cc: command not foundit shows that the suffix is missing in build-newlib-stage-wrapper, when use command "STAGE_WRAPPER {cmd}"but if I change the var ORIGINAL_ARGS and add suffix ".exe" in file "nios2-newlib-gen"##add suffix for WSLuname=$(uname -r)uname=$(echo ${uname} | tr 'A-Z' 'a-z')if [[ "${uname}" =~ "microsoft" ]]thencat >>"$STAGE_WRAPPER" <<"EOF"echo "ORIGINAL_ARGS = ${ORIGINAL_ARGS}"#ORIGINAL_ARGS=$(echo ${ORIGINAL_ARGS} | sed -e "s,-B, -B,g")#ORIGINAL_ARGS=$(echo ${ORIGINAL_ARGS} | sed -e "s,-i, -i,g")#ORIGINAL_ARGS=$(echo ${ORIGINAL_ARGS} | sed -e "s,^nios2-elf-cc,nios2-elf-gcc,g")echo "ORIGINAL_ARGS = ${ORIGINAL_ARGS}"cmd=$(echo $ORIGINAL_ARGS | awk 'NR==1{print $1}')echo "cmd = $cmd"ORIGINAL_ARGS=$(echo ${ORIGINAL_ARGS} | sed -e "s,^$cmd,$cmd.exe,g")
EOFfiit still not work. in newlib tmporary config.log shows that it still not add suffix .exe when configure call nios2-elf-gccSo, it is complicated to fix script bugs to compile newlib in wsl by using mingw32 tool chain because newlib configure not add suffix for command even throught add suffix in STAGE_WRAPPER file!I doubt! Why Quartus not just migrate tool chain for linux platform and just remove mingw32 tool chain which has annoying suffix ".exe" because of using WSL , nearly a real linux enviroment!!!!!So, I copy tool chain "H-x86_64-pc-linux-gnu" from linux platformand edit "niso2_command_shell.sh" like this:# if grep -q Microsoft /proc/version; thenif [ -d "${SOPC_KIT_NIOS2}/bin/gnu/H-x86_64-mingw32/bin" ]; thenenv_var_prepend ${SOPC_KIT_NIOS2}/bin/gnu/H-x86_64-mingw32/binelseenv_var_prepend ${SOPC_KIT_NIOS2}/bin/gnu/H-i686-mingw32/binfi# elseif [ -d "${SOPC_KIT_NIOS2}/bin/gnu/H-x86_64-pc-linux-gnu/bin" ]; thenenv_var_prepend ${SOPC_KIT_NIOS2}/bin/gnu/H-x86_64-pc-linux-gnu/binelseenv_var_prepend ${SOPC_KIT_NIOS2}/bin/gnu/H-i686-pc-linux-gnu/binfi# ficomment if-else-ifand 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 you really want try WSL or WLS2, WHY NOT JUST MINGRATE LINUX TOOL CHAIN AND ERVERY RELATED SCRIPT to WSL enviroment and DISCARD "H-x86_64-mingw32" TOOL CHAIN!!!!!!!!ORrollback to use cygwin!these issues had been existed for three years since you discarded cygwin and started to use WSL. CAN ANYBODY FIX IT ?