From a484d6db87886c5dd2fc8c9460484219c8877110 Mon Sep 17 00:00:00 2001 From: Jakob Naucke Date: Mon, 7 Jun 2021 17:39:31 +0200 Subject: [PATCH] osbuilder: Streamline s390x CMake & musl handling - Merge codepath in lib.sh with ppc64le -- do not install CMake - Like ppc64le, do not install musl rather than just not using it Fixes: #1975 Signed-off-by: Jakob Naucke --- tools/osbuilder/rootfs-builder/rootfs.sh | 5 ++++- tools/osbuilder/scripts/lib.sh | 17 ++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/tools/osbuilder/rootfs-builder/rootfs.sh b/tools/osbuilder/rootfs-builder/rootfs.sh index 9fbe49bad1..a53bad208f 100755 --- a/tools/osbuilder/rootfs-builder/rootfs.sh +++ b/tools/osbuilder/rootfs-builder/rootfs.sh @@ -570,7 +570,10 @@ EOT AGENT_DEST="${AGENT_DIR}/${AGENT_BIN}" if [ -z "${AGENT_SOURCE_BIN}" ] ; then - [ "$ARCH" == "ppc64le" ] && { LIBC=gnu; echo "WARNING: Forcing LIBC=gnu for ppc64le because musl toolchain is not supported on ppc64le"; } + if [ "$ARCH" == "ppc64le" ] || [ "$ARCH" == "s390x" ]; then + LIBC=gnu + echo "WARNING: Forcing LIBC=gnu because $ARCH has no musl Rust target" + fi [ "$LIBC" == "musl" ] && bash ${script_dir}/../../../ci/install_musl.sh # rust agent needs ${arch}-unknown-linux-${LIBC} rustup show | grep linux-${LIBC} > /dev/null || bash ${script_dir}/../../../ci/install_rust.sh diff --git a/tools/osbuilder/scripts/lib.sh b/tools/osbuilder/scripts/lib.sh index 5a7e41544d..02ca8d17f5 100644 --- a/tools/osbuilder/scripts/lib.sh +++ b/tools/osbuilder/scripts/lib.sh @@ -339,10 +339,8 @@ RUN ln -sf /usr/bin/g++ /bin/musl-g++ [ -f "${dockerfile_template}" ] || die "${dockerfile_template}: file not found" fi - # powerpc have no musl target, don't setup rust enviroment - # since we cannot static link agent. Besides, there is - # also long double representation problem when building musl-libc - if [ "${architecture}" == "ppc64le" ]; then + # ppc64le and s390x have no musl target + if [ "${architecture}" == "ppc64le" ] || [ "${architecture}" == "s390x" ]; then sed \ -e "s|@GO_VERSION@|${GO_VERSION}|g" \ -e "s|@OS_VERSION@|${OS_VERSION:-}|g" \ @@ -351,17 +349,6 @@ RUN ln -sf /usr/bin/g++ /bin/musl-g++ -e "s|@INSTALL_RUST@|${install_rust//$'\n'/\\n}|g" \ -e "s|@SET_PROXY@|${set_proxy:-}|g" \ "${dockerfile_template}" > Dockerfile - # no musl target on s390x, will use GNU - elif [ "${architecture}" == "s390x" ]; then - sed \ - -e "s|@GO_VERSION@|${GO_VERSION}|g" \ - -e "s|@OS_VERSION@|${OS_VERSION:-}|g" \ - -e "s|@INSTALL_CMAKE@|${install_cmake//$'\n'/\\n}|g" \ - -e "s|@INSTALL_MUSL@||g" \ - -e "s|@INSTALL_GO@|${install_go//$'\n'/\\n}|g" \ - -e "s|@INSTALL_RUST@|${install_rust//$'\n'/\\n}|g" \ - -e "s|@SET_PROXY@|${set_proxy:-}|g" \ - "${dockerfile_template}" > Dockerfile else sed \ -e "s|@GO_VERSION@|${GO_VERSION}|g" \