From 8a5c9cd7d1c4978775e4859cc92155f7abbc7e7d Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Wed, 29 Jul 2020 22:06:54 -0400 Subject: [PATCH 1/3] Add support for s390x (IBM Z System) image creation --- eng/common/cross/build-rootfs.sh | 5 +++++ eng/common/cross/s390x/sources.list.bionic | 11 +++++++++++ eng/common/cross/toolchain.cmake | 7 +++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 eng/common/cross/s390x/sources.list.bionic diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index ffdff38542e..418c86b3c24 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -106,6 +106,11 @@ while :; do __UbuntuRepo="http://ftp.debian.org/debian/" __CodeName=jessie ;; + s390x) + __BuildArch=s390x + __UbuntuArch=s390x + __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/" + ;; x86) __BuildArch=x86 __UbuntuArch=i386 diff --git a/eng/common/cross/s390x/sources.list.bionic b/eng/common/cross/s390x/sources.list.bionic new file mode 100644 index 00000000000..21095574095 --- /dev/null +++ b/eng/common/cross/s390x/sources.list.bionic @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 2566707997b..6d538a45b44 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -34,6 +34,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") if("$ENV{__DistroRid}" MATCHES "tizen.*") set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") endif() +elseif(TARGET_ARCH_NAME STREQUAL "s390x") + set(CMAKE_SYSTEM_PROCESSOR s390x) + set(TOOLCHAIN "s390x-linux-gnu") elseif(TARGET_ARCH_NAME STREQUAL "x86") set(CMAKE_SYSTEM_PROCESSOR i686) set(TOOLCHAIN "i686-linux-gnu") @@ -44,7 +47,7 @@ elseif (ILLUMOS) set(CMAKE_SYSTEM_PROCESSOR "x86_64") set(TOOLCHAIN "x86_64-illumos") else() - message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!") + message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64, s390x and x86 are supported!") endif() if(DEFINED ENV{TOOLCHAIN}) @@ -165,7 +168,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$" AND NOT "$ENV{__DistroRid}" MATCHES "android.*") OR ILLUMOS) +if((TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64|s390x)$" AND NOT "$ENV{__DistroRid}" MATCHES "android.*") OR ILLUMOS) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) From ac40a2276242ce392e259e28e3f65fcfb120435a Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Wed, 29 Jul 2020 22:37:36 -0400 Subject: [PATCH 2/3] No Unwind on s390x --- eng/common/cross/build-rootfs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 418c86b3c24..68fa3658fb8 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -110,6 +110,7 @@ while :; do __BuildArch=s390x __UbuntuArch=s390x __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/" + __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//') ;; x86) __BuildArch=x86 From 7fbbe8981fb360a66dc14c7d460b82881104268e Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Wed, 29 Jul 2020 22:45:46 -0400 Subject: [PATCH 3/3] Let's skip liblldb too --- eng/common/cross/build-rootfs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 68fa3658fb8..6bb5f248a7c 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -111,6 +111,7 @@ while :; do __UbuntuArch=s390x __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/" __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//') + unset __LLDB_Package ;; x86) __BuildArch=x86