LinuxQuestions.org
Help answer threads with 0 replies.
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 03-22-2017, 07:18 AM   #1
riscv
Member
 
Registered: Mar 2017
Posts: 34

Rep: Reputation: Disabled
RISCV installation error : make: g++: Command not found


Hello,

I'm installing riscv-tools found at riscv.org.

These are the commands i've run (after cloning the riscv-tools repository)

PATH=$PATH:/home/alpha/riscv-tools
export PATH=$PATH:/home/alpha/riscv-tools
git submodule update --init --recursive
export RISCV=/home/alpha/riscv-tools
export PATH=$PATH:/home/alpha/riscv-tools/bin


With CC=gcc-5 CXX=g++-5 ./build.sh
I get:

Code:
Starting RISC-V Toolchain build process

Removing existing riscv-fesvr/build directory
Configuring project riscv-fesvr
Building project riscv-fesvr
Installing project riscv-fesvr

Removing existing riscv-isa-sim/build directory
Configuring project riscv-isa-sim
Building project riscv-isa-sim
g++-5: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
make: *** [disasm.o] Error 4
with CC=gcc-4.8 CXX=g++-4.8 ./build.sh
I get:

Code:
Starting RISC-V Toolchain build process

Removing existing riscv-fesvr/build directory
Configuring project riscv-fesvr
Building project riscv-fesvr
make: g++-4.8: Command not found
make: *** [elfloader.o] Error 127
with only ./build.sh

I get:

Code:
Starting RISC-V Toolchain build process

Removing existing riscv-fesvr/build directory
Configuring project riscv-fesvr
Building project riscv-fesvr
make: g++: Command not found
make: *** [elfloader.o] Error 127

Can you please tell me what I'm doing wrong (in beginner level explanation please) ? Thank you

------------------------------------------------------------------------------------------------
PS: Inside the riscv-gnu-toolchain, I find the config.log file and here is what it says:

Code:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by riscv-toolchain configure 1.0, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --prefix=/home/alpha/riscv-tools

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

hostname = alpha-VirtualBox
uname -m = x86_64
uname -r = 4.4.0-66-generic
uname -s = Linux
uname -v = #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017

/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: /home/alpha/riscv-tools/bin
PATH: /home/alpha/riscv-tools/bin
PATH: /home/alpha/riscv-tools/bin
PATH: /home/alpha/riscv-tools/bin
PATH: /home/alpha/riscv-tools/bin
PATH: /home/alpha/riscv-tools/bin
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: /home/alpha/riscv-tools/riscv/bin
PATH: RISCV
PATH: bin
PATH: RISCV/bin
PATH: /home/alpha/riscv-tools/bin
PATH: /home/alpha/riscv-tools/bin
PATH: /home/alpha/riscv/bin
PATH: /home/alpha/riscv-tools/bin


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

