Boot up

Hi Expert,

I want to run software for initial bootup, I have gone through Links and Makefile and ran below command

 make  software PROGRAM=hello TARGET=design-rtl CONFIGURATION=debug

Initially, I was facing this error with os6
"configure:2877: gcc -V >&5
gcc: error: unrecognized command line option ‘-V’
gcc: fatal error: no input files
compilation terminated.
configure:2888: $? = 1
configure:2877: gcc -qversion >&5
gcc: error: unrecognized command line option ‘-qversion’; did you mean ‘–version’?
"

After that I tried running with os7 and could see below error
"
configure:2639: result: gcc
configure:2868: checking for C compiler version
configure:2877: gcc --version >&5
gcc: /lib64/libc.so.6: version GLIBC_2.14' not found (required by gcc) configure:2888: $? = 1 configure:2877: gcc -v >&5 gcc: /lib64/libc.so.6: version GLIBC_2.14’ not found (required by gcc)
configure:2888: $? = 1
configure:2877: gcc -V >&5
gcc: /lib64/libc.so.6: version `GLIBC_2.14’ not found (required by gcc)

"
I’m very new to this environment, not sure what i’m missing. I would appreciate for any help.

Thanks in advance.

Regards,
Vijaya

"configure:2877: gcc -V >&5
gcc: error: unrecognized command line option ‘-V’
gcc: fatal error: no input files

This isn’t an error. This is normal. The configure script is probing the compiler to see what command line options it accepts. Different compilers from different vendors support different command line options, so the configure script just tries all possible options to find the one that works.

configure:2877: gcc --version >&5
gcc: /lib64/libc.so.6: version GLIBC_2.14' not found (required by gcc)

This is a problem with your OS. It looks like a mismatch between your compiler and your GNU C library which is odd. Not clear how that could happen offhand. If the “gcc” compiler you are using the one in /usr/bin/gcc, and if not, where did you get it from?

Your reference to “os6” and “os7” is ambiguous, as a lot of different OS vendors have different operating systems with version 6 and version 7. However, I’ll guess that you have RHEL/CentOS 6 and 7 as that seems to match the glibc 2.14 error. RHEL/CentOS6 originally shipped with glibc 2.12, and RHEL/CentOS7 originally shipped with 2.17. So maybe there was an upgrade to RHEL/Centos6 that added glibc 2.14, and you are missing that update.

Another issue here is that it looks like you are trying to build freedom-e-sdk, but that requires a RISC-V compiler. Do you have one? This is not part of freedom-e-sdk. You can build from from sifive/freedom-tools, or download one from our web site. We also have an eclipse based environment that includes a toolchain and freedom-e-sdk libraries.

Hi,

Thank you for the explanation.

I tried compiling the risc-v compiler, and I’m observing below issue.
command: make software PROGRAM=hello TARGET=design-rtl CONFIGURATION=debug

Error:
"…/tools/riscv64-CentOS-6/bin/…/lib/gcc/riscv64-unknown-elf/8.3.0/…/…/…/…/riscv64-unknown-elf/bin/ld: hello section .text' will not fit in region rom’
…/tools/riscv64-CentOS-6/bin/…/lib/gcc/riscv64-unknown-elf/8.3.0/…/…/…/…/riscv64-unknown-elf/bin/ld: region `rom’ overflowed by 16208 bytes
collect2: error: ld returned 1 exit status
make[1]: *** [hello] Error 1
"
These are compile option provided to the tool
"…/tools/riscv64-CentOS-6/bin/riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=/user/srg.tmp/tools/riscv64-CentOS-6/bin/riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/user/srg.tmp/tools/riscv64-CentOS-6/bin/…/libexec/gcc/riscv64-unknown-elf/8.3.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /scratch/jenkins/workspace/tpp-freedom-tools/tpp04–build-binary-packages–parameterized/obj/x86_64-linux-centos6/build/riscv-gnu-toolchain/riscv-gcc/configure --target=riscv64-unknown-elf --prefix=/scratch/jenkins/workspace/tpp-freedom-tools/tpp04–build-binary-packages–parameterized/obj/x86_64-linux-centos6/install/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-linux-centos6 --with-pkgversion=‘SiFive GCC 8.3.0-2020.04.1’ --with-bugurl=https://github.com/sifive/freedom-tools/issues --disable-shared --disable-threads --enable-languages=c,c++ --enable-tls --with-newlib --with-sysroot=/scratch/jenkins/workspace/tpp-freedom-tools/tpp04–build-binary-packages–parameterized/obj/x86_64-linux-centos6/install/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-linux-centos6/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=…/riscv-gcc --with-system-zlib --enable-checking=yes --enable-multilib --with-abi=lp64d --with-arch=rv64imafdc CFLAGS=-O2 CXXFLAGS=-O2 ‘CFLAGS_FOR_TARGET=-Os -mcmodel=medany’ ‘CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany’
Thread model: single
gcc version 8.3.0 (SiFive GCC 8.3.0-2020.04.1)
"

Thanks,
Vijayasree

You need to reduce the size of the text section so that it will fit in the rom that you have.

With riscv-gnu-toolchain, you can use --specs=nano.specs to use an alternative newlib-nano C library that is smaller than the default newlib C library. This may solve the problem.

You can use tools like objdump and readelf to look at your binary, and figure out why it is too large. You can get a list of function sorted from largest to smallest by using “nm --print-size --sort-size --reverse-sort a.out”.