Failed to Build and debug the project


(intel123) #1

I just installed the new FreedomStudio on Ubuntu VM, including the latest Java release, and get the following error when trying to build coreplexip any

RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/bin/…/libexec/gcc/riscv64-unknown-elf/7.1.1/liblto_plugin.so: error loading plugin:
RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/bin/…/libexec/gcc/riscv64-unknown-elf/7.1.1/liblto_plugin.so: file too short
collect2: error: ld returned 1 exit status
make: *** [coreplexip_welcome.elf] Error 1


(Drew) #2

Can you verify that the file RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/bin/…/libexec/gcc/riscv64-unknown-elf/7.1.1/liblto_plugin.so exits on your machine and that it is a sym link to liblto_plugin.so.0.0.0?

You might also want to try re-downloading and extracting the bundle.


(intel123) #3

Hi
I am trying to re-downloading and extracting the bundle. But till i am getting the same issue…

Building target: coreplexip_welcome.elf
Invoking: GNU RISC-V Cross C Linker
riscv64-unknown-elf-gcc -march=rv64imac -mabi=lp64 -mcmodel=medany -msmall-data-limit=8 -O2 -g3 -T “/nfs/iind/disks/i2r.disk.0001/RISCV_Evaluation/sifive/Projects/coreplexip_welcome/bsp/env/coreplexip-e51-arty/flash.lds” -nostartfiles -L…/…/wrap-E51FPGA/Debug -L…/ -Wl,-Map,“coreplexip_welcome.map” -Wl,–start-group -Wl,–end-group -Wl,–wrap=malloc -Wl,–wrap=free -Wl,–wrap=open -Wl,–wrap=lseek -Wl,–wrap=read -Wl,–wrap=write -Wl,–wrap=fstat -Wl,–wrap=stat -Wl,–wrap=close -Wl,–wrap=link -Wl,–wrap=unlink -Wl,–wrap=execve -Wl,–wrap=fork -Wl,–wrap=getpid -Wl,–wrap=kill -Wl,–wrap=wait -Wl,–wrap=isatty -Wl,–wrap=times -Wl,–wrap=sbrk -Wl,–wrap=_exit -o “coreplexip_welcome.elf” ./bsp/env/coreplexip-e51-arty/init.o ./bsp/env/entry.o ./bsp/env/start.o ./bsp/drivers/plic/plic_driver.o ./bsp/drivers/fe300prci/fe300prci_driver.o ./coreplexip_welcome.o -lc -lwrap-E51FPGA
/nfs/iind/disks/i2r.disk.0001/RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/bin/…/lib/gcc/riscv64-unknown-elf/7.1.1/…/…/…/…/riscv64-unknown-elf/bin/ld: /nfs/iind/disks/i2r.disk.0001/RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/bin/…/libexec/gcc/riscv64-unknown-elf/7.1.1/liblto_plugin.so: error loading plugin: /nfs/iind/disks/i2r.disk.0001/RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/bin/…/libexec/gcc/riscv64-unknown-elf/7.1.1/liblto_plugin.so: file too short
collect2: error: ld returned 1 exit status
make: *** [coreplexip_welcome.elf] Error 1

11:56:50 Build Finished (took 980ms)


(Drew) #4

Can you verify that the file RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/bin/…/libexec/gcc/riscv64-unknown-elf/7.1.1/liblto_plugin.so exits on your machine and that it is a sym link to liblto_plugin.so.0.0.0?

cd RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/libexec/gcc/riscv64-unknown-elf/7.1.1
ls -la

You should see something similar to (among other files):

lrwxr-xr-x   1 drew  staff        18 Jun 16 09:15 liblto_plugin.so -> liblto_plugin.0.so

I’m wondering if something went wrong during the extraction and that this file was not extracted as a sym link.


(Donnie Agema) #5

If you downloaded the toolchain from GitHub under Windows, instead of from within your VM, you will probably not have the sym link. If so, you should re-download from GitHub from witin you VM.


