LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-26-2019, 03:46 AM   #1
sagarkasrung
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Rep: Reputation: Disabled
Smile 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

$ /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

## --------- ##
## Platform. ##
## --------- ##

hostname = sagar-VirtualBox
uname -m = x86_64
uname -r = 4.18.0-22-generic
uname -s = Linux
uname -v = #23~18.04.1-Ubuntu SMP Thu Jun 6 08:37:25 UTC 2019

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin
PATH: /data2/Risc-V/Vivado/Vivado/2017.1/bin


## ----------- ##
## Core tests. ##
## ----------- ##

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

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CCASFLAGS_set=
ac_cv_env_CCASFLAGS_value=
ac_cv_env_CCAS_set=
ac_cv_env_CCAS_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-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'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_DTC_set=
ac_cv_env_DTC_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LDSCRIPT_GENERATOR_set=
ac_cv_env_LDSCRIPT_GENERATOR_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_MAKEATTRIBUTES_GENERATOR_set=
ac_cv_env_MAKEATTRIBUTES_GENERATOR_value=
ac_cv_env_METAL_HEADER_GENERATOR_set=
ac_cv_env_METAL_HEADER_GENERATOR_value=
ac_cv_env_SPECS_GENERATOR_set=
ac_cv_env_SPECS_GENERATOR_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=riscv64-unknown-elf
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_CC=riscv64-unknown-elf-gcc
ac_cv_prog_STRIP=riscv64-unknown-elf-strip
ac_cv_prog_make_make_set=yes
am_cv_make_support_nested_variables=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /data2/Risc-V/freedom-e-sdk/freedom-metal/missing aclocal-1.15'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR=''
AUTOCONF='${SHELL} /data2/Risc-V/freedom-e-sdk/freedom-metal/missing autoconf'
AUTOHEADER='${SHELL} /data2/Risc-V/freedom-e-sdk/freedom-metal/missing autoheader'
AUTOMAKE='${SHELL} /data2/Risc-V/freedom-e-sdk/freedom-metal/missing automake-1.15'
AWK='gawk'
CC='riscv64-unknown-elf-gcc'
CCAS=''
CCASDEPMODE=''
CCASFLAGS=''
CCDEPMODE=''
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'
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DTC=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LDFLAGS=''
LDSCRIPT_GENERATOR=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MACHINE_DTS=''
MACHINE_HEADER=''
MACHINE_LDSCRIPT=''
MACHINE_NAME=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEATTRIBUTES_GENERATOR=''
MAKEINFO='${SHELL} /data2/Risc-V/freedom-e-sdk/freedom-metal/missing makeinfo'
MENV_METAL=''
METAL_HEADER_GENERATOR=''
MKDIR_P='/bin/mkdir -p'
MMACHINE_MACHINE_NAME=''
OBJEXT=''
PACKAGE='freedom-metal'
PACKAGE_BUGREPORT='palmer@sifive.com'
PACKAGE_NAME='freedom-metal'
PACKAGE_STRING='freedom-metal v0.1.2'
PACKAGE_TARNAME='freedom-metal'
PACKAGE_URL=''
PACKAGE_VERSION='v0.1.2'
PATH_SEPARATOR=':'
PRECONFIGURED_FALSE=''
PRECONFIGURED_TRUE=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/bash'
SPECS_GENERATOR=''
STRIP='riscv64-unknown-elf-strip'
VERSION='v0.1.2'
WITH_BUILTIN_LIBGLOSS_FALSE=''
WITH_BUILTIN_LIBGLOSS_TRUE=''
ac_ct_AR=''
ac_ct_CC=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCCAS_FALSE=''
am__fastdepCCAS_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__isrc=' -I$(srcdir)'
am__leading_dot='.'
am__nodep=''
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias='riscv64-unknown-elf'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /data2/Risc-V/freedom-e-sdk/freedom-metal/install-sh'
libdir='/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/install/lib/debug'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/data2/Risc-V/freedom-e-sdk/bsp/freedom-e310-arty/install'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* 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"

configure: exit 77


Please help me from beginers stage.
Regards,
Sagar
 
Old 06-26-2019, 04:46 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,445

Rep: Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341
On x86_64, & gcc-8.3.0, there is no option '-V'

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.
 
Old 06-26-2019, 05:14 AM   #3
sagarkasrung
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile 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.

Regards,
Sagar
 
Old 06-26-2019, 02:35 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,445

Rep: Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341
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.
 
Old 06-26-2019, 04:58 PM   #5
sagarkasrung
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile Not able to execute simple Hello program

Dear Sir,

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.

Regards,
Sagar
 
Old 06-26-2019, 05:05 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,741

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Quote:
Originally Posted by sagarkasrung View Post
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.
Who is “they”? Is this homework/schoolwork?
 
Old 06-26-2019, 05:49 PM   #7
sagarkasrung
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile Please help me to solve this issue

Dear sir,

I have made query to get solution.
If you know anything regarding this query, then do reply,
I want to execute hello program in riscv.
 
Old 06-27-2019, 04:10 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,445

Rep: Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341
Please post the error you're getting.

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.
 
Old 06-27-2019, 11:51 AM   #9
sagarkasrung
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile 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.

Warm Regards,
Sagar Kasrung
 
Old 06-27-2019, 12:36 PM   #10
sagarkasrung
LQ Newbie
 
Registered: Jun 2019
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile Hwew is the Link, In which steps are given, and I am following those steps

Quote:
Originally Posted by scasey View Post
Who is “they”? Is this homework/schoolwork?

https://nm-projects.de/2017/06/open-...ix-7-35t-arty/


Please find the attached link.
 
Old 06-28-2019, 09:02 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,445

Rep: Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341Reputation: 2341
I checked the link.

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.
 
Old 06-28-2019, 10:41 AM   #12
RickDeckard
Member
 
Registered: Jan 2014
Location: Canton, Georgia, USA
Distribution: Debian 12
Posts: 205

Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Vivado on host from guest bash riscv Linux - Newbie 2 04-27-2017 11:28 AM
gcc: error: unrecognized command line option '-V' bahjat93 Linux - Newbie 20 04-09-2017 05:59 AM
cc: error: unrecognized command line option ‘-m-L../lib’ shumbamajachani Linux - Software 6 02-09-2013 12:05 PM
use gcc command to compile a *.c file error:unrecognized option '--eh-frame-hdr' just2012 Linux - Software 2 06-30-2011 10:19 AM
cc1: error: unrecognized command line option "-mapcs-32" vengat Linux - Hardware 0 04-29-2008 02:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration