Mismatch in file structure of riscv-gnu-compiler-toolchain

I built riscv-tool chain successfully on ubuntu 18.04 with -mcmodel=medany flag.
i am working with sifive_s21 core. i used the following command to generate hex files for design-rtl.
make PROGRAM=hello TARGET=design-rtl CONFIGURATION=debug software
the make file expecting “riscv-unknown-elf”. in the toolchain which I built is named as "riscv-unknown-linux-gnu-elf. so I changed the folder name in which I built.
Later it asked me “risc-unknown-elf-gcc” in the toolchain which I built is named as "riscv-unknown-linux-gnu-gcc. so I changed the name in which I built.
now I am facing more weird errors.
Please help here am I missing anything ? is there any other do get the exact file structure?

Looks like the same problem reported and answered at the end of here

Anyways, you didn’t specify exactly what you did, but I’m guessing that what you did wrong is that you typed “make linux” when building riscv-gnu-toolchain which is wrong. You should have typed “make”. The linux in the make command is for the target, not the host. You can’t substitute a riscv64-linux target compiler for a riscv64-elf target compiler. They are different compiler targets.

yes, that is exactly what I did. I will go with just make. Thank you very much.

Hi Jim, i faced the following error with the new toolchain. i compiled it with -mcmodel=medany flag. please help me out here

prasanth@prasanth-VirtualBox:~/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk$ make PROGRAM=hello TARGET=design-arty CONFIGURATION=debug software
mkdir -p /home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/software/hello/debug/
make -C /home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/software/hello hello
ASFLAGS="-march=rv64imafc_zba_zbb -mabi=lp64f -mcmodel=medany --specs=nano.specs -O0 -g"
CCASFLAGS="-march=rv64imafc_zba_zbb -mabi=lp64f -mcmodel=medany -I/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/bsp/design-arty/install/include --specs=nano.specs"
CFLAGS="-march=rv64imafc_zba_zbb -mabi=lp64f -mcmodel=medany -ffunction-sections -fdata-sections -I/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/bsp/design-arty/install/include --specs=nano.specs -DMTIME_RATE_HZ_DEF=32768 -O0 -g"
CXXFLAGS="-march=rv64imafc_zba_zbb -mabi=lp64f -mcmodel=medany -ffunction-sections -fdata-sections -I/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/bsp/design-arty/install/include --specs=nano.specs -DMTIME_RATE_HZ_DEF=32768 -O0 -g"
LDFLAGS="-Wl,–gc-sections -Wl,-Map,hello.map -nostartfiles -nostdlib -L/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/bsp/design-arty/install/lib/debug/ -T/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/bsp/design-arty/metal.default.lds"
LDLIBS="-Wl,–start-group -lc -lgcc -lm -lmetal -lmetal-gloss -Wl,–end-group"
make[1]: Entering directory ‘/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/software/hello’
/opt/riscv/bin/riscv64-unknown-elf-gcc -march=rv64imafc_zba_zbb -mabi=lp64f -mcmodel=medany -ffunction-sections -fdata-sections -I/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/bsp/design-arty/install/include --specs=nano.specs -DMTIME_RATE_HZ_DEF=32768 -O0 -g -Wl,–gc-sections -Wl,-Map,hello.map -nostartfiles -nostdlib -L/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/bsp/design-arty/install/lib/debug/ -T/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/bsp/design-arty/metal.default.lds hello.c -Wl,–start-group -lc -lgcc -lm -lmetal -lmetal-gloss -Wl,–end-group -o hello
Assembler messages:
Error: -march=rv64imafc_zba_zbb: unknown z ISA extension zba' /tmp/cc8mOVeU.s:3: Error: -march=rv64i2p0_m2p0_a2p0_f2p0_c2p0_zba_zbb: unknown z ISA extension zba’
: recipe for target ‘hello’ failed
make[1]: *** [hello] Error 1
make[1]: Leaving directory ‘/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/software/hello’
scripts/standalone.mk:278: recipe for target ‘/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/software/hello/debug/hello.elf’ failed
make: *** [/home/prasanth/Desktop/temp/SiFive_S2_n6/sifive_rt2_s21/freedom-e-sdk/software/hello/debug/hello.elf] Error 2

The public RiSC-V International riscv/riscv-gnu-toolchain has no support for B, V, Zfh, or any other draft extension. It also may not support SiFive specific extensions like our cache control instructions yet. If you want support for these, then you need to use a SiFive toolchain release. We have binaries on our web site for some popular operating systems.
The sources used to be in sifive/freedom-tools but I haven’t checked that recently. If this public toolchain doesn’t have the support you need, I’m not sure when it was last updated or what exact features it has, then you may need to talk to an FAE and get access to one of toolchain releases we give to corporate customers that license cores from us. You should maybe also be using the customer interface for asking questions instead of using the public forums.