Pass target to the cross task
This commit is contained in:
		| @@ -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', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user