[lowrisc-dev] Re: Errors regarding run bare metal exmaples

Gary Guo nbdd0121 at hotmail.com
Thu Jul 7 00:20:36 BST 2016


Hi Weizhong,
It seems that your RISC-V toolchain is compiled using gcc 5. Try to compile it again with gcc 4.8, and the error should resolve.
Best,Gary

> To: lowrisc-dev at lists.lowrisc.org
> From: wh6ma at virginia.edu
> Date: Wed, 6 Jul 2016 23:14:33 +0000
> Subject: [lowrisc-dev] Re: Errors regarding run bare metal exmaples
> 
> Hello all,
> 
> Wei, Stefan. Thank you so much for your suggestions!
> According to your previous suggestions, I updated my Vivado version from 
> 2015.3 to 2015.4. 
> ~/newlowRISC/DIR/lowrisc-chip/vsim$ which vivado
> /opt/Xilinx/Vivado/2015.4/bin/vivado
> 
> And I did "make cleanall" in the kc705 folder and "make bitstream" again in 
> Kc705. I apologize for the long details in advance.
> 
> Then I tried "make hello" to run bare metal hello examples.
> ------------------------------------------------------------------------
> ~/newlowRISC/DIR/lowrisc-chip/fpga/board/kc705$ make hello
> cd examples && make
> make[1]: Entering directory '/home/hplp/newlowRISC/DIR/lowrisc-
> chip/fpga/board/kc705/examples'
> riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFD -std=gnu99 -g -ffast-math 
> -fno-common -fno-builtin-printf -I../driver -c ../driver/syscalls.c -o 
> ../driver/syscalls.o
> riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFD -std=gnu99 -g -ffast-math 
> -fno-common -fno-builtin-printf -I../driver -c ../driver/spi.c -o 
> ../driver/spi.o
> riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFD -std=gnu99 -g -ffast-math 
> -fno-common -fno-builtin-printf -I../driver -c ../driver/uart.c -o 
> ../driver/uart.o
> riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFD -std=gnu99 -g -ffast-math 
> -fno-common -fno-builtin-printf -I../driver -c ../driver/memory.c -o 
> ../driver/memory.o
> riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFD -std=gnu99 -g -ffast-math 
> -fno-common -fno-builtin-printf -I../driver -c ../driver/elf.c -o 
> ../driver/elf.o
> riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFD -std=gnu99 -g -ffast-math 
> -fno-common -fno-builtin-printf -I../driver -c ../driver/diskio.c -o 
> ../driver/diskio.o
> riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFD -std=gnu99 -g -ffast-math 
> -fno-common -fno-builtin-printf -I../driver -c ../driver/ff.c -o 
> ../driver/ff.o
> riscv64-unknown-elf-gcc -static -Wa,-march=RVIMAFD -std=gnu99 -g -ffast-math 
> -fno-common -fno-builtin-printf -I../driver -c ../driver/crt.S -o crt.o
> riscv64-unknown-elf-gcc -T ../driver/test.ld -static -Wa,-march=RVIMAFD -
> std=gnu99 -g -ffast-math -fno-common -fno-builtin-printf -I../driver -o 
> boot.riscv boot.c ../driver/syscalls.o ../driver/spi.o ../driver/uart.o 
> ../driver/memory.o ../driver/elf.o ../driver/diskio.o ../driver/ff.o  crt.o -
> nostdlib -nostartfiles -ffast-math -lc -lgcc
> elf2hex 16 4096 boot.riscv > boot.hex
> elf2hex: /opt/Xilinx/Vivado/2015.4/lib/lnx64.o/libstdc++.so.6: version 
> `GLIBCXX_3.4.20' not found (required by //home/hplp/newlowRISC/DIR/lowrisc-
> chip/riscv/lib/libfesvr.so)
> elf2hex: /opt/Xilinx/Vivado/2015.4/lib/lnx64.o/libstdc++.so.6: version 
> `GLIBCXX_3.4.21' not found (required by //home/hplp/newlowRISC/DIR/lowrisc-
> chip/riscv/lib/libfesvr.so)
> Makefile:75: recipe for target 'boot.hex' failed
> make[1]: *** [boot.hex] Error 1
> make[1]: Leaving directory '/home/hplp/newlowRISC/DIR/lowrisc-
> chip/fpga/board/kc705/examples'
> Makefile:170: recipe for target 'hello' failed
> make: *** [hello] Error 2
> --------------------------------------------------------------------------
> I assume there is gcc version problem which causes "glibcxx 3.4.21" not 
> found.
> Before I did anything to the gcc version, gcc 5.3.1 is the default version
> ~/newlowRISC/DIR/lowrisc-chip/fpga/board/kc705$ gcc --version
> gcc (Ubuntu 5.3.1-14ubuntu2.1) 5.3.1 20160413
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> ---------------------------------------------------------------------------
> I installed the gcc 4.8.5 as Stefan instructed. Then 4.8.5 is my default 
> version
> ~/newlowRISC/DIR/lowrisc-chip/fpga/board/kc705$ gcc --version
> gcc (Ubuntu 4.8.5-4ubuntu2) 4.8.5
> Copyright (C) 2015 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> ---------------------------------------------------------------------------
> I tried "make hello" again in kc705
> ~/newlowRISC/DIR/lowrisc-chip/fpga/board/kc705$ make hello
> cd examples && make
> make[1]: Entering directory '/home/hplp/newlowRISC/DIR/lowrisc-
> chip/fpga/board/kc705/examples'
> riscv64-unknown-elf-gcc -T ../driver/test.ld -static -Wa,-march=RVIMAFD -
> std=gnu99 -g -ffast-math -fno-common -fno-builtin-printf -I../driver -o 
> dram.riscv dram.c ../driver/syscalls.o ../driver/spi.o ../driver/uart.o 
> ../driver/memory.o ../driver/elf.o ../driver/diskio.o ../driver/ff.o  crt.o -
> nostdlib -nostartfiles -ffast-math -lc -lgcc
> elf2hex 16 4096 dram.riscv > dram.hex
> elf2hex: /opt/Xilinx/Vivado/2015.4/lib/lnx64.o/libstdc++.so.6: version 
> `GLIBCXX_3.4.20' not found (required by //home/hplp/newlowRISC/DIR/lowrisc-
> chip/riscv/lib/libfesvr.so)
> elf2hex: /opt/Xilinx/Vivado/2015.4/lib/lnx64.o/libstdc++.so.6: version 
> `GLIBCXX_3.4.21' not found (required by //home/hplp/newlowRISC/DIR/lowrisc-
> chip/riscv/lib/libfesvr.so)
> Makefile:75: recipe for target 'dram.hex' failed
> make[1]: *** [dram.hex] Error 1
> make[1]: Leaving directory '/home/hplp/newlowRISC/DIR/lowrisc-
> chip/fpga/board/kc705/examples'
> Makefile:170: recipe for target 'hello' failed
> make: *** [hello] Error 2
> ----------------------------------------------------------------------------
> And I did "elf2hex 16 4096 rv64ui-p-add > rv64ui-p-add.hex" in vsim folder as 
> part of RTL simulation.
> :~/newlowRISC/DIR/lowrisc-chip/vsim$ elf2hex 16 4096 rv64ui-p-add > rv64ui-p-
> add.hex
> elf2hex: /opt/Xilinx/Vivado/2015.4/lib/lnx64.o/libstdc++.so.6: version 
> `GLIBCXX_3.4.20' not found (required by //home/hplp/newlowRISC/DIR/lowrisc-
> chip/riscv/lib/libfesvr.so)
> elf2hex: /opt/Xilinx/Vivado/2015.4/lib/lnx64.o/libstdc++.so.6: version 
> `GLIBCXX_3.4.21' not found (required by //home/hplp/newlowRISC/DIR/lowrisc-
> chip/riscv/lib/libfesvr.so)
> -----------------------------------------------------------------------------
> Please advise. I appreciate all your help.
> 
> Weizhong
> 
> 
> 
 		 	   		  


More information about the lowrisc-dev mailing list