Pass target to the cross task
This commit is contained in:
parent
a1c9910300
commit
65ead3714d
@ -35,6 +35,20 @@ class BuildTarget
|
|||||||
def tools
|
def tools
|
||||||
tmp + 'tools'
|
tmp + 'tools'
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def gcc_verbose(gcc_binary)
|
def gcc_verbose(gcc_binary)
|
||||||
@ -155,15 +169,11 @@ namespace :cross do
|
|||||||
options.sysroot.mkpath
|
options.sysroot.mkpath
|
||||||
|
|
||||||
sh 'contrib/download_prerequisites', chdir: source_directory.to_path
|
sh 'contrib/download_prerequisites', chdir: source_directory.to_path
|
||||||
configure_options = [
|
configure_options = options.configuration + [
|
||||||
"--prefix=#{options.rootfs.realpath}",
|
"--prefix=#{options.rootfs.realpath}",
|
||||||
"--with-sysroot=#{options.sysroot.realpath}",
|
"--with-sysroot=#{options.sysroot.realpath}",
|
||||||
'--enable-languages=c,c++',
|
'--enable-languages=c,c++',
|
||||||
'--disable-shared',
|
'--disable-shared',
|
||||||
'--with-arch=rv32imafdc',
|
|
||||||
'--with-abi=ilp32d',
|
|
||||||
'--with-tune=rocket',
|
|
||||||
'--with-isa-spec=20191213',
|
|
||||||
'--disable-bootstrap',
|
'--disable-bootstrap',
|
||||||
'--disable-multilib',
|
'--disable-multilib',
|
||||||
'--disable-libmudflap',
|
'--disable-libmudflap',
|
||||||
@ -275,16 +285,12 @@ namespace :cross do
|
|||||||
rm_rf cwd
|
rm_rf cwd
|
||||||
cwd.mkpath
|
cwd.mkpath
|
||||||
|
|
||||||
configure_options = [
|
configure_options = options.configuration + [
|
||||||
"--prefix=#{options.rootfs.realpath}",
|
"--prefix=#{options.rootfs.realpath}",
|
||||||
"--with-sysroot=#{options.sysroot.realpath}",
|
"--with-sysroot=#{options.sysroot.realpath}",
|
||||||
'--enable-languages=c,c++,lto',
|
'--enable-languages=c,c++,lto',
|
||||||
'--enable-lto',
|
'--enable-lto',
|
||||||
'--enable-shared',
|
'--enable-shared',
|
||||||
'--with-arch=rv32imafdc',
|
|
||||||
'--with-abi=ilp32d',
|
|
||||||
'--with-tune=rocket',
|
|
||||||
'--with-isa-spec=20191213',
|
|
||||||
'--disable-bootstrap',
|
'--disable-bootstrap',
|
||||||
'--disable-multilib',
|
'--disable-multilib',
|
||||||
'--enable-checking=release',
|
'--enable-checking=release',
|
||||||
@ -323,7 +329,7 @@ namespace :cross do
|
|||||||
end
|
end
|
||||||
|
|
||||||
desc 'Build cross toolchain'
|
desc 'Build cross toolchain'
|
||||||
task cross: [
|
task :cross, [:target] => [
|
||||||
'cross:binutils',
|
'cross:binutils',
|
||||||
'cross:gcc1',
|
'cross:gcc1',
|
||||||
'cross:headers',
|
'cross:headers',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user