1*4882a593Smuzhiyun# All host rust packages should depend on this option 2*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS 3*4882a593Smuzhiyun bool 4*4882a593Smuzhiyun default y if BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun# The pre-built Rust standard library is only available for a number 7*4882a593Smuzhiyun# of architectures/C libraries combinations, with different levels of 8*4882a593Smuzhiyun# support: Tier 1 platforms, Tier 2 platforms with host tools, Tier 2 9*4882a593Smuzhiyun# platforms, Tier 3 platforms. Below, we support Tier 1, Tier 2 with 10*4882a593Smuzhiyun# host tools and Tier 2 platforms. 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun# The below entries match Tier 1 platforms as described at 13*4882a593Smuzhiyun# https://doc.rust-lang.org/nightly/rustc/platform-support.html. 14*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS 15*4882a593Smuzhiyun bool 16*4882a593Smuzhiyun # aarch64-unknown-linux-gnu 17*4882a593Smuzhiyun default y if BR2_aarch64 && BR2_TOOLCHAIN_USES_GLIBC 18*4882a593Smuzhiyun # i686-unknown-linux-gnu 19*4882a593Smuzhiyun default y if (BR2_i686 || BR2_x86_pentiumpro || BR2_X86_CPU_HAS_MMX) && BR2_TOOLCHAIN_USES_GLIBC 20*4882a593Smuzhiyun # x86_64-unknown-linux-gnu 21*4882a593Smuzhiyun default y if BR2_x86_64 && BR2_TOOLCHAIN_USES_GLIBC 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun# The below entries match Tier 2 platforms with host tools as 24*4882a593Smuzhiyun# described at 25*4882a593Smuzhiyun# https://doc.rust-lang.org/nightly/rustc/platform-support.html. 26*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_HOST_TOOLS_PLATFORMS 27*4882a593Smuzhiyun bool 28*4882a593Smuzhiyun # aarch64-unknown-linux-musl 29*4882a593Smuzhiyun default y if BR2_aarch64 && BR2_TOOLCHAIN_USES_MUSL 30*4882a593Smuzhiyun # arm-unknown-linux-gnueabi 31*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV6 && BR2_ARM_EABI && BR2_TOOLCHAIN_USES_GLIBC 32*4882a593Smuzhiyun # arm-unknown-linux-gnueabihf 33*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV6 && BR2_ARM_EABIHF && BR2_TOOLCHAIN_USES_GLIBC 34*4882a593Smuzhiyun # armv7-unknown-linux-gnueabihf 35*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV7A && BR2_ARM_EABIHF && BR2_TOOLCHAIN_USES_GLIBC 36*4882a593Smuzhiyun # mips-unknown-linux-gnu 37*4882a593Smuzhiyun default y if BR2_mips && BR2_TOOLCHAIN_USES_GLIBC && !BR2_MIPS_CPU_MIPS32R6 38*4882a593Smuzhiyun # mips64-unknown-linux-gnuabi64 39*4882a593Smuzhiyun default y if BR2_mips64 && BR2_TOOLCHAIN_USES_GLIBC && BR2_MIPS_NABI64 && !BR2_MIPS_CPU_MIPS64R6 40*4882a593Smuzhiyun # mipsel-unknown-linux-gnu 41*4882a593Smuzhiyun default y if BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC && !BR2_MIPS_CPU_MIPS32R6 42*4882a593Smuzhiyun # mips64el-unknown-linux-gnuabi64 43*4882a593Smuzhiyun default y if BR2_mips64el && BR2_TOOLCHAIN_USES_GLIBC && BR2_MIPS_NABI64 && !BR2_MIPS_CPU_MIPS64R6 44*4882a593Smuzhiyun # powerpc-unknown-linux-gnu 45*4882a593Smuzhiyun default y if BR2_powerpc && BR2_TOOLCHAIN_USES_GLIBC 46*4882a593Smuzhiyun # powerpc64-unknown-linux-gnu 47*4882a593Smuzhiyun default y if BR2_powerpc64 && BR2_TOOLCHAIN_USES_GLIBC 48*4882a593Smuzhiyun # powerpc64le-unknown-linux-gnu 49*4882a593Smuzhiyun default y if BR2_powerpc64le && BR2_TOOLCHAIN_USES_GLIBC 50*4882a593Smuzhiyun # riscv64gc-unknown-linux-gnu 51*4882a593Smuzhiyun # "g" stands for imafd, and we also need "c". 52*4882a593Smuzhiyun default y if BR2_riscv && BR2_RISCV_ISA_RVI && BR2_RISCV_ISA_RVM && \ 53*4882a593Smuzhiyun BR2_RISCV_ISA_RVA && BR2_RISCV_ISA_RVF && \ 54*4882a593Smuzhiyun BR2_RISCV_ISA_RVD && BR2_RISCV_ISA_RVC && \ 55*4882a593Smuzhiyun BR2_TOOLCHAIN_USES_GLIBC 56*4882a593Smuzhiyun # x86_64-unknown-linux-musl 57*4882a593Smuzhiyun default y if BR2_x86_64 && BR2_TOOLCHAIN_USES_MUSL 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun# The below entries match Tier 2 platforms without host tools as 60*4882a593Smuzhiyun# described at 61*4882a593Smuzhiyun# https://doc.rust-lang.org/nightly/rustc/platform-support.html. 62*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS 63*4882a593Smuzhiyun bool 64*4882a593Smuzhiyun # arm-unknown-linux-musleabi 65*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV6 && BR2_ARM_EABI && BR2_TOOLCHAIN_USES_MUSL 66*4882a593Smuzhiyun # arm-unknown-linux-musleabihf 67*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV6 && BR2_ARM_EABIHF && BR2_TOOLCHAIN_USES_MUSL 68*4882a593Smuzhiyun # armv5te-unknown-linux-gnueabi 69*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV5 && BR2_ARM_EABI && BR2_TOOLCHAIN_USES_GLIBC 70*4882a593Smuzhiyun # armv5te-unknown-linux-musleabi 71*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV5 && BR2_ARM_EABI && BR2_TOOLCHAIN_USES_MUSL 72*4882a593Smuzhiyun # armv7-unknown-linux-gnueabi 73*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV7A && BR2_ARM_EABI && BR2_TOOLCHAIN_USES_GLIBC 74*4882a593Smuzhiyun # armv7-unknown-linux-musleabi 75*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV7A && BR2_ARM_EABI && BR2_TOOLCHAIN_USES_MUSL 76*4882a593Smuzhiyun # armv7-unknown-linux-musleabihf 77*4882a593Smuzhiyun default y if BR2_ARM_CPU_ARMV7A && BR2_ARM_EABIHF && BR2_TOOLCHAIN_USES_MUSL 78*4882a593Smuzhiyun # i586-unknown-linux-gnu 79*4882a593Smuzhiyun default y if BR2_i586 && BR2_TOOLCHAIN_USES_GLIBC 80*4882a593Smuzhiyun # i586-unknown-linux-musl 81*4882a593Smuzhiyun default y if BR2_i586 && BR2_TOOLCHAIN_USES_MUSL 82*4882a593Smuzhiyun # i686-unknown-linux-musl 83*4882a593Smuzhiyun default y if (BR2_i686 || BR2_x86_pentiumpro || BR2_X86_CPU_HAS_MMX) && BR2_TOOLCHAIN_USES_MUSL 84*4882a593Smuzhiyun # mips-unknown-linux-musl 85*4882a593Smuzhiyun default y if BR2_mips && BR2_TOOLCHAIN_USES_MUSL && !BR2_MIPS_CPU_MIPS32R6 86*4882a593Smuzhiyun # mips64-unknown-linux-muslabi64 87*4882a593Smuzhiyun default y if BR2_mips64 && BR2_TOOLCHAIN_USES_MUSL && BR2_MIPS_NABI64 && !BR2_MIPS_CPU_MIPS64R6 88*4882a593Smuzhiyun # mips64el-unknown-linux-muslabi64 89*4882a593Smuzhiyun default y if BR2_mips64el && BR2_TOOLCHAIN_USES_MUSL && BR2_MIPS_NABI64 && !BR2_MIPS_CPU_MIPS64R6 90*4882a593Smuzhiyun # mipsel-unknown-linux-musl 91*4882a593Smuzhiyun default y if BR2_mipsel && BR2_TOOLCHAIN_USES_MUSL && !BR2_MIPS_CPU_MIPS32R6 92*4882a593Smuzhiyun # sparc64-unknown-linux-gnu 93*4882a593Smuzhiyun default y if BR2_sparc64 && BR2_TOOLCHAIN_USES_GLIBC 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun# All target rust packages should depend on this option 96*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS 97*4882a593Smuzhiyun bool 98*4882a593Smuzhiyun default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS 99*4882a593Smuzhiyun default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_HOST_TOOLS_PLATFORMS 100*4882a593Smuzhiyun default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS 101*4882a593Smuzhiyun depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS 102*4882a593Smuzhiyun 103*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUSTC_ARCH 104*4882a593Smuzhiyun string 105*4882a593Smuzhiyun default "armv7" if BR2_ARM_CPU_ARMV7A 106*4882a593Smuzhiyun default BR2_ARCH if !BR2_ARM_CPU_ARMV7A 107*4882a593Smuzhiyun 108*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUSTC_ABI 109*4882a593Smuzhiyun string 110*4882a593Smuzhiyun default "eabi" if BR2_ARM_EABI 111*4882a593Smuzhiyun default "eabihf" if BR2_ARM_EABIHF 112*4882a593Smuzhiyun default "abi64" if BR2_MIPS_NABI64 113*4882a593Smuzhiyun 114*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUSTC 115*4882a593Smuzhiyun bool "host rustc" 116*4882a593Smuzhiyun depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS 117*4882a593Smuzhiyun help 118*4882a593Smuzhiyun Compiler for the Rust language 119*4882a593Smuzhiyun 120*4882a593Smuzhiyun http://www.rust-lang.org 121*4882a593Smuzhiyun 122*4882a593Smuzhiyunif BR2_PACKAGE_HOST_RUSTC 123*4882a593Smuzhiyun 124*4882a593Smuzhiyunchoice 125*4882a593Smuzhiyun prompt "Rust compiler variant" 126*4882a593Smuzhiyun default BR2_PACKAGE_HOST_RUST_BIN 127*4882a593Smuzhiyun help 128*4882a593Smuzhiyun Select a Rust compiler 129*4882a593Smuzhiyun 130*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUST 131*4882a593Smuzhiyun bool "host rust" 132*4882a593Smuzhiyun # RUSTC_TARGET_NAME must be set for building host-rust 133*4882a593Smuzhiyun # otherwise config.toml is broken. 134*4882a593Smuzhiyun depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS 135*4882a593Smuzhiyun # triggers ICE on trunc_int_for_mode, at explow.c:56 136*4882a593Smuzhiyun depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 || !BR2_aarch64 137*4882a593Smuzhiyun help 138*4882a593Smuzhiyun This package will build the compiler for the host as well as 139*4882a593Smuzhiyun two flavors of the standard library: one for the host, another 140*4882a593Smuzhiyun for the target. Both are installed in the host directory. 141*4882a593Smuzhiyun 142*4882a593Smuzhiyuncomment "host-rust needs a toolchain w/ gcc >= 5" 143*4882a593Smuzhiyun depends on BR2_aarch64 144*4882a593Smuzhiyun depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_5 145*4882a593Smuzhiyun 146*4882a593Smuzhiyunconfig BR2_PACKAGE_HOST_RUST_BIN 147*4882a593Smuzhiyun bool "host rust (pre-built)" 148*4882a593Smuzhiyun help 149*4882a593Smuzhiyun This package will install pre-built versions of the compiler 150*4882a593Smuzhiyun for the host and the Rust standard library for the target. 151*4882a593Smuzhiyun 152*4882a593Smuzhiyunendchoice 153*4882a593Smuzhiyun 154*4882a593Smuzhiyunendif 155*4882a593Smuzhiyun 156*4882a593Smuzhiyunconfig BR2_PACKAGE_PROVIDES_HOST_RUSTC 157*4882a593Smuzhiyun string 158*4882a593Smuzhiyun default "host-rust" if BR2_PACKAGE_HOST_RUST 159*4882a593Smuzhiyun # Default to host-rust-bin as long as host arch supports it 160*4882a593Smuzhiyun default "host-rust-bin" if !BR2_PACKAGE_HOST_RUST 161*4882a593Smuzhiyun depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS 162