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:
链接已复制
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:
I installed Quartus Prime Pro 20.2.0.50, please check the scripts file such as "nios2-newlib-gen"
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
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"
#
# 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 $CUSTOM