(intel123) #6

Hi thank you very much for your valuable support now I able to build the project. But if i am trying to debug the project its shows following issue

/nfs/iind/disks/i2r.disk.0001/RISCV_Evaluation/sifive/Projects/coreplexip_welcome/Debug/coreplexip_welcome.elf: Exec format error. Binary file not executable.


(Drew) #7

The examples include launch configurations. Be sure you are using the included OpenOCD Debug configuration by clicking Run–>Debug Configurations --> GDB OpenOCD Debug and selecting the appropriate project.


(intel123) #8

Hi Debug environment mandatory to connect board? or Any other options for software debug environment.


(Drew) #9

Freedom Studio wraps an Eclipse GUI around GCC, GDB, and OpenOCD. You are free to use all of these tools via the command line.

In Freedom-E-SDK we provide the same examples, and more, presented in a more traditional command line make environment:


(intel123) #10

Hi already i am using freedom-e-sdk. Can you share Freedomstudio example how to run? From this repo there is no readme document for Freedomstudio examples and also no Makefile present in this folder.


(Drew) #11

I’m sorry, but I’m not understanding what you are asking for. Freedom Studio includes several examples which are generated from Freedom-E-SDK.

Freedom Studio has a manual which describes how to get started. Chapter 4 covers importing the bundled zip examples as well as importing the Freedom-E-SDK examples. Please see the link below (and also in the bundle):

Freedom-E-SDK has its Readme file in the root directory which describes the setup and how to run the makefile.


(intel123) #12

Hi i am asking for
make software PROGRAM=dhrystone similar to how to run Freedomstudio different ip’s example?


(intel123) #13

Hi, i am trying to build any example from freedom-e-sdk the following issue occur…

make all
Building target: hello.elf
Invoking: GNU RISC-V Cross C Linker
riscv64-unknown-elf-gcc -march=rv32imac -mabi=ilp32 -mcmodel=medany -msmall-data-limit=8 -O2 -g3 -T “/nfs/iind/disks/i2r.disk.0001/RISCV_Evaluation/bsp/env/freedom-e300-hifive1/flash.lds” -nostartfiles -L…/…/wrap-hifive1/Debug -L…/ -Wl,-Map,“hello.map” -Wl,–start-group -Wl,–end-group -Wl,–wrap=malloc -Wl,–wrap=free -Wl,–wrap=open -Wl,–wrap=lseek -Wl,–wrap=read -Wl,–wrap=write -Wl,–wrap=fstat -Wl,–wrap=stat -Wl,–wrap=close -Wl,–wrap=link -Wl,–wrap=unlink -Wl,–wrap=execve -Wl,–wrap=fork -Wl,–wrap=getpid -Wl,–wrap=kill -Wl,–wrap=wait -Wl,–wrap=isatty -Wl,–wrap=times -Wl,–wrap=sbrk -Wl,–wrap=_exit -o “hello.elf” ./bsp/env/freedom-e300-hifive1/init.o ./bsp/env/entry.o ./bsp/env/start.o ./bsp/drivers/plic/plic_driver.o ./bsp/drivers/fe300prci/fe300prci_driver.o ./hello.o -lc -lwrap-hifive1
/nfs/iind/disks/i2r.disk.0001/RISCV_Evaluation/sifive/FreedomStudio/SiFive/riscv64-unknown-elf-gcc-20170612-x86_64-linux-centos6/bin/…/lib/gcc/riscv64-unknown-elf/7.1.1/…/…/…/…/riscv64-unknown-elf/bin/ld: cannot find -lwrap-hifive1
collect2: error: ld returned 1 exit status
make: *** [hello.elf] Error 1


(Drew) #14

When building the Freedom-E-SDK examples in Freedom Studio, you must import and build the wrap project for the board first. In your case, import the wrap-hifive1 project and build it.