summaryrefslogtreecommitdiff
path: root/rakelib
diff options
context:
space:
mode:
Diffstat (limited to 'rakelib')
-rw-r--r--rakelib/cross.rake28
1 files changed, 17 insertions, 11 deletions
diff --git a/rakelib/cross.rake b/rakelib/cross.rake
index 03a69cb..e213bb0 100644
--- a/rakelib/cross.rake
+++ b/rakelib/cross.rake
@@ -35,6 +35,20 @@ class BuildTarget
def tools
tmp + 'tools'
end
+
+ def configuration
+ case target
+ when /^riscv[[:digit:]]+-/
+ [
+ '--with-arch=rv32imafdc',
+ '--with-abi=ilp32d',
+ '--with-tune=rocket',
+ '--with-isa-spec=20191213'
+ ]
+ else
+ []
+ end
+ end
end
def gcc_verbose(gcc_binary)
@@ -155,15 +169,11 @@ namespace :cross do
options.sysroot.mkpath
sh 'contrib/download_prerequisites', chdir: source_directory.to_path
- configure_options = [
+ configure_options = options.configuration + [
"--prefix=#{options.rootfs.realpath}",
"--with-sysroot=#{options.sysroot.realpath}",
'--enable-languages=c,c++',
'--disable-shared',
- '--with-arch=rv32imafdc',
- '--with-abi=ilp32d',
- '--with-tune=rocket',
- '--with-isa-spec=20191213',
'--disable-bootstrap',
'--disable-multilib',
'--disable-libmudflap',
@@ -275,16 +285,12 @@ namespace :cross do
rm_rf cwd
cwd.mkpath
- configure_options = [
+ configure_options = options.configuration + [
"--prefix=#{options.rootfs.realpath}",
"--with-sysroot=#{options.sysroot.realpath}",
'--enable-languages=c,c++,lto',
'--enable-lto',
'--enable-shared',
- '--with-arch=rv32imafdc',
- '--with-abi=ilp32d',
- '--with-tune=rocket',
- '--with-isa-spec=20191213',
'--disable-bootstrap',
'--disable-multilib',
'--enable-checking=release',
@@ -323,7 +329,7 @@ namespace :cross do
end
desc 'Build cross toolchain'
-task cross: [
+task :cross, [:target] => [
'cross:binutils',
'cross:gcc1',
'cross:headers',