From: Kienan Stewart Date: Tue, 22 Aug 2023 20:39:52 +0000 (-0400) Subject: ansible: Disable multilib for gcc 4.8 powerpc64le X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=2a8d15d671f7021f911c00c834de5f960461967b;p=lttng-ci.git ansible: Disable multilib for gcc 4.8 powerpc64le This enables the support for '-m32' which is required when compiling powerpc64le kernels Change-Id: I61ec67220aa677e3339f6c10278b905347ea1cf7 --- diff --git a/automation/ansible/roles/cross-compilers/files/script.sh b/automation/ansible/roles/cross-compilers/files/script.sh index 47b04a0..e6fec0b 100755 --- a/automation/ansible/roles/cross-compilers/files/script.sh +++ b/automation/ansible/roles/cross-compilers/files/script.sh @@ -4,9 +4,10 @@ SRC_DIR="${SRC_DIR:-/src/gcc-releases-gcc-4.8.5}" PATCH_DIR="${PATCH_DIR:-/src/patches}" TARGET="${TARGET:-aarch64-linux-gnu}" HOST="${HOST:-x86_64-linux-gnu}" -CONFIGURE_ARGS="${CONFIGURE_ARGS:-}" -MAKE_ARGS="${MAKE_ARGS:-}" -MAKE_INSTALL_ARGS="${MAKE_INSTALL_ARGS:-}" +CONFIGURE_ARGS=(${CONFIGURE_ARGS:-}) +MAKE_ARGS=(${MAKE_ARGS:-}) +MAKE_INSTALL_ARGS=(${MAKE_INSTALL_ARGS:-}) +DEBUG="${DEBUG:-}" OWD="$(pwd)" cd "${SRC_DIR}" || exit 1 @@ -18,9 +19,12 @@ while read -r line ; do fi patch -p"${PATCH_LEVEL}" < "${line}" done < <(find "${PATCH_DIR}" -type f) -cd "${OWD}" +cd "${OWD}" || exit 1 TARGET_ARGS=() +CFLAGS=(-std=gnu99) +CXXFLAGS=(-std=gnu++98) +# apt-get install -y gcc-"${TARGET}" case "${TARGET}" in aarch64-linux-gnu) TARGET_ARGS+=( @@ -42,8 +46,13 @@ case "${TARGET}" in ) ;; powerpc64le-linux-gnu) + # Disable multilib so that ppc64el kernel can be built, since + # legacy Makefiles compile vdso in 32bits unconditionally. + # @see https://bugzilla.redhat.com/show_bug.cgi?id=1237363 + # @see https://bugzilla.redhat.com/show_bug.cgi?id=1205236 + # @see https://bugs.launchpad.net/ubuntu/trusty/+source/linux/+bug/1433809/ TARGET_ARGS+=( - --enable-secureplt + --disable-multilib --enable-targets=powerpcle-linux --with-cpu=power8 --with-long-double-128 @@ -74,6 +83,7 @@ case "${TARGET}" in ;; esac +START=$(date +%s) "${SRC_DIR}/configure" --build="${HOST}" --host="${HOST}" --enable-languages=c,c++ \ --program-prefix="${TARGET}-" --target="${TARGET}" --program-suffix=-4.8 \ --prefix=/usr/ --with-system-zlib \ @@ -81,14 +91,20 @@ esac --disable-nls --disable-shared --enable-host-shared \ --disable-bootstrap --enable-threads=posix --enable-default-pie \ --with-sysroot=/ --includedir=/usr/"${TARGET}"/include \ - --without-target-system-zlib --enable-multiarch - ${TARGET_ARGS[@]} ${CONFIGURE_ARGS} \ - CFLAGS='-std=gnu99' CXXFLAGS='-std=gnu++98' + --without-target-system-zlib --enable-multiarch \ + "${TARGET_ARGS[@]}" "${CONFIGURE_ARGS[@]}" \ + CFLAGS="${CFLAGS[*]}" CXXFLAGS="${CXXFLAGS[*]}" + +NPROC="${NPROC:=$(nproc)}" +make -j"${NPROC}" "${MAKE_ARGS[@]}" CFLAGS="${CFLAGS[*]}" CXXFLAGS="${CXXFLAGS[*]}" +# Do not use -jN with make install, it often breaks. +make install "${MAKE_INSTALL_ARGS[@]}" + +mkdir -p "/output/usr/lib/gcc-cross/${TARGET}" /output/usr/bin/ -make -j"${NPROC:-$(nproc)}" ${MAKE_ARGS} \ - CFLAGS='-std=gnu99' CXXFLAGS='-std=gnu++98' +if [ -n "${DEBUG}" ] ; then + echo $(($(date +%s) - START)) > "/output/${TARGET}.time" +fi -make install ${MAKE_INSTALL_ARGS} -mkdir -p /output/usr/lib/ /output/usr/bin/ -cp -r /usr/lib/gcc-cross /output/usr/lib/ +cp -r /usr/lib/gcc-cross/"${TARGET}"/4* "/output/usr/lib/gcc-cross/${TARGET}/" cp /usr/bin/*-4.8 /output/usr/bin/