Trouble compiling for my hifive1

hello

i think i have installed the freedom-e-sdk, but i’m unable to compile a test project.

configure: error: C compiler cannot create executables

the full log is this one:

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

  $ /home/.../code/riscv/freedom-e-sdk/freedom-metal/configure --host=riscv64-unknown-elf --prefix=/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/install --libdir=/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/install/lib/debug --with-builtin-libgloss --with-machine-header=/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/metal.h --with-machine-inline=/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/metal-inline.h --with-platform-header=/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/metal-platform.h

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

hostname = silver
uname -m = x86_64
uname -r = 5.8.0-1-amd64
uname -s = Linux
uname -v = #1 SMP Debian 5.8.7-1 (2020-09-05)

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

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

PATH: /opt/riscv/bin
PATH: /home/user/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/games
PATH: /usr/games


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

configure:1904: checking for a BSD-compatible install
configure:1972: result: /usr/bin/install -c
configure:1983: checking whether build environment is sane
configure:2038: result: yes
configure:2095: checking for riscv64-unknown-elf-strip
configure:2111: found /opt/riscv/bin/riscv64-unknown-elf-strip
configure:2122: result: riscv64-unknown-elf-strip
configure:2187: checking for a thread-safe mkdir -p
configure:2226: result: /usr/bin/mkdir -p
configure:2233: checking for gawk
configure:2249: found /usr/bin/gawk
configure:2260: result: gawk
configure:2271: checking whether make sets $(MAKE)
configure:2293: result: yes
configure:2322: checking whether make supports nested variables
configure:2339: result: yes
configure:2466: checking whether to enable maintainer-specific portions of Makefiles
configure:2475: result: no
configure:2494: checking build system type
configure:2508: result: x86_64-pc-linux-gnu
configure:2528: checking host system type
configure:2541: result: riscv64-unknown-elf
configure:2571: checking for riscv64-unknown-elf-gcc
configure:2587: found /opt/riscv/bin/riscv64-unknown-elf-gcc
configure:2598: result: riscv64-unknown-elf-gcc
configure:2867: checking for C compiler version
configure:2876: riscv64-unknown-elf-gcc --version >&5
riscv64-unknown-elf-gcc (GCC) 10.1.0
Copyright (C) 2020 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:2887: $? = 0
configure:2876: riscv64-unknown-elf-gcc -v >&5
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/opt/riscv/libexec/gcc/riscv64-unknown-elf/10.1.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/.../code/riscv/riscv-gnu-toolchain/riscv-gcc/configure --target=riscv64-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/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 --disable-multilib --with-abi=lp64d --with-arch=rv64imafdc --with-tune=rocket 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.1.0 (GCC) 
configure:2887: $? = 0
configure:2876: 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:2887: $? = 1
configure:2876: 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:2887: $? = 1
configure:2907: checking whether the C compiler works
configure:2929: riscv64-unknown-elf-gcc -march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections -I/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/install/include --specs=nano.specs -DMTIME_RATE_HZ_DEF=32768 -O0 -g   conftest.c  >&5
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.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'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/crt0.o
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/crtbegin.o: ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/crtbegin.o
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-exit.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-exit.o)
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-impure.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-impure.o)
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-init.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-init.o)
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-memset.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-memset.o)
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libgloss_nano.a(sys_exit.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libgloss_nano.a(sys_exit.o)
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libc_nano.a(lib_a-errno.o): ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libc_nano.a(lib_a-errno.o)
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/crtend.o: ABI is incompatible with that of the selected emulation:
  target emulation `elf64-littleriscv' does not match `elf32-littleriscv'
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: failed to merge target specific data of file /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/crtend.o
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: a.out(.text.exit): relocation "_exit+0x0 (type R_RISCV_CALL)" goes out of range
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: /opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/lib/libg_nano.a(lib_a-exit.o): file class ELFCLASS64 incompatible with ELFCLASS32
/opt/riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: final link failed: file in wrong format
collect2: error: ld returned 1 exit status
configure:2933: $? = 1
configure:2971: 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 "https://github.com/sifive/freedom-metal/issues"
| #define PACKAGE_URL "https://github.com/sifive/freedom-metal"
| #define PACKAGE "freedom-metal"
| #define VERSION "v0.1.2"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2976: error: in `/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/build/debug':
configure:2978: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_build=x86_64-pc-linux-gnu
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/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/install/include --specs=nano.specs -DMTIME_RATE_HZ_DEF=32768 -O0 -g'
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=set
ac_cv_env_host_alias_value=riscv64-unknown-elf
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=riscv64-unknown-elf
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/usr/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} /home/.../code/riscv/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} /home/.../code/riscv/freedom-e-sdk/freedom-metal/missing autoconf'
AUTOHEADER='${SHELL} /home/.../code/riscv/freedom-e-sdk/freedom-metal/missing autoheader'
AUTOMAKE='${SHELL} /home/.../code/riscv/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/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/install/include --specs=nano.specs -DMTIME_RATE_HZ_DEF=32768 -O0 -g'
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
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=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MACHINE_HEADER=''
MACHINE_INLINE=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /home/.../code/riscv/freedom-e-sdk/freedom-metal/missing makeinfo'
MKDIR_P='/usr/bin/mkdir -p'
OBJEXT=''
PACKAGE='freedom-metal'
PACKAGE_BUGREPORT='https://github.com/sifive/freedom-metal/issues'
PACKAGE_NAME='freedom-metal'
PACKAGE_STRING='freedom-metal v0.1.2'
PACKAGE_TARNAME='freedom-metal'
PACKAGE_URL='https://github.com/sifive/freedom-metal'
PACKAGE_VERSION='v0.1.2'
PATH_SEPARATOR=':'
PLATFORM_HEADER=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP='riscv64-unknown-elf-strip'
VERSION='v0.1.2'
WITH_BUILTIN_LIBGLOSS_FALSE=''
WITH_BUILTIN_LIBGLOSS_TRUE=''
WITH_BUILTIN_LIBMETAL_PICO_FALSE=''
WITH_BUILTIN_LIBMETAL_PICO_TRUE=''
WITH_BUILTIN_LIBMETAL_SEGGER_FALSE=''
WITH_BUILTIN_LIBMETAL_SEGGER_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='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='riscv64-unknown-elf'
host_alias='riscv64-unknown-elf'
host_cpu='riscv64'
host_os='elf'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/.../code/riscv/freedom-e-sdk/freedom-metal/install-sh'
libdir='/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/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='/home/.../code/riscv/freedom-e-sdk/bsp/sifive-hifive1/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 "https://github.com/sifive/freedom-metal/issues"
#define PACKAGE_URL "https://github.com/sifive/freedom-metal"
#define PACKAGE "freedom-metal"
#define VERSION "v0.1.2"

configure: exit 77

first i thought i was having troubles with the RISCV GNU Toolchain, so i compiled it by hand (which took quite a while) but even after compiling i get the same error. any ideas?

arduino-ide seems to be able to compile some dummy-code for hifive1, but it doesn’t know the whereabouts of the “metal” libraries and such…

Not sure what do you want to do. I assume you try to build a freedom-e-sdk project so that you can run it on hifive1 board.

If this is what you want to do, you don’t need to build the toolchain. To make it easier, you can use the prebuild toolchain from this URL.

Simply untar the toolchain and add bin to your path. Once you done it, the next setup is build the freedom-e-sdk project. For example

make -C your_freedom_e_sdk_root TARGET=sifive-hifive1 CONFIGURATION=debug PROGRAM=hello

all available target can be found in your_freedom_e_sdk_root/bsp directory. From the build console, you can see how the script build and install the metal library.

1 Like

Here is script if you like to build manually without make

#!/bin/sh -v

#’ this script assume baremetal compiler already added to the path
#’ mybuild_root is the build directory of metal library
#’ myinstall_root is the install directory of the metal library
#’ myprog_root is the directory to metal project
#’ myfreedomsdk_root is the freedom-e-sdk root directory

mybuild_root=
myinstall_root=
myprog_root=
myfreedomsdk_root=

#’ use sifive-hifive1 as target and hello program in the sdk

cd $mybuild_root
CFLAGS="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections -I$myinstall_root/include --specs=nano.specs -O0 -g"
$myfreedomsdk_root/freedom-metal/configure
–host=riscv64-unknown-elf
–prefix=$myinstall_root
–libdir=$myinstall_root/lib/debug
–disable-maintainer-mode
–with-preconfigured
–with-machine-name=sifive-hifive1
–with-machine-header=$myfreedomsdk_root/bsp/sifive-hifive1/metal.h
–with-machine-inline=$myfreedomsdk_root/bsp/sifive-hifive1/metal-inline.h
–with-platform-header=$myfreedomsdk_root/bsp/sifive-hifive1/metal-platform.h
–with-machine-ldscript=$myfreedomsdk_root/bsp/sifive-hifive1/metal.default.lds
–with-builtin-libgloss

touch -c $mybuild_root/Makefile
make -C /home/vlinux/project/junk/testbuild/build install
cd …

cp $myinstall_root/lib/debug/libriscv__mmachine__sifive-hifive1.a $myinstall_root/lib/debug/libmetal.a
cp $myinstall_root/lib/debug/libriscv__menv__metal.a $myinstall_root/lib/debug/libmetal-gloss.a

make -C $myprog_root hello
PORT_DIR=
AR=riscv64-unknown-elf-ar
CC=riscv64-unknown-elf-gcc
CXX=riscv64-unknown-elf-g++
ASFLAGS="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -O0 -g"
CCASFLAGS="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -I$myinstall_root/include --specs=nano.specs"
CFLAGS="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections -I$myinstall_root/include --specs=nano.specs -O0 -g"
CXXFLAGS="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -ffunction-sections -fdata-sections -I$myinstall_root/include --specs=nano.specs -O0 -g"
XCFLAGS=""
LDFLAGS="-Wl,–gc-sections -Wl,-Map,hello.map -nostartfiles -nostdlib -L$myinstall_root/lib/debug/ -T$myfreedomsdk_root/bsp/sifive-hifive1/metal.default.lds"
LDLIBS="-Wl,–start-group -lc -lgcc -lm -lmetal -lmetal-gloss -Wl,–end-group "

thank you so much for your answer!
unfortunately it was not of too much help – i guess the ideas of how stuff is supposed to work and some part of the documentation might have diverged in the past years.

so first: good news. i was able to compile, flash and run (aka work) with my hifive1 board using FreedomStudio.

the description you provided above (downloading the toolchain .tar from the website) brought some more (minor) issues to the surface.

which “bin” directory should i add to my path? in the FreedomStudio-2020-06-3-lin64.tar.gz file there’s 10!

./SiFive/riscv64-unknown-elf-gcc-8.3.0-2020.04.1/python/bin
./SiFive/riscv64-unknown-elf-gcc-8.3.0-2020.04.1/bin
./SiFive/riscv64-unknown-elf-gcc-8.3.0-2020.04.1/riscv64-unknown-elf/bin
./SiFive/trace-decoder-0.9.0-2020.04.1/bin
./SiFive/sdk-utilities-0.1.0-2020.04.0/bin
./SiFive/xc3sprog-0.1.2-2020.04.0/bin
./SiFive/riscv-qemu-4.2.0-2020.04.0/bin
./SiFive/riscv-openocd-0.10.0-2020.04.6/bin
./plugins/org.apache.ant_1.10.5.v20190526-1402/bin
./jre/bin

which of these am i supposed to add to my PATH?

i guessed you meant the “freedom-e-sdk-v*” directory (altough there is no “bin” subdir in there). running the `make’ command provided by you above it (successfully) sets up a venv, runs some checks and fails at the same stage as i described in my original post:

checking whether the C compiler works... no
configure: error: in `/home/user/tmp/SiFive/freedom-e-sdk-v20.05.00.02/bsp/sifive-hifive1/build/debug':
configure: error: C compiler cannot create executables

any more ideas on how to get it working?

add ./SiFive/riscv64-unknown-elf-gcc-8.3.0-2020.04.1/bin to your path should do.

If you still having problem, you can look at the build log from Freedom Studio, it will show you the exact steps.

thanks! compilation now works fine!

but `make […] upload’ tells me: “No rule to make target: ‘upload’”…? do i need to add more paths or did i miss to configure something?

really appreciate your help!

Not sure what can be the issue, are you sure you are in the freedom-e-sdk root directory when issue make upload command?

ahh, yes. i figured it out now. thanks for your inputs!

so i guess a “normal” workflow for working with freedom-e-sdk from the command-line is creating a new project withing freedom-e-sdk’s “software” directory, and calling the make commands with PROGRAM=name-of-new-project?
so all the relevant make commands would be called from the freedom-e-sdk root directory.

i was under the impression that calling make [...] standalone would copy all the relevant directories and files to a new destination from where the whole compilation/uploading/debugging would be done.