configure:1876: checking for gcc
configure:1903: result: gcc-4.8
configure:2132: checking for C compiler version
configure:2141: gcc-4.8 --version >&5
gcc-4.8 (Ubuntu 4.8.5-4ubuntu2) 4.8.5
Copyright (C) 2015 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:2152: $? = 0
configure:2141: gcc-4.8 -v >&5
Using built-in specs.
COLLECT_GCC=gcc-4.8
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.5-4ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.5 (Ubuntu 4.8.5-4ubuntu2) 
configure:2152: $? = 0
configure:2141: gcc-4.8 -V >&5
gcc-4.8: error: unrecognized command line option '-V'
gcc-4.8: fatal error: no input files
compilation terminated.
configure:2152: $? = 4
configure:2141: gcc-4.8 -qversion >&5
gcc-4.8: error: unrecognized command line option '-qversion'
gcc-4.8: fatal error: no input files
compilation terminated.
configure:2152: $? = 4
configure:2172: checking whether the C compiler works
configure:2194: gcc-4.8    conftest.c  >&5
configure:2198: $? = 0
configure:2246: result: yes
configure:2249: checking for C compiler default output file name
configure:2251: result: a.out
configure:2257: checking for suffix of executables
configure:2264: gcc-4.8 -o conftest    conftest.c  >&5
configure:2268: $? = 0
configure:2290: result: 
configure:2312: checking whether we are cross compiling
configure:2320: gcc-4.8 -o conftest    conftest.c  >&5
configure:2324: $? = 0
configure:2331: ./conftest
configure:2335: $? = 0
configure:2350: result: no
configure:2355: checking for suffix of object files
configure:2377: gcc-4.8 -c   conftest.c >&5
configure:2381: $? = 0
configure:2402: result: o
configure:2406: checking whether we are using the GNU C compiler
configure:2425: gcc-4.8 -c   conftest.c >&5
configure:2425: $? = 0
configure:2434: result: yes
configure:2443: checking whether gcc-4.8 accepts -g
configure:2463: gcc-4.8 -c -g  conftest.c >&5
configure:2463: $? = 0
configure:2504: result: yes
configure:2521: checking for gcc-4.8 option to accept ISO C89
configure:2584: gcc-4.8  -c -g -O2  conftest.c >&5
configure:2584: $? = 0
configure:2597: result: none needed
configure:2617: checking for grep that handles long lines and -e
configure:2675: result: /bin/grep
configure:2680: checking for fgrep
configure:2742: result: /bin/grep -F
configure:2747: checking for grep that handles long lines and -e
configure:2805: result: /bin/grep
configure:2813: checking for bash
configure:2844: result: /bin/bash
configure:2915: checking for __gmpz_init in -lgmp
configure:2940: gcc-4.8 -o conftest -g -O2   conftest.c -lgmp   >&5
configure:2940: $? = 0
configure:2949: result: yes
configure:2962: checking for mpfr_init in -lmpfr
configure:2987: gcc-4.8 -o conftest -g -O2   conftest.c -lmpfr  -lgmp  >&5
configure:2987: $? = 0
configure:2996: result: yes
configure:3009: checking for mpc_init2 in -lmpc
configure:3034: gcc-4.8 -o conftest -g -O2   conftest.c -lmpc  -lmpfr -lgmp  >&5
configure:3034: $? = 0
configure:3043: result: yes
configure:3066: checking for curl
configure:3084: found /usr/bin/curl
configure:3097: result: /usr/bin/curl
configure:3107: checking for wget
configure:3125: found /usr/bin/wget
configure:3138: result: /usr/bin/wget
configure:3148: checking for ftp
configure:3166: found /usr/bin/ftp
configure:3179: result: /usr/bin/ftp
configure:3464: creating ./config.status

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by riscv-toolchain config.status 1.0, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = 
  CONFIG_HEADERS  = 
  CONFIG_LINKS    = 
  CONFIG_COMMANDS = 
  $ ./config.status 

on alpha-VirtualBox

config.status:738: creating Makefile
config.status:738: creating scripts/wrapper/awk/awk
config.status:738: creating scripts/wrapper/sed/sed

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

ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=set
ac_cv_env_CC_value=gcc-4.8
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_lib_gmp___gmpz_init=yes
ac_cv_lib_mpc_mpc_init2=yes
ac_cv_lib_mpfr_mpfr_init=yes
ac_cv_objext=o
ac_cv_path_BASH=/bin/bash
ac_cv_path_CURL=/usr/bin/curl
ac_cv_path_FGREP='/bin/grep -F'
ac_cv_path_FTP=/usr/bin/ftp
ac_cv_path_GAWK=/usr/bin/gawk
ac_cv_path_GREP=/bin/grep
ac_cv_path_GSED=/bin/sed
ac_cv_path_WGET=/usr/bin/wget
ac_cv_prog_ac_ct_CC=gcc-4.8
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes

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

BASH='/bin/bash'
CC='gcc-4.8'
CFLAGS='-g -O2'
CPPFLAGS=''
CURL='/usr/bin/curl'
DEFS='-DPACKAGE_NAME="riscv-toolchain" -DPACKAGE_TARNAME="riscv-toolchain" -DPACKAGE_VERSION="1.0" -DPACKAGE_STRING="riscv-toolchain\ 1.0" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DHAVE_LIBGMP=1 -DHAVE_LIBMPFR=1 -DHAVE_LIBMPC=1'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
FETCHER='/usr/bin/curl -L -o - --ftp-pasv --retry 10'
FGREP='/bin/grep -F'
FTP='/usr/bin/ftp'
GAWK='/usr/bin/gawk'
GREP='/bin/grep'
GSED='/bin/sed'
LDFLAGS=''
LIBOBJS=''
LIBS='-lmpc -lmpfr -lgmp '
LTLIBOBJS=''
NEED_GCC_EXTERNAL_LIBRARIES='false'
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='riscv-toolchain'
PACKAGE_STRING='riscv-toolchain 1.0'
PACKAGE_TARNAME='riscv-toolchain'
PACKAGE_URL=''
PACKAGE_VERSION='1.0'
PATH_SEPARATOR=':'
SHELL='/bin/bash'
WGET='/usr/bin/wget'
WITH_ABI='--with-abi=lp64d'
WITH_ARCH='--with-arch=rv64g'
ac_ct_CC='gcc-4.8'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
default_target='newlib'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='${prefix}'
gcc_checking='--enable-checking=yes'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
multilib_flags='--disable-multilib'
multilib_names=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/home/alpha/riscv-tools'
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 "riscv-toolchain"
#define PACKAGE_TARNAME "riscv-toolchain"
#define PACKAGE_VERSION "1.0"
#define PACKAGE_STRING "riscv-toolchain 1.0"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define HAVE_LIBGMP 1
#define HAVE_LIBMPFR 1
#define HAVE_LIBMPC 1

configure: exit 0

Last edited by riscv; 03-23-2017 at 10:00 AM.
 
Old 03-23-2017, 08:15 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Please edit your {text / configuring / error} blocks to use code tags :
http://www.linuxquestions.org/questi....php?do=bbcode
I.e. : [code]code text[/code]

Like
Code:
.
.
. 
## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "riscv-toolchain"
#define PACKAGE_TARNAME "riscv-toolchain"
#define PACKAGE_VERSION "1.0"
#define PACKAGE_STRING "riscv-toolchain 1.0"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define HAVE_LIBGMP 1
#define HAVE_LIBMPFR 1
#define HAVE_LIBMPC 1

configure: exit 0
 
Old 03-23-2017, 10:28 AM   #3
riscv
Member
 
Registered: Mar 2017
Posts: 34

Original Poster
Rep: Reputation: Disabled
Thank you for replying.

So i removed it all and redid it. The same error occurs.

for the g++,i've tried:
sudo apt-get install g++
./build.sh

and
export RISCV=/home/alpha/riscv-tools && ./build.sh


and for fatal: Not a valid object name HEAD, i've used:
git symbolic-ref HEAD refs/heads/my-branch

The outcome is:
Code:
alpha@alpha-VirtualBox:~/riscv-tools$ export RISCV=/home/alpha/riscv-tools && ./build.sh
Starting RISC-V Toolchain build process

Removing existing riscv-fesvr/build directory
Configuring project riscv-fesvr
Building project riscv-fesvr
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
  limiting output:
    --max-count=<n>
    --max-age=<epoch>
    --min-age=<epoch>
    --sparse
    --no-merges
    --min-parents=<n>
    --no-min-parents
    --max-parents=<n>
    --no-max-parents
    --remove-empty
    --all
    --branches
    --tags
    --remotes
    --stdin
    --quiet
  ordering output:
    --topo-order
    --date-order
    --reverse
  formatting output:
    --parents
    --children
    --objects | --objects-edge
    --unpacked
    --header | --pretty
    --abbrev=<n> | --no-abbrev
    --abbrev-commit
    --left-right
    --count
  special purpose:
    --bisect
    --bisect-vars
    --bisect-all
fatal: Not a valid object name HEAD
make: g++: Command not found
make: *** [elfloader.o] Error 127
 
Old 03-23-2017, 10:57 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
i've used:
git symbolic-ref HEAD refs/heads/my-branch
? What does that mean ? Please elaborate.
""git symbolic-ref HEAD refs/heads/my-branch"" doesn't seem to be required.


Quote:
g++: Command not found
Are you sure g++ is installed ? Please test : $ g++
... The command g++ should answer with "g++: fatal error: no input files".

-
 
Old 03-24-2017, 10:04 AM   #5
riscv
Member
 
Registered: Mar 2017
Posts: 34

Original Poster
Rep: Reputation: Disabled
Hello,

Apparently even when i installed g++ it was still appearing as not installed. So i reinstalled it and it worked. But i still have errors related to gcc (libiberty for example).

The riscv-tools directory looks like this:
Code:
build.common      build.sh             build-spike-pk.sh  regression.sh  riscv-fesvr          riscv-isa-sim  riscv-opcodes  riscv-tests
build-rv32ima.sh  build-spike-only.sh  README.md          riscv          riscv-gnu-toolchain  riscv-llvm     riscv-pk
I'm trying to install the riscv-gnu-toochain which looks like this:

Code:
bin    build-binutils-newlib  config.log     configure     hello.c  lib      linux-headers  Makefile.in  riscv64-unknown-elf  riscv-dejagnu  riscv-glibc   scripts  src
build  build-gcc-newlib       config.status  configure.ac  include  LICENSE  Makefile       README.md    riscv-binutils-gdb   riscv-gcc      riscv-newlib  share    stamps
So i run the following from the riscv-tools directory:

Code:
git submodule update --init --recursive
sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils 
export TOP=$(pwd)
export RISCV=$TOP/riscv
export PATH=$PATH:$RISCV/bin
export MAKEFLAGS="$MAKEFLAGS -j5"
./build.sh
Now, the ./build.sh looks like this
Code:
#! /bin/bash
#
# Script to build RISC-V ISA simulator, proxy kernel, and GNU toolchain.
# Tools will be installed to $RISCV.

. build.common

echo "Starting RISC-V Toolchain build process"

build_project riscv-fesvr --prefix=$RISCV
build_project riscv-isa-sim --prefix=$RISCV --with-fesvr=$RISCV
build_project riscv-gnu-toolchain --prefix=$RISCV
CC= CXX= build_project riscv-pk --prefix=$RISCV --host=riscv64-unknown-elf
build_project riscv-tests --prefix=$RISCV/riscv64-unknown-elf


echo -e "\\nRISC-V Toolchain installation completed!"
At the riscv-gnu-toolchain stage: it yields this error:
Code:
...
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib/etc'
mkdir -p -- ./fixincludes
Configuring in ./fixincludes
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... riscv64-unknown-elf
checking for x86_64-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a sed that does not truncate output... /bin/sed
checking whether gcc supports -W... yes
checking whether gcc supports -Wall... yes
checking whether gcc supports -Wwrite-strings... yes
checking whether gcc supports -Wstrict-prototypes... yes
checking whether gcc supports -Wmissing-prototypes... yes
checking whether gcc supports -Wold-style-definition... yes
checking whether gcc supports -Wmissing-format-attribute... yes
checking whether gcc supports -Woverlength-strings... yes
checking whether gcc supports -pedantic -Wlong-long... yes
checking for ANSI C header files... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking for sys/stat.h... (cached) yes
checking for clearerr_unlocked... yes
checking for feof_unlocked... yes
checking for ferror_unlocked... yes
checking for fflush_unlocked... yes
checking for fgetc_unlocked... yes
checking for fgets_unlocked... yes
checking for fileno_unlocked... yes
checking for fprintf_unlocked... no
checking for fputc_unlocked... yes
checking for fputs_unlocked... yes
checking for fread_unlocked... yes
checking for fwrite_unlocked... yes
checking for getchar_unlocked... yes
checking for getc_unlocked... yes
checking for putchar_unlocked... yes
checking for putc_unlocked... yes
checking whether abort is declared... yes
checking whether asprintf is declared... yes
checking whether basename is declared... yes
checking whether errno is declared... no
checking whether vasprintf is declared... yes
checking whether clearerr_unlocked is declared... yes
checking whether feof_unlocked is declared... yes
checking whether ferror_unlocked is declared... yes
checking whether fflush_unlocked is declared... yes
checking whether fgetc_unlocked is declared... yes
checking whether fgets_unlocked is declared... yes
checking whether fileno_unlocked is declared... yes
checking whether fprintf_unlocked is declared... no
checking whether fputc_unlocked is declared... yes
checking whether fputs_unlocked is declared... yes
checking whether fread_unlocked is declared... yes
checking whether fwrite_unlocked is declared... yes
checking whether getchar_unlocked is declared... yes
checking whether getc_unlocked is declared... yes
checking whether putchar_unlocked is declared... yes
checking whether putc_unlocked is declared... yes
checking for an ANSI C-conforming const... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mkheaders.almost
config.status: creating config.h
make[3]: Entering directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib/fixincludes'
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixincl.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixtests.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixfixes.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/server.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/procopen.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixlib.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long   -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixopts.c
make[3]: *** No rule to make target '../libiberty/libiberty.a', needed by 'full-stamp'.  Stop.
make[3]: Leaving directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib/fixincludes'
Makefile:3757: recipe for target 'all-fixincludes' failed
make[2]: *** [all-fixincludes] Error 2
make[2]: Leaving directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib'
Makefile:857: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib'
Makefile:218: recipe for target 'stamps/build-gcc-newlib' failed
make: *** [stamps/build-gcc-newlib] Error 2
Also, since the everything is connected, when i run these commands in the riscv-pk directory, i get this error relative to gcc also:
Code:
alpha@alpha-VirtualBox:~/installation/rocket-chip/riscv-tools/riscv-pk/build$ ../configure --prefix=$RISCV --host=riscv64-unknown-elf
checking build system type... x86_64-unknown-linux-gnu
checking host system type... riscv64-unknown-elf
checking for riscv64-unknown-elf-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for riscv64-unknown-elf-g++... no
checking for riscv64-unknown-elf-c++... no
checking for riscv64-unknown-elf-gpp... no
checking for riscv64-unknown-elf-aCC... no
checking for riscv64-unknown-elf-CC... no
checking for riscv64-unknown-elf-cxx... no
checking for riscv64-unknown-elf-cc++... no
checking for riscv64-unknown-elf-cl.exe... no
checking for riscv64-unknown-elf-FCC... no
checking for riscv64-unknown-elf-KCC... no
checking for riscv64-unknown-elf-RCC... no
checking for riscv64-unknown-elf-xlC_r... no
checking for riscv64-unknown-elf-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for riscv64-unknown-elf-ar... riscv64-unknown-elf-ar
checking for riscv64-unknown-elf-ranlib... riscv64-unknown-elf-ranlib
checking for riscv64-unknown-elf-readelf... riscv64-unknown-elf-readelf
checking for riscv64-unknown-elf-objcopy... riscv64-unknown-elf-objcopy
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
configure: configuring default subproject : pk
configure: configuring default subproject : bbl
configure: configuring default subproject : softfloat
configure: configuring default subproject : dummy_payload
configure: configuring default subproject : machine
configure: configuring default subproject : util
configure: creating ./config.status
config.status: creating pk.mk
config.status: creating bbl.mk
config.status: creating softfloat.mk
config.status: creating dummy_payload.mk
config.status: creating machine.mk
config.status: creating util.mk
config.status: creating Makefile
config.status: creating config.h
alpha@alpha-VirtualBox:~/installation/rocket-chip/riscv-tools/riscv-pk/build$ make
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks  -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/file.c
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks  -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/syscall.c
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks  -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/handlers.c
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks  -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/frontend.c
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks  -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/elf.c
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
Makefile:302: recipe for target 'frontend.o' failed
make: *** [frontend.o] Error 1
make: *** Waiting for unfinished jobs....
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
Makefile:302: recipe for target 'syscall.o' failed
make: *** [syscall.o] Error 1
Makefile:302: recipe for target 'handlers.o' failed
make: *** [handlers.o] Error 1
Makefile:302: recipe for target 'elf.o' failed
make: *** [elf.o] Error 1
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
Makefile:302: recipe for target 'file.o' failed
make: *** [file.o] Error 1
and
Code:
alpha@alpha-VirtualBox:~/installation/rocket-chip/riscv-tools/riscv-pk/build$ CC=riscv64-unknown-elf-gcc ../configure --prefix=$path/riscv64-unknown-elf --host=riscv64-unknown-elf
alpha@alpha-VirtualBox:~/installation/rocket-chip/riscv-tools/riscv-pk/build$ CC=riscv64-unknown-elf-gcc ../configure --prefix=$path/riscv64-unknown-elf --host=riscv64-unknown-elf
checking build system type... x86_64-unknown-linux-gnu
checking host system type... riscv64-unknown-elf
checking for riscv64-unknown-elf-gcc... riscv64-unknown-elf-gcc
checking whether the C compiler works... no
configure: error: in `/home/alpha/installation/rocket-chip/riscv-tools/riscv-pk/build':
configure: error: C compiler cannot create executables

Last edited by riscv; 03-24-2017 at 10:08 AM.
 
Old 03-24-2017, 10:22 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #5.

"libiberty.a" :
The binutils development files are probably required to compile the internal gcc :
/usr/lib64/libiberty.a
But may be the file isn't supplied with the default binutils for your OS ?

Or may be it is intended that you use the {riscv binutils-newlib libiberty.a} ?
I have this ...
Code:
/home/knudfl/riscv-tools/riscv-gnu-toolchain/build/build-binutils-newlib/libiberty/libiberty.a
... Please check your "/home/alpha///riscv-tools/lib/" folder for presence of libiberty.a, etc.
... And then include "riscv-tools/lib/" in the LD_LIBRARY_PATH

-
 
Old 03-24-2017, 11:38 AM   #7
riscv
Member
 
Registered: Mar 2017
Posts: 34

Original Poster
Rep: Reputation: Disabled
Re,

I didn't find libiberty in /usr/lib

and /home/alpha/installation/rocket-chip/riscv-tools/lib/ doesn't have any lib folder:

Code:
build.common      build.sh             build-spike-pk.sh  regression.sh  riscv-fesvr          riscv-isa-sim  riscv-opcodes  riscv-tests
build-rv32ima.sh  build-spike-only.sh  README.md          riscv          riscv-gnu-toolchain  riscv-llvm     riscv-pk
On the other hand, i've followed your path and found it here: /home/alpha/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/build-binutils-newlib/libiberty/libiberty.a

So do i add that path to LD_LIBRARY_PATH (export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home//home/alpha/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/build-binutils-newlib/libiberty/lib) ? Or should i create a lib folder inside of the riscv-tools and add it?

Thank you !
 
Old 03-24-2017, 02:31 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #5, #6.

No libiberty.a was asked for in the two test runs I did today :
1) With PCLinuxOS 2017 - x86_64
2) With CentOS 7.3.1611 - x86_64
..... No errors at all.
Code:
[knudfl@localhost riscv-tools (master)]$ export RISCV=/home/knudfl/riscv-tools
[knudfl@localhost riscv-tools (master)]$ export PATH=$PATH:$RISCV/bin    
[knudfl@localhost riscv-tools (master)]$ ./build.sh 

.
.
.

Installing project riscv-tests

RISC-V Toolchain installation completed!
Ubuntu, Debian, Mint : libiberty.a is in the package libiberty-dev :
/usr/lib/x86_64-linux-gnu/libiberty.a
https://packages.debian.org/jessie/a...y-dev/filelist


-

Last edited by knudfl; 03-24-2017 at 02:38 PM.
 
Old 03-24-2017, 10:40 PM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
$ sudo apt-get install build-essential

That should grab the gcc, g++, make, and other compile type things. Toolchains are normally in addition to these things so the compiler can get passed the right flags and output to the right location(s). Toolchains are not a replacement for the compilers. In general anyway. When in doubt, compile on the platform you are compiling for, it simplifies things greatly. Although it tends to be slower if it's not the same architecture.
 
Old 03-25-2017, 07:12 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@riscv.

I made a third build of the riscv-tools : Ubuntu 14.04 - 64bits.
No errors, no "libiberty-dev" required : Ubuntu 14.04 has a native gcc-4.8 compiler.

A later Ubuntu version : The gcc-5 (g++-5) is known to fail with certain applications.

-

Last edited by knudfl; 03-25-2017 at 10:47 AM.
 
Old 03-25-2017, 10:51 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@riscv.

So I made another test (4), now with Ubuntu 16.04 - x86_64. ( gcc-5, g++-5 ). No errors.

? Did you ever tell which OS you are using ?
 
Old 03-26-2017, 03:47 PM   #12
riscv
Member
 
Registered: Mar 2017
Posts: 34

Original Poster
Rep: Reputation: Disabled
@Shadow 7. Thank you for your anwer and explanation. I did install buid-essential, the libiberty.a error is still there after building the toolchain.

@knudfl: i'm using a 16.02 ubuntu (virtual machine) and the gcc version i'm using now is 6.2.
I know in the manual it says >= 4.8 for 14.04. Could you please explain why it only works with those versions ? Will it not work with the versions i'm using ? Also, what difference does the compiler version make for riscv ?

Thank you.

Last edited by riscv; 03-26-2017 at 03:55 PM.
 
Old 03-26-2017, 04:56 PM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #12.
Quote:
the libiberty.a error is still there after building the toolchain.
Indicates a wrong gcc version.


Quote:
the manual it says >= 4.8 for 14.04
... Means 4.8 or later. But obviously not the Ubuntu 16.10 gcc-6 that you installed.
Riscv tools contains two year old files, not meant to be build with "the gcc of tomorrow".


Quote:
i'm using a 16.02 ubuntu
Do you mean 16.04 or 16.10 ? ?
This command will show : $ cat /etc/issue

-
 
Old 03-26-2017, 05:45 PM   #14
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
The libs that end in .a are for static linking. Perhaps there's an --enable-shared option that gets past it's absence, by using the .so. Or recompile the lib with --disable-shared or --enable-static, whatever applies to create the .a variant.
 
Old 03-26-2017, 05:45 PM   #15
riscv
Member
 
Registered: Mar 2017
Posts: 34

Original Poster
Rep: Reputation: Disabled
Sorry my bad (gcc 6.2) but the linux version is 16.04.



Quote:
Originally Posted by knudfl View Post

So I made another test (4), now with Ubuntu 16.04 - x86_64. ( gcc-5, g++-5 ). No errors.
So i removed gcc and g++ and now they're 5.3.1 (after running apt-get install gcc-5 g++-5).
Running ./build.sh yields the same error.

Last edited by riscv; 03-27-2017 at 04:01 AM.
 
  


Reply

Tags
riscv


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Installation (Linux) RISCV GNU Toolchain error: C compiler cannot create executables, recipe for target 'configure-target-libgomp' failed riscv Linux - Newbie 2 03-23-2017 08:36 AM
make: CC: Command not found make: *** [main.o] Error 127 on opensuse 11.3 Leo89 Linux - Newbie 6 11-30-2012 05:13 PM
NS-2.29 Make error (make: g++34: Command not found) avi2936 Linux - Newbie 8 09-17-2012 03:32 PM
Unable to compile C++ programs.make:g++ command not found error.Error 127 PrathuD Programming 3 03-16-2009 12:44 PM
make: cc: command not found make: *** [gzip.o]error 127 zyjk Linux - Newbie 5 02-08-2002 09:58 AM

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

All times are GMT -5. The time now is 10:35 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