From 5b4841132faea49dcccab3628d43cdad3f9989bf Mon Sep 17 00:00:00 2001 From: Xaver Gruber Date: Sun, 6 Apr 2025 10:28:44 +0200 Subject: [PATCH 1/2] dont build for x86_64 --- swift-ci/sdks/static-linux/scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift-ci/sdks/static-linux/scripts/build.sh b/swift-ci/sdks/static-linux/scripts/build.sh index 4b9f64a7..7ab789a8 100755 --- a/swift-ci/sdks/static-linux/scripts/build.sh +++ b/swift-ci/sdks/static-linux/scripts/build.sh @@ -113,7 +113,7 @@ declare_package zlib "zlib" "Zlib" "https://zlib.net" # Parse command line arguments static_linux_sdk_version=0.0.1 sdk_name= -archs=x86_64,aarch64 +archs=aarch64 build_type=RelWithDebInfo parallel_jobs=$(($(nproc --all) + 2)) source_dir= From 42e04970c653b091ff5ec14ca0d4d94341084368 Mon Sep 17 00:00:00 2001 From: Xaver Gruber Date: Sun, 6 Apr 2025 11:35:41 +0200 Subject: [PATCH 2/2] delete musl build --- swift-ci/sdks/static-linux/scripts/build.sh | 96 --------------------- 1 file changed, 96 deletions(-) diff --git a/swift-ci/sdks/static-linux/scripts/build.sh b/swift-ci/sdks/static-linux/scripts/build.sh index 7ab789a8..ecf37d75 100755 --- a/swift-ci/sdks/static-linux/scripts/build.sh +++ b/swift-ci/sdks/static-linux/scripts/build.sh @@ -255,18 +255,6 @@ run export PATH="${build_dir}/cmake/install/bin:$PATH" quiet_popd run cmake --version -header "Patching Musl" - -echo -n "Patching Musl for locale support... " -patch=$(realpath "${resource_dir}/patches/musl.patch") -if git -C ${source_dir}/musl apply --reverse --check "$patch" >/dev/null 2>&1; then - echo "already patched" -elif git -C ${source_dir}/musl apply "$patch" >/dev/null 2>&1; then - echo "done" -else - echo "failed" - exit 1 -fi for arch in $archs; do @@ -312,71 +300,6 @@ EOF # ----------------------------------------------------------------------- - header "Building Musl for ${arch}" - - quiet_pushd "${build_dir}/$arch/musl" - if [[ "$BUILD_TYPE" == "Debug" ]]; then - maybe_debug="--enable-debug" - fi - run ${source_dir}/musl/configure \ - --target=$triple \ - --prefix=$sdk_root/usr \ - --disable-shared \ - --enable-static \ - --with-unwind-tables=async \ - $maybe_debug \ - CC="$cc" CXX="$cxx" AS="$as" AR="ar" RANLIB="ranlib" - make -j$parallel_jobs - make -j$parallel_jobs install - quiet_popd - - # ----------------------------------------------------------------------- - - header "Modularizing Musl's headers" - - python3 ${script_dir}/fixtypes.py \ - ${source_dir}/musl/arch/${arch}/bits/alltypes.h.in \ - ${source_dir}/musl/include/alltypes.h.in \ - $sdk_root/usr/include/bits/musldefs.h \ - $sdk_root/usr/include/bits/alltypes.h \ - $sdk_root/usr/include/bits/types - - quiet_pushd $sdk_root/usr/include - for header in $(find . -name '*.h'); do - echo "Fixing $header" - sed -i -E "s:#define[ \t]+__NEED_([_A-Za-z][_A-Za-z0-9]*):#include :g;/#include /d" $header - done - mkdir -p _modules - for header in assert complex ctype errno fenv float inttypes iso646 \ - limits locale math setjmp stdalign stdarg stdatomic \ - stdbool stddef stdint stdio stdlib string tgmath \ - uchar wchar wctype; do - echo "Making _modules/${header}_h.h" - cat > _modules/${header}_h.h < instead" -#endif -#include <${header}.h> -EOF - done - quiet_popd - - # ----------------------------------------------------------------------- - - header "Constructing modulemap" - - # Install the modulemap but *not* SwiftMusl.h - awk ' -/^\/\/ START SWIFT ONLY/ { ignore=1 } -/^\/\/ END SWIFT ONLY/ { ignore=0; next } -ignore == 0 { print } -' \ - "${source_dir}/swift-project/swift/stdlib/public/Platform/musl.modulemap" \ - > "$sdk_root/usr/include/module.modulemap" - echo "OK" - - # ----------------------------------------------------------------------- - header "Setting up for build" # Not having these makes CMake compiler identification fail, because @@ -442,25 +365,6 @@ EOF # ----------------------------------------------------------------------- - header "Building fts for ${arch}" - - run cmake -G Ninja -S ${resource_dir}/fts -B ${build_dir}/$arch/fts \ - -DCMAKE_TOOLCHAIN_FILE=${build_dir}/$arch/toolchain.cmake \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_INSTALL_PREFIX=$sdk_root/usr - - quiet_pushd ${build_dir}/$arch/fts - run ninja -j$parallel_jobs - quiet_popd - - header "Installing fts for ${arch}" - - quiet_pushd ${build_dir}/$arch/fts - run ninja -j$parallel_jobs install - quiet_popd - - # ----------------------------------------------------------------------- - header "Building runtimes for ${arch}" run cmake -G Ninja -S ${source_dir}/swift-project/llvm-project/runtimes \