sergeykhbr / riscv_vhdl

Portable RISC-V System-on-Chip implementation: RTL, debugger and simulators
http://sergeykhbr.github.io/riscv_vhdl/
Apache License 2.0
627 stars 104 forks source link

Building bootimage fails on linux using riscv-gcc 5.3.0 #2

Closed bkoppelmann closed 8 years ago

bkoppelmann commented 8 years ago

When running make to build the bootimage I get the following error:

riscv64-unknown-elf-gcc -c -g -static -std=gnu99 -O0 -fno-common -fno-builtin-printf -march=RV64IMA -msoft-float -I../../common -I../src ../src/main.c -o ../linuxbuild/obj/main.o riscv64-unknown-elf-gcc -c -g -static -std=gnu99 -O0 -fno-common -fno-builtin-printf -march=RV64IMA -msoft-float -I../../common -I../src ../src/trap.c -o ../linuxbuild/obj/trap.o riscv64-unknown-elf-gcc -c -g -static -std=gnu99 -O0 -fno-common -fno-builtin-printf -march=RV64IMA -msoft-float -DASSEMBLY=1 -I../../common -I../src ../src/crt.S -o ../linuxbuild/obj/crt.o riscv64-unknown-elf-gcc -T test.ld -nostdlib -nostartfiles ../linuxbuild/obj/main.o ../linuxbuild/obj/trap.o ../linuxbuild/obj/crt.o -o ../linuxbuild/bin/bootimage -lgcc -lc -lm /mnt/ultrabay/paco-env/riscv-tools/lib/gcc/riscv64-unknown-elf/5.3.0/../../../../riscv64-unknown-elf/bin/ld: /mnt/ultrabay/paco-env/riscv-tools/lib/gcc/riscv64-unknown-elf/5.3.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-memcpy.o): can't link hard-float modules with soft-float modules /mnt/ultrabay/paco-env/riscv-tools/lib/gcc/riscv64-unknown-elf/5.3.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /mnt/ultrabay/paco-env/riscv-tools/lib/gcc/riscv64-unknown-elf/5.3.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-memcpy.o)

Changing the CFLAGS back to -O2 seems to fix the problem.

Cheers, Bastian

sergeykhbr commented 8 years ago

Most probably you're using mixed glibc libraries for soft-float and hard-float platforms. They are not binary compatible. Use gcc 5.1.0 toolchain that is available by link on main page of the repository.