Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Following README fails with "unrecognized argument in option ‘-mcmodel=medany’" #26

Open
jeehoonkang opened this issue Apr 14, 2019 · 7 comments

Comments

@jeehoonkang
Copy link

jeehoonkang commented Apr 14, 2019

I'm following the README as follows:

git clone https://github.com/riscv-boom/boom-template.git
cd boom-template
./scripts/init-submodules.sh

export RISCV=~/.local
export PATH=$RISCV/bin:$PATH
./scripts/build-tools.sh

But the last line says:

[...]
Configuring project riscv-pk
Building project riscv-pk
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small; did you mean ‘medium’?
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small; did you mean ‘medium’?
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small; did you mean ‘medium’?
make: *** [Makefile:319: file.o] Error 1
make: *** Waiting for unfinished jobs....
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
make: *** [Makefile:319: syscall.o] Error 1
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small; did you mean ‘medium’?
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
make: *** [Makefile:319: handlers.o] Error 1
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small; did you mean ‘medium’?
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small; did you mean ‘medium’?
make: *** [Makefile:319: frontend.o] Error 1
make: *** [Makefile:319: elf.o] Error 1
make: *** [Makefile:319: console.o] Error 1

I found some related issues, but I'm reporting here because it'd be better for this repo's README to be updated as well.

Here is some meta information:

$ uname -a
Linux jeehoonkang-home 5.0.5-1-MANJARO #1 SMP PREEMPT Wed Mar 27 19:15:04 UTC 2019 x86_64 GNU/Linux

$ gcc --version
gcc (GCC) 8.2.1 20181127
Copyright (C) 2018 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.

$ git rev-parse HEAD
aeadc8a7f9eea9e20011b33e9ea66506fd54fca1
@jerryz123
Copy link

jerryz123 commented Apr 14, 2019

@abejgonzalez can you confirm that your recent changes to build-tools.sh work? Looks like the RISCV toolchain is not appearing in the PATH.

@jeehoonkang I would verify that $RISCV/bin contains the riscv-gcc binaries.

@jeehoonkang
Copy link
Author

@jerryz123 My $RISCV/bin contains elf2hex openocd spike spike-dasm termios-xspike xspike.

I digged further this issue, and it seems related to Archlinux (or Manjaro Linux). On Ubuntu (via docker on Manjaro Linux), this problem does not occur at all.

@abejgonzalez
Copy link

I can confirm that it works on Ubuntu.

@jeehoonkang
Copy link
Author

jeehoonkang commented Apr 19, 2019

Strangely, on my Ubuntu 18.04 (via VirtualBox on Manjaro Linux), it doesn't work...

Configuring project riscv-isa-sim
Building project riscv-isa-sim
../spike_main/disasm.cc: In constructor ‘disassembler_t::disassembler_t(int)’:
../spike_main/disasm.cc:275:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
 disassembler_t::disassembler_t(int xlen)
 ^~~~~~~~~~~~~~
Installing project riscv-isa-sim

Removing existing riscv-pk/build directory
Configuring project riscv-pk
Building project riscv-pk
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small; did you mean ‘medium’?
make: *** [file.o] Error 1

My $RISCV/bin contains elf2hex openocd spike spike-dasm termios-xspike xspike.

Some meta information:

$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.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.

$ uname -a
Linux jeehoonkang-VirtualBox 4.18.0-17-generic #18~18.04.1-Ubuntu SMP Fri Mar 15 15:27:12 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ git rev-parse HEAD
4c0a00bc042f0dae27ee8cefffd5d44973a98a89

@pentin-as
Copy link

This is my .../riscv-tools/build.sh file:

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

Why in your log after "Installation project risc v-isa-sim" is displayed "Removing existing riscv-pk/build directory"?
Where is the compilation of riscv-gnu-toolchain?

Please show your file .../riscv-tools/build.sh.

@christian-krieg
Copy link

I can reproduce this behavior on my Debian 9 system.

Is there any activity to resolve this issue?

@jerryz123
Copy link

Please paste contents of your build.sh. @pentin-as is correct, it seems odd there is no build gnu-toolchain step.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants