RISC V Based project with Xilinx Vivado on Ubuntu Linux(riscv64-unknown-elf-gcc: error: unrecognized command line option '-V')
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
RISC V Based project with Xilinx Vivado on Ubuntu Linux(riscv64-unknown-elf-gcc: error: unrecognized command line option '-V')
Dear Sir,
I am working on Open Source Risc-V on the Xilinx Artix-7 35T Arty.
I did all the steps which was given in the procedure, but facing following error.
"riscv64-unknown-elf-gcc: error: unrecognized command line option '-V'"
While executing make Hello word, I got following error, Which I could not rectify.
Following config.log file executed when I tried to make hello word program.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by freedom-metal configure v0.1.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
configure:1929: checking for a BSD-compatible install
configure:1997: result: /usr/bin/install -c
configure:2008: checking whether build environment is sane
configure:2063: result: yes
configure:2122: checking for riscv64-unknown-elf-strip
configure:2138: found /usr/local/bin/riscv64-unknown-elf-strip
configure:2149: result: riscv64-unknown-elf-strip
configure:2214: checking for a thread-safe mkdir -p
configure:2253: result: /bin/mkdir -p
configure:2260: checking for gawk
configure:2276: found /usr/bin/gawk
configure:2287: result: gawk
configure:2298: checking whether make sets $(MAKE)
configure:2320: result: yes
configure:2349: checking whether make supports nested variables
configure:2366: result: yes
configure:2493: checking whether to enable maintainer-specific portions of Makefiles
configure:2502: result: no
configure:2546: checking for riscv64-unknown-elf-gcc
configure:2562: found /usr/local/bin/riscv64-unknown-elf-gcc
configure:2573: result: riscv64-unknown-elf-gcc
configure:2842: checking for C compiler version
configure:2851: riscv64-unknown-elf-gcc --version >&5
riscv64-unknown-elf-gcc (GCC) 7.2.0
Copyright (C) 2017 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.
configure:2862: $? = 0
configure:2851: riscv64-unknown-elf-gcc -v >&5
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/riscv64-unknown-elf/7.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /data2/Risc-V/freedom/rocket-chip/riscv-tools/riscv-gnu-toolchain/riscv-gcc/configure --target=riscv64-unknown-elf --prefix=/usr/local --disable-shared --disable-threads --enable-languages=c,c++ --with-system-zlib --enable-tls --with-newlib --with-sysroot=/usr/local/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --src=.././riscv-gcc --enable-checking=yes --disable-multilib --with-abi=lp64d --with-arch=rv64imafdc 'CFLAGS_FOR_TARGET=-Os -mcmodel=medlow'
Thread model: single
gcc version 7.2.0 (GCC)
configure:2862: $? = 0
configure:2851: riscv64-unknown-elf-gcc -V >&5
riscv64-unknown-elf-gcc: error: unrecognized command line option '-V'
riscv64-unknown-elf-gcc: fatal error: no input files
compilation terminated.
configure:2862: $? = 1
configure:2851: riscv64-unknown-elf-gcc -qversion >&5
riscv64-unknown-elf-gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
riscv64-unknown-elf-gcc: fatal error: no input files
compilation terminated.
configure:2862: $? = 1
configure:2882: checking whether the C compiler works
configure:2904: riscv64-unknown-elf-gcc -march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections -I/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/install/include -O0 -g conftest.c >&5
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/crt0.o: ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/crt0.o
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/crtbegin.o: ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/crtbegin.o
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-atexit.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-atexit.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-exit.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-exit.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-fini.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-fini.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-impure.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-impure.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-init.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-init.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-memset.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-memset.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-__atexit.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-__atexit.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-__call_atexit.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-__call_atexit.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libgloss.a(sys_exit.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libgloss.a(sys_exit.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-errno.o): ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/libc.a(lib_a-errno.o)
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/crtend.o: ABI is incompatible with that of the selected emulation:
target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/crtend.o
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: a.out(.text): relocation "main+0x0 (type R_RISCV_CALL)" goes out of range
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: /usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/lib/crt0.o: file class ELFCLASS64 incompatible with ELFCLASS32
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
configure:2908: $? = 1
configure:2946: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "freedom-metal"
| #define PACKAGE_TARNAME "freedom-metal"
| #define PACKAGE_VERSION "v0.1.2"
| #define PACKAGE_STRING "freedom-metal v0.1.2"
| #define PACKAGE_BUGREPORT "palmer@sifive.com"
| #define PACKAGE_URL ""
| #define PACKAGE "freedom-metal"
| #define VERSION "v0.1.2"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2951: error: in `/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/build/debug':
configure:2953: error: C compiler cannot create executables
See `config.log' for more details
Run 'gcc --version' to get your gcc version. Development and testing is more than limited on the more exotic architectures. You may have saved in buying yourself an Arm core, but you might have taken on a heap of trouble getting the chip built, and geiitng a credible OS together. Is this your first time working with Risc V? Post your gcc version.
I would have a look around your gcc source or anywhere you can get ideas for the oldest files. It could be expecting gcc-2.95, or something ridiculously old like that. That was the only gcc approved for kernel building at one stage in the dim distant past.
RISC V Based project with Xilinx Vivado on Ubuntu Linux(riscv64-unknown-elf-gcc: error: unrecognized command line option '-V')
Hi There,
Thank you very much for your reply,
Yeah i am totally new to RISC V,
I run 'gcc --version' this command and got following reply,
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 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 am using Virtual Machine to run Ubuntu 18.04.2 desktop amd64,
Xilinx Vivado version 2017.1 already install.
Well for building this Project they have given us steps,and I am following those steps.
Please let me know ,where I have gone wrong.
What's the date of those instructions?
/begin boring history
RISC was a big thing in the 1990s, because it was felt you could miniaturize the cpu core and do clever stuff there perhaps getting speeds up. To do that with ancient design ideas, some saw RISC (Reduced Instruction Set Computers) as the way forward. You have to understand that wafer fab was comparatively huge back then. Now we have multicore CPUs with complete instruction sets doing amazing things with sub-microscopic wafer fab.
/end boring history
I don't know why there's RISC-V in 2010. If you can't get a compile in gcc, be aware that there's LLVM support also, why I dunno. Please go back to your compile. Here, gcc spits out
Code:
gcc: error: unrecognized command line option '-V'
and carries on, so that shouldn't stop you. If we can, we'll ignore it.
Even though we ignore this error,
But I am not able to execute the Hello program in Freedom-E-SDK,
Can you tell me exactly How I can tackle these errors,
As my ultimate goal is to execute the Hello program and also running the Make file for this project.
When the compile pukes, hit up-arrow and return. that should skip to the last uncompleted line and repeat it. Post the output. That's how you solve these things.
Error which I am getting after running Hello word program
Dear Sir,
I have install all prerequisite software required to compile a bare-metal RISC-V program.
So I am running following command,
make PROGRAM=hello TARGET=freedom-e310-arty
I am getting following error
sagar@sagar-VirtualBox:/data2/Risc-V/freedom-e-sdk$ make PROGRAM=hello TARGET=freedom-e310-arty
cd /data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/build/debug/ && \
CFLAGS="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections -I/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/install/include -O0 -g" \
/data2/Risc-V/freedom-e-sdk/freedom-metal/configure \
--host=riscv64-unknown-elf \
--prefix=/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/install \
--libdir=/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/install/lib/debug \
--disable-maintainer-mode \
--with-preconfigured \
--with-machine-name=freedom-e310-arty \
--with-machine-header=/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/metal.h \
--with-machine-ldscript=/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/metal.default.lds \
--with-builtin-libgloss
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for riscv64-unknown-elf-strip... riscv64-unknown-elf-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for riscv64-unknown-elf-gcc... riscv64-unknown-elf-gcc
checking whether the C compiler works... no
configure: error: in `/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/build/debug':
configure: error: C compiler cannot create executables
See `config.log' for more details
scripts/libmetal.mk:17: recipe for target '/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/build/debug/Makefile' failed
make: *** [/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/build/debug/Makefile] Error 77
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
From this I have not understoon one point , in last path it says
/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/build/debug/Makefile
In reality there is no Makefile.
Now it says please look config.log file for more details,
I am putting only error parts from config file as follows,
1. configure:2851: riscv64-unknown-elf-gcc -V >&5
riscv64-unknown-elf-gcc: error: unrecognized command line option '-V'
riscv64-unknown-elf-gcc: fatal error: no input files
2.configure:2851: riscv64-unknown-elf-gcc -qversion >&5
riscv64-unknown-elf-gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
riscv64-unknown-elf-gcc: fatal error: no input files
compilation terminated.
3.riscv64-unknown-elf/lib/crt0.o: file class ELFCLASS64 incompatible with ELFCLASS32
/usr/local/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: final link failed: File in wrong format
collect2: error: ld returned 1 exit status
4.configure:2951: error: in `/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/build/debug':
configure:2953: error: C compiler cannot create executables
This are all errors which I have seen in config.log file,
I hope I will get some productive output from Linuxquestions.org.
All these FPGA manufacturers have their own cpu cores. The idea is: Don't buy Arm IP - use ours, because it's cheap/free. So you do, you write your IP for the core which only goes in their chip. It's a way of locking in customers.
He has a Xilinx dev board, and is falling at the first hurdle. Let him post the stuff he's been asked for since post #1 if he wants help. Otherise we can go silent.
The presence of -V and -qversion in your output seems to imply that there's a problem in your makepkg.conf. Try looking in there to fix any possible errors.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.