-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
riscv-toolsのビルドが失敗する #6
Comments
ご指摘ありがとうございます。出版前の確認が不足しており申し訳ありません。 |
closeされている issueですが、補足させていただきます。 (書き始めたら長くなってしまいました。新しい issue をopenしたほうがよければ、連絡ください。) Summary:
この通りの様ですが、Ubuntu 20.04.5 LTS では、README.md に従ってinstallすることで、(最新版のriscv-testsでも解決していない) 下記の一点を除いてbuildできました。 $ git clone https://github.com/riscv/riscv-gnu-toolchain
$ cd riscv-gnu-toolchain
$ ./configure --prefix=/opt/riscv
$ make
$ git clone https://github.com/riscv-software-src/riscv-tools.git
$ cd riscv-tools
$ git submodule update --init --recursive
$ export RISCV=/opt/riscv
$ ./build.sh P.71では 一点問題があったのは riscv-software-src/riscv-tests#286 で報告されている件です。 diff --git a/isa/Makefile b/isa/Makefile
index 4e1ba20..ee89ede 100644
--- a/isa/Makefile
+++ b/isa/Makefile
@@ -33,7 +33,7 @@ default: all
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf-
RISCV_GCC ?= $(RISCV_PREFIX)gcc
-RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles
+RISCV_GCC_OPTS ?= -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -fcommon
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.text.init --section=.data
RISCV_SIM ?= spike
Andrew Watermanが
と答えています。 "This is now fixed on master." とありますが、最新版の Makefile にも もう一点、私が躓いたのは P.318 のPICの例の実行で P.70の手順では、
私はconfigure に P.70 and/or P.318に一言補足があると良いと思います。 以上。 |
補足ありがとうございます。P.318のほうは確認が不足しており申し訳ありません。 |
@msyksphinz-self
これは誤りだったので訂正します。 -common, -no-commonの意味を確認しました。 https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html 同じ名前でstatic, externなどが指定されず、かつ初期値が指定されていない変数が複数のfileで定義されていなかった場合、言語仕様ではerrorとなるべきなのに、gccでは昔から defaultではerrorとしていなかった。 -fno-commonを指定するとerrorとなるという仕様となっていた。 2重定義になっているところを修正したと考えるのが、正しそうです。 |
タイトルの通り、riscv-toolsのビルドが失敗します。
riscv-toolsのGitHubリポジトリのissueにもビルドの失敗報告がいくつかあり、またそうしたissueに対してコメントされている通り、このリポジトリはすでにメンテナンスされてなさそうです。
再現環境はWSLでないLinux上なので、もしかしたらWSLではビルドできるのかも。
Spike, riscv-pkを個別にビルドしたら動いたので、もし同様にriscv-toolsがビルドできない人がいましたら同じようにすれば問題を回避できるかと思います。
一応ログを以下に。
The text was updated successfully, but these errors were encountered: