diff --git a/.github/workflows/crossdev.yml b/.github/workflows/crossdev.yml index 044beba..e0b05b9 100644 --- a/.github/workflows/crossdev.yml +++ b/.github/workflows/crossdev.yml @@ -184,11 +184,125 @@ jobs: - target: x86_64-unknown-linux-musl gcc: true llvm: true - # Embedded or otherwise special targets + # Arm multilib target - target: arm-none-eabi args: --skip-system gcc: true llvm: false + # Cortex-M / ARMv6-M → ARMv8.1-M non-multilib targets + - target: armv6m-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv6s-m --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv7m-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7-m --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv7em-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7e-m --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv7em-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7e-m --with-mode=thumb --with-fpu=fpv4-sp-d16 --with-float=hard"' + gcc: true + llvm: false + - target: armv7em-none-eabisf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7e-m --with-mode=thumb --with-fpu=fpv4-sp-d16 --with-float=softfp"' + gcc: true + llvm: false + - target: armv8m.base-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8-m.base --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv8m.main-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8-m.main --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv8m.main-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8-m.main --with-mode=thumb --with-fpu=fpv5-sp-d16 --with-float=hard"' + gcc: true + llvm: false + - target: armv8m.main-none-eabisf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8-m.main --with-mode=thumb --with-fpu=fpv5-sp-d16 --with-float=softfp"' + gcc: true + llvm: false + - target: armv8.1m.main-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8.1-m.main+pacbti --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv8.1m.main-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8.1-m.main+mve --with-mode=thumb --with-float=hard"' + gcc: true + llvm: false + - target: armv8.1m.main-none-eabisf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8.1-m.main+pacbti+fp --with-mode=thumb --with-float=softfp"' + gcc: true + llvm: false + ## Cortex-A / ARMv7-A, ARMv7-R, ARMv8-A non-multilib targets + - target: armv7a-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7-a --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv7a-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7-a --with-mode=thumb --with-fpu=vfpv3-d16 --with-float=hard"' + gcc: true + llvm: false + - target: armv7a-none-eabisf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7-a --with-mode=thumb --with-fpu=vfpv3-d16 --with-float=softfp"' + gcc: true + llvm: false + - target: armv7ve-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7ve --with-mode=thumb --with-fpu=neon-vfpv4 --with-float=hard"' + gcc: true + llvm: false + - target: armv7ve-none-eabisf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7ve --with-mode=thumb --with-fpu=neon-vfpv4 --with-float=softfp"' + gcc: true + llvm: false + - target: armv7r-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7-r --with-mode=thumb --with-fpu=vfpv3xd --with-float=hard"' + gcc: true + llvm: false + - target: armv7r-none-eabisf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7-r --with-mode=thumb --with-fpu=vfpv3xd --with-float=softfp"' + gcc: true + llvm: false + - target: armv8a-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8-a --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv8a-none-eabisf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8-a --with-mode=thumb --with-fpu=neon-fp-armv8 --with-float=softfp"' + gcc: true + llvm: false + - target: armv8a-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv8-a --with-mode=thumb --with-fpu=neon-fp-armv8 --with-float=hard"' + gcc: true + llvm: false + ## Generic / ARMv5TE / ARMv7 + # FIXME I should be able to build this, but we cant determine multilib from the tripple. It would require a + # flag like --no-multilib or mabye --env 'MULTILIB_USE="no"'? + #- target: arm-none-eabi + # args: --skip-system --env 'EXTRA_ECONF="--disable-multilib --with-mode=thumb --with-float=soft"' + # gcc: true + # llvm: false + - target: armv7-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7 --with-mode=thumb --with-float=soft"' + gcc: true + llvm: false + - target: armv7-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv7 --with-mode=thumb --with-fpu=vfpv3-d16 --with-float=hard"' + gcc: true + llvm: false + - target: armv5te-none-eabi + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv5te --with-mode=arm --with-fpu=vfpv2 --with-float=softfp"' + gcc: true + llvm: false + - target: armv5te-none-eabihf + args: --skip-system --env 'EXTRA_ECONF="--with-arch=armv5te --with-mode=arm --with-fpu=vfpv2 --with-float=hard"' + gcc: true + llvm: false + # Embedded or otherwise special targets - target: avr args: --skip-system gcc: true diff --git a/crossdev b/crossdev index 25dea3f..fa29552 100755 --- a/crossdev +++ b/crossdev @@ -273,7 +273,7 @@ parse_target() { KPKG="[none]" LCAT="dev-embedded" LPKG="avr-libc" GUSE+=" -openmp -fortran -go" # doesn't work - MULTILIB_USE="yes" #377039 + MULTILIB_USE="yes" # avr requires multilib, that provides libgcc for all sub-architectures #378387, #377039 BUSE+=" cxx" WITH_DEF_HEADERS="no" ;; @@ -342,7 +342,8 @@ parse_target() { # for that. GUSE+=" zlib zstd" - # We need multilib for openmp to be built w/ -mgomp + # We need multilib for openmp to be built w/ -mgomp + # https://gcc.gnu.org/legacy-ml/gcc-help/2020-01/msg00106.html MULTILIB_USE="yes" WITH_DEF_HEADERS="no" ;; @@ -367,6 +368,7 @@ parse_target() { GUSE+=" zlib zstd" # We need multilib for openmp to be built w/ -mgomp + # https://gcc.gnu.org/legacy-ml/gcc-help/2020-01/msg00106.html MULTILIB_USE="yes" WITH_DEF_HEADERS="no" ;; @@ -446,7 +448,7 @@ parse_target() { ;; # Bare metal targets - *-newlib|*-elf|*-eabi|*-rtems*) + *-newlib|*-elf|*-eabi*|*-rtems*) LPKG="newlib" KPKG="[none]" GMASK+=" default-stack-clash-protection hardened ssp" @@ -454,7 +456,9 @@ parse_target() { GUSE+=" -fortran" #589672, needs syscalls GUSE+=" -hardened" #687598, needs -fstack-check=specific support GUSE+=" -default-stack-clash-protection -ssp" # SSP isn't supported for freestanding anyway - MULTILIB_USE="yes" #407275 + + [[ "$CTARGET" != armv*-eabi* ]] \ + && MULTILIB_USE="yes" #868636, #407275 WITH_DEF_HEADERS="no" ;; @@ -546,7 +550,7 @@ parse_target() { mingw*|*-mingw*) pie_support=no ;; # Many bare-metal targets don't work with pie as-is - *-elf|*-eabi) + *-elf|*-eabi*) # mips can't generate freestanding PIC: # cc1: error: position-independent code requires ‘-mabicalls’ # arm firmware packages don't expect pie-by-default: @@ -1528,27 +1532,12 @@ set_portage() { [[ ${pkg} == "[none]" ]] && return 0 - case ${CTARGET} in - # avr requires multilib, that provides - # libgcc for all sub-architectures #378387 - avr*) - mask+=" -multilib" - force+=" multilib" - ;; - accel-nvptx*|nvptx*|*-newlib|*-elf|*-eabi) - # nvptx: needs multilib because of https://gcc.gnu.org/legacy-ml/gcc-help/2020-01/msg00106.html. - mask+=" -multilib" - force+=" multilib" - ;; - *) - if [[ ${MULTILIB_USE} == "yes" ]] ; then - mask+=" -multilib" - force+=" multilib" - else - mask+=" multilib" - fi - ;; - esac + if [[ ${MULTILIB_USE} == "yes" ]]; then + mask+=" -multilib" + force+=" multilib" + else + mask+=" multilib" + fi set_use_mask ${pkg} "${mask}" set_use_force ${pkg} "${force}" @@ -1840,6 +1829,7 @@ doemerge() { [[ ${pn} == "[none]" ]] && return 0 + # MULTILIB_USE could be overriden at runtime set_use ${pn} ${USE} $( [[ ${MULTILIB_USE} == "no" ]] && echo - )multilib [[ ${INIT_TARGET_ONLY} == "yes" ]] && return 0 diff --git a/scripts/container_test.sh b/scripts/container_test.sh index 4941a50..74af1c2 100755 --- a/scripts/container_test.sh +++ b/scripts/container_test.sh @@ -6,6 +6,7 @@ print_help() { echo "Usage: $0 [OPTIONS] Options: + --env Specify env settings for binutils/gdb/gcc/kernel/libc. --llvm Use LLVM/Clang as a cross compiler --skip-system Skip emerging the @system set after setting up crossdev. --tag Specify the container tag to use. Default is 'latest'. @@ -67,6 +68,10 @@ while [[ $# -gt 0 ]]; do print_help exit 0 ;; + --env) + ENV_SETTINGS="$2" + shift 2 + ;; --llvm) USE_LLVM=1 shift 1 @@ -99,6 +104,9 @@ EXTRA_ARGS=() if [[ "${USE_LLVM}" -eq 1 ]]; then EXTRA_ARGS+="--llvm" fi +if [[ -v ENV_SETTINGS ]]; then + EXTRA_ARGS+=("--env" "${ENV_SETTINGS}") +fi "${CONTAINER_ENGINE}" run -d \ --pull always \