From 24dca403803546d6897e441f23a12f6c0505056c Mon Sep 17 00:00:00 2001 From: Joel Winarske Date: Sat, 14 Sep 2024 13:14:57 -0700 Subject: [PATCH] Add missing clang_x64 folder Signed-off-by: Joel Winarske --- .github/workflows/flutter-engine-arm64.yaml | 33 +++----- .github/workflows/flutter-engine-armv7hf.yaml | 33 +++----- .github/workflows/flutter-engine-x86_64.yaml | 33 +++----- LICENSE | 2 +- README.md | 4 +- scripts/prepare-sdk-arm64.sh | 76 +++++++----------- scripts/prepare-sdk-armv7hf.sh | 77 +++++------------- scripts/prepare-sdk-x86-64.sh | 80 +++++++------------ 8 files changed, 117 insertions(+), 221 deletions(-) diff --git a/.github/workflows/flutter-engine-arm64.yaml b/.github/workflows/flutter-engine-arm64.yaml index 85f8ee0..7658096 100644 --- a/.github/workflows/flutter-engine-arm64.yaml +++ b/.github/workflows/flutter-engine-arm64.yaml @@ -16,7 +16,7 @@ jobs: linux-arm64: runs-on: [self-hosted, linux, x64] env: - arch: arm64 + arch: arm64 linux_cpu: arm64 target_triple: aarch64-unknown-linux-gnu target_sysroot: debian_sid_arm64-sysroot @@ -90,8 +90,8 @@ jobs: with: name: engine-sdk-debug path: | - $tag_debug.tar.gz - $tag_debug.tar.gz.sha256 + linux-engine-sdk-debug-arm64-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-debug-arm64-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Debug Release if: ${{ inputs.release == 'true' }} @@ -99,6 +99,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_debug" --cleanup-tag -y |true gh release create --draft "$tag_debug" --title "$tag_debug" --notes "$notes_debug" gh release upload "$tag_debug" "$tag_debug.tar.gz" "$tag_debug.tar.gz.sha256" gh release edit "$tag_debug" --draft=false @@ -130,10 +131,8 @@ jobs: scripts/prepare-sdk-$arch.sh src/out/linux_debug_unopt_$arch $PWD/src/build/linux/$target_sysroot tar czfhv $tag_debug_unopt.tar.gz src/out/linux_debug_unopt_$arch/engine-sdk/ - tar czfhv $tag_debug_unopt-symbols.tar.gz src/out/linux_debug_unopt_$arch/.debug/ sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256 - sha256sum -b $tag_debug_unopt-symbols.tar.gz > $tag_debug_unopt-symbols.tar.gz.sha256 - name: Publish Debug Unoptimized if: ${{ inputs.release != 'true' }} @@ -141,17 +140,8 @@ jobs: with: name: engine-sdk-debug-unoptimized path: | - $tag_debug_unopt.tar.gz - $tag_debug_unopt.tar.gz.sha256 - - - name: Publish Debug Unoptimized Symbols - if: ${{ inputs.release != 'true' }} - uses: actions/upload-artifact@v4 - with: - name: engine-sdk-debug-unoptimized-symbols - path: | - $tag_debug_unopt-symbols.tar.gz - $tag_debug_unopt-symbols.tar.gz.sha256 + linux-engine-sdk-debug-unopt-arm64-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-debug-unopt-arm64-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Debug Unoptimized Release if: ${{ inputs.release == 'true' }} @@ -159,6 +149,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_debug_unopt" --cleanup-tag -y |true gh release create --draft "$tag_debug_unopt" --title "$tag_debug_unopt" --notes "$notes_debug_unopt" gh release upload "$tag_debug_unopt" "$tag_debug_unopt.tar.gz" "$tag_debug_unopt.tar.gz.sha256" gh release edit "$tag_debug_unopt" --draft=false @@ -198,8 +189,8 @@ jobs: with: name: engine-sdk-release path: | - $tag_release.tar.gz - $tag_release.tar.gz.sha256 + linux-engine-sdk-release-arm64-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-release-arm64-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Publish Release if: ${{ inputs.release == 'true' }} @@ -207,6 +198,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_release" --cleanup-tag -y |true gh release create --draft "$tag_release" --title "$tag_release" --notes "$notes_release" gh release upload "$tag_release" "$tag_release.tar.gz" "$tag_release.tar.gz.sha256" gh release edit "$tag_release" --draft=false @@ -246,8 +238,8 @@ jobs: with: name: engine-sdk-profile path: | - $tag_profile.tar.gz - $tag_profile.tar.gz.sha256 + linux-engine-sdk-profile-arm64-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-profile-arm64-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Publish Profile if: ${{ inputs.release == 'true' }} @@ -255,6 +247,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_profile" --cleanup-tag -y |true gh release create --draft "$tag_profile" --title "$tag_profile" --notes "$notes_profile" gh release upload "$tag_profile" "$tag_profile.tar.gz" "$tag_profile.tar.gz.sha256" gh release edit "$tag_profile" --draft=false diff --git a/.github/workflows/flutter-engine-armv7hf.yaml b/.github/workflows/flutter-engine-armv7hf.yaml index 45fffbf..ad2f45b 100644 --- a/.github/workflows/flutter-engine-armv7hf.yaml +++ b/.github/workflows/flutter-engine-armv7hf.yaml @@ -16,7 +16,7 @@ jobs: linux-armv7hf: runs-on: [self-hosted, linux, x64] env: - arch: arm + arch: arm linux_cpu: arm --arm-float-abi hard target_triple: armv7-unknown-linux-gnueabihf target_sysroot: debian_sid_arm-sysroot @@ -91,8 +91,8 @@ jobs: with: name: engine-sdk-debug path: | - $tag_debug.tar.gz - $tag_debug.tar.gz.sha256 + linux-engine-sdk-debug-armv7hf-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-debug-armv7hf-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Debug Release if: ${{ inputs.release == 'true' }} @@ -100,6 +100,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_debug" --cleanup-tag -y |true gh release create --draft "$tag_debug" --title "$tag_debug" --notes "$notes_debug" gh release upload "$tag_debug" "$tag_debug.tar.gz" "$tag_debug.tar.gz.sha256" gh release edit "$tag_debug" --draft=false @@ -131,10 +132,8 @@ jobs: scripts/prepare-sdk-armv7hf.sh src/out/linux_debug_unopt_$arch $PWD/src/build/linux/$target_sysroot tar czfhv $tag_debug_unopt.tar.gz src/out/linux_debug_unopt_$arch/engine-sdk/ - tar czfhv $tag_debug_unopt-symbols.tar.gz src/out/linux_debug_unopt_$arch/.debug/ sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256 - sha256sum -b $tag_debug_unopt-symbols.tar.gz > $tag_debug_unopt-symbols.tar.gz.sha256 - name: Publish Debug Unoptimized if: ${{ inputs.release != 'true' }} @@ -142,17 +141,8 @@ jobs: with: name: engine-sdk-debug-unoptimized path: | - $tag_debug_unopt.tar.gz - $tag_debug_unopt.tar.gz.sha256 - - - name: Publish Debug Unoptimized Symbols - if: ${{ inputs.release != 'true' }} - uses: actions/upload-artifact@v4 - with: - name: engine-sdk-debug-unoptimized-symbols - path: | - $tag_debug_unopt-symbols.tar.gz - $tag_debug_unopt-symbols.tar.gz.sha256 + linux-engine-sdk-debug-unopt-armv7hf-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-debug-unopt-armv7hf-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Debug Unoptimized Release if: ${{ inputs.release == 'true' }} @@ -160,6 +150,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_debug_unopt" --cleanup-tag -y |true gh release create --draft "$tag_debug_unopt" --title "$tag_debug_unopt" --notes "$notes_debug_unopt" gh release upload "$tag_debug_unopt" "$tag_debug_unopt.tar.gz" "$tag_debug_unopt.tar.gz.sha256" gh release edit "$tag_debug_unopt" --draft=false @@ -200,8 +191,8 @@ jobs: with: name: engine-sdk-release path: | - $tag_release.tar.gz - $tag_release.tar.gz.sha256 + linux-engine-sdk-release-armv7hf-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-release-armv7hf-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Publish Release if: ${{ inputs.release == 'true' }} @@ -209,6 +200,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_release" --cleanup-tag -y |true gh release create --draft "$tag_release" --title "$tag_release" --notes "$notes_release" gh release upload "$tag_release" "$tag_release.tar.gz" "$tag_release.tar.gz.sha256" gh release edit "$tag_release" --draft=false @@ -248,8 +240,8 @@ jobs: with: name: engine-sdk-profile path: | - $tag_profile.tar.gz - $tag_profile.tar.gz.sha256 + linux-engine-sdk-profile-armv7hf-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-profile-armv7hf-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Publish Profile if: ${{ inputs.release == 'true' }} @@ -257,6 +249,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_profile" --cleanup-tag -y |true gh release create --draft "$tag_profile" --title "$tag_profile" --notes "$notes_profile" gh release upload "$tag_profile" "$tag_profile.tar.gz" "$tag_profile.tar.gz.sha256" gh release edit "$tag_profile" --draft=false diff --git a/.github/workflows/flutter-engine-x86_64.yaml b/.github/workflows/flutter-engine-x86_64.yaml index 1569c02..f54c6ba 100644 --- a/.github/workflows/flutter-engine-x86_64.yaml +++ b/.github/workflows/flutter-engine-x86_64.yaml @@ -16,7 +16,7 @@ jobs: linux-x86_64: runs-on: [self-hosted, linux, x64] env: - arch: x64 + arch: x64 linux_cpu: x64 target_triple: x86_64-unknown-linux-gnu target_sysroot: debian_sid_amd64-sysroot @@ -87,8 +87,8 @@ jobs: with: name: engine-sdk-debug path: | - $tag_debug.tar.gz - $tag_debug.tar.gz.sha256 + linux-engine-sdk-debug-x86_64-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-debug-x86_64-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Debug Release if: ${{ inputs.release == 'true' }} @@ -96,6 +96,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_debug" --cleanup-tag -y |true gh release create --draft "$tag_debug" --title "$tag_debug" --notes "$notes_debug" gh release upload "$tag_debug" "$tag_debug.tar.gz" "$tag_debug.tar.gz.sha256" gh release edit "$tag_debug" --draft=false @@ -127,10 +128,8 @@ jobs: scripts/prepare-sdk-x86-64.sh src/out/linux_debug_unopt_$arch $PWD/src/build/linux/$target_sysroot tar czfhv $tag_debug_unopt.tar.gz src/out/linux_debug_unopt_$arch/engine-sdk/ - tar czfhv $tag_debug_unopt-symbols.tar.gz src/out/linux_debug_unopt_$arch/.debug/ sha256sum -b $tag_debug_unopt.tar.gz > $tag_debug_unopt.tar.gz.sha256 - sha256sum -b $tag_debug_unopt-symbols.tar.gz > $tag_debug_unopt-symbols.tar.gz.sha256 - name: Publish Debug Unoptimized if: ${{ inputs.release != 'true' }} @@ -138,17 +137,8 @@ jobs: with: name: engine-sdk-debug-unoptimized path: | - $tag_debug_unopt.tar.gz - $tag_debug_unopt.tar.gz.sha256 - - - name: Publish Debug Unoptimized Symbols - if: ${{ inputs.release != 'true' }} - uses: actions/upload-artifact@v4 - with: - name: engine-sdk-debug-unoptimized-symbols - path: | - $tag_debug_unopt-symbols.tar.gz - $tag_debug_unopt-symbols.tar.gz.sha256 + linux-engine-sdk-debug-unopt-x86_64-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-debug-unopt-x86_64-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Debug Unoptimized Release if: ${{ inputs.release == 'true' }} @@ -156,6 +146,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_debug_unopt" --cleanup-tag -y |true gh release create --draft "$tag_debug_unopt" --title "$tag_debug_unopt" --notes "$notes_debug_unopt" gh release upload "$tag_debug_unopt" "$tag_debug_unopt.tar.gz" "$tag_debug_unopt.tar.gz.sha256" gh release edit "$tag_debug_unopt" --draft=false @@ -195,8 +186,8 @@ jobs: with: name: engine-sdk-release path: | - $tag_release.tar.gz - $tag_release.tar.gz.sha256 + linux-engine-sdk-release-x86_64-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-release-x86_64-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Publish Release if: ${{ inputs.release == 'true' }} @@ -204,6 +195,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_release" --cleanup-tag -y |true gh release create --draft "$tag_release" --title "$tag_release" --notes "$notes_release" gh release upload "$tag_release" "$tag_release.tar.gz" "$tag_release.tar.gz.sha256" gh release edit "$tag_release" --draft=false @@ -243,8 +235,8 @@ jobs: with: name: engine-sdk-profile path: | - $tag_profile.tar.gz - $tag_profile.tar.gz.sha256 + linux-engine-sdk-profile-x86_64-${{ inputs.srcrev }}.tar.gz + linux-engine-sdk-profile-x86_64-${{ inputs.srcrev }}.tar.gz.sha256 - name: Release - Publish Profile if: ${{ inputs.release == 'true' }} @@ -252,6 +244,7 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} run: | + gh release delete "$tag_profile" --cleanup-tag -y |true gh release create --draft "$tag_profile" --title "$tag_profile" --notes "$notes_profile" gh release upload "$tag_profile" "$tag_profile.tar.gz" "$tag_profile.tar.gz.sha256" gh release edit "$tag_profile" --draft=false diff --git a/LICENSE b/LICENSE index 261eeb9..697fc1d 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024 Joel Winarske Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 802c1dc..bddcaa6 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,6 @@ Never use a binary build artifact from a server that you cannot validate the exp When running binaries on your Linux host, if it fails to execute due to interpreter error you can use the following pattern: ``` -unshare -mr chroot `pwd`/engine-sdk /usr/bin/gen_snapshot --version -Dart SDK version: 3.6.0-164.0.dev (dev) (Tue Aug 20 13:05:46 2024 -0700) on "linux_x64" +unshare -mr chroot $(pwd)/engine-sdk/clang_x64 /bin/gen_snapshot --version +Dart SDK version: 3.5.2 (stable) (Wed Aug 28 10:01:20 2024 +0000) on "linux_x64" ``` diff --git a/scripts/prepare-sdk-arm64.sh b/scripts/prepare-sdk-arm64.sh index ed1c435..ade3c83 100755 --- a/scripts/prepare-sdk-arm64.sh +++ b/scripts/prepare-sdk-arm64.sh @@ -4,81 +4,59 @@ pushd $1 SYSROOT=$2 -mkdir -p engine-sdk/{data,bin,lib/aarch64-linux-gnu,usr/lib/aarch64-linux-gnu,usr/include,sdk/lib} +mkdir -p engine-sdk/{bin,include,lib,data,clang_x64/bin,clang_x64/lib64} # -# /data +# Include # -cp icudtl.dat engine-sdk/data/ +cp flutter_embedder.h engine-sdk/include/ # -# Include +# /data # -cp flutter_embedder.h engine-sdk/usr/include/ +cp icudtl.dat engine-sdk/data/ # # SDK # cp -r flutter_patched_sdk engine-sdk/sdk/ if [ -e shader_lib ]; then - cp -r shader_lib engine-sdk/sdk/lib + cp -r shader_lib engine-sdk/ fi -# -# /bin -# -cp exe.unstripped/* engine-sdk/bin/ +export cwd=$(pwd) # -# /lib +# host - x64 # -export cwd=$(pwd) -cd so.unstripped +cd clang_x64/exe.unstripped for file in *; do - cp "$file" $cwd/engine-sdk/lib/ - cp "../$file.TOC" $cwd/engine-sdk/sdk/lib/ + cp "../$file" $cwd/engine-sdk/clang_x64/bin/ + + # Copy each library with its parent directories to the target directory + for library in $(ldd "$file" | cut -d '>' -f 2 | awk '{print $1}') + do + [ -f "${library}" ] && cp --verbose --parents "${library}" "$cwd/engine-sdk/clang_x64/" + done done cd $cwd -cp $SYSROOT/lib/ld-linux-aarch64.so* engine-sdk/lib/ # -# /usr/lib/$ARCH-linux-gnu +# /bin # -cp $SYSROOT/lib/aarch64-linux-gnu/libdl-* engine-sdk/lib/aarch64-linux-gnu/ -cp $SYSROOT/usr/lib/aarch64-linux-gnu/libdl.so* engine-sdk/usr/lib/aarch64-linux-gnu/ -cp -d $SYSROOT/lib/aarch64-linux-gnu/libdl.so* engine-sdk/lib/aarch64-linux-gnu/ -cp -d $SYSROOT/usr/lib/aarch64-linux-gnu/libdl-* engine-sdk/usr/lib/aarch64-linux-gnu/ -cp $SYSROOT/lib/aarch64-linux-gnu/libpthread-* engine-sdk/lib/aarch64-linux-gnu/ -cp $SYSROOT/usr/lib/aarch64-linux-gnu/libpthread-* engine-sdk/usr/lib/aarch64-linux-gnu/ -cp -d $SYSROOT/lib/aarch64-linux-gnu/libpthread.so* engine-sdk/lib/aarch64-linux-gnu/ -cp -d $SYSROOT/usr/lib/aarch64-linux-gnu/libpthread.so* engine-sdk/usr/lib/aarch64-linux-gnu/ -cp $SYSROOT/lib/aarch64-linux-gnu/libm-* engine-sdk/lib/aarch64-linux-gnu/ -cp $SYSROOT/usr/lib/aarch64-linux-gnu/libm-* engine-sdk/usr/lib/aarch64-linux-gnu/ -cp -d $SYSROOT/lib/aarch64-linux-gnu/libm.so* engine-sdk/lib/aarch64-linux-gnu/ -cp -d $SYSROOT/usr/lib/aarch64-linux-gnu/libm.so* engine-sdk/usr/lib/aarch64-linux-gnu/ -cp $SYSROOT/lib/aarch64-linux-gnu/libc-* engine-sdk/lib/aarch64-linux-gnu/ -cp $SYSROOT/usr/lib/aarch64-linux-gnu/libc-* engine-sdk/usr/lib/aarch64-linux-gnu/ -cp -d $SYSROOT/lib/aarch64-linux-gnu/libc.so* engine-sdk/lib/aarch64-linux-gnu/ -cp -d $SYSROOT/usr/lib/aarch64-linux-gnu/libc.so* engine-sdk/usr/lib/aarch64-linux-gnu/ +cd exe.unstripped +for file in *; do + cp "../$file" $cwd/engine-sdk/bin/ +done +cd $cwd # -# Strip Components +# /lib # -export CLANG_BIN_PATH=../../flutter/buildtools/linux-x64/clang/bin -mkdir -p .debug -for file in $(pwd)/engine-sdk/bin/*; do - if [ -f "$file" ]; then - $CLANG_BIN_PATH/llvm-strip --only-keep-debug -o $file.debug $file - $CLANG_BIN_PATH/llvm-strip $file - fi -done -mv $(pwd)/engine-sdk/bin/*.debug $(pwd)/.debug/ -for file in $(pwd)/engine-sdk/lib/*; do - if [ -f "$file" ]; then - $CLANG_BIN_PATH/llvm-strip --only-keep-debug -o $file.debug $file - $CLANG_BIN_PATH/llvm-strip $file - fi +cd so.unstripped +for file in *; do + cp "../$file" $cwd/engine-sdk/lib/ done -mv $(pwd)/engine-sdk/lib/*.debug $(pwd)/.debug/ +cd $cwd popd diff --git a/scripts/prepare-sdk-armv7hf.sh b/scripts/prepare-sdk-armv7hf.sh index 960792f..413a9fb 100755 --- a/scripts/prepare-sdk-armv7hf.sh +++ b/scripts/prepare-sdk-armv7hf.sh @@ -4,85 +4,50 @@ pushd $1 SYSROOT=$2 -mkdir -p engine-sdk/{data,lib,bin,lib/arm-linux-gnueabihf,usr/lib/arm-linux-gnueabihf,bin/clang_x64,usr/include,sdk/lib} +mkdir -p engine-sdk/{bin,include,lib,data,clang_x64/bin,clang_x64/lib64} # -# /data +# Include # -cp icudtl.dat engine-sdk/data/ +cp flutter_embedder.h engine-sdk/include/ # -# Include +# /data # -cp flutter_embedder.h engine-sdk/usr/include/ +cp icudtl.dat engine-sdk/data/ # # SDK # cp -r flutter_patched_sdk engine-sdk/sdk/ if [ -e shader_lib ]; then - cp -r shader_lib engine-sdk/sdk/lib + cp -r shader_lib engine-sdk/ fi -# -# /bin -# -cp clang_x64/exe.unstripped/* engine-sdk/bin/clang_x64/ +export cwd=$(pwd) # -# /lib +# host - x64 # -export cwd=$(pwd) -cd so.unstripped +cd clang_x64/exe.unstripped for file in *; do - cp "$file" $cwd/engine-sdk/lib/ - cp "../$file.TOC" $cwd/engine-sdk/sdk/lib/ + cp "../$file" $cwd/engine-sdk/clang_x64/bin/ + + # Copy each library with its parent directories to the target directory + for library in $(ldd "$file" | cut -d '>' -f 2 | awk '{print $1}') + do + [ -f "${library}" ] && cp --verbose --parents "${library}" "$cwd/engine-sdk/clang_x64/" + done done cd $cwd # -# ld-linux-* -# -cp $SYSROOT/lib/ld-linux-armhf.so* engine-sdk/lib/ - -# -# /usr/lib/$ARCH-linux-gnu -# -cp $SYSROOT/lib/arm-linux-gnueabihf/libdl-* engine-sdk/lib/arm-linux-gnueabihf/ -cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so* engine-sdk/usr/lib/arm-linux-gnueabihf/ -cp -d $SYSROOT/lib/arm-linux-gnueabihf/libdl.so* engine-sdk/lib/arm-linux-gnueabihf/ -cp -d $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl-* engine-sdk/usr/lib/arm-linux-gnueabihf/ -cp $SYSROOT/lib/arm-linux-gnueabihf/libpthread-* engine-sdk/lib/arm-linux-gnueabihf/ -cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libpthread-* engine-sdk/usr/lib/arm-linux-gnueabihf/ -cp -d $SYSROOT/lib/arm-linux-gnueabihf/libpthread.so* engine-sdk/lib/arm-linux-gnueabihf/ -cp -d $SYSROOT/usr/lib/arm-linux-gnueabihf/libpthread.so* engine-sdk/usr/lib/arm-linux-gnueabihf/ -cp $SYSROOT/lib/arm-linux-gnueabihf/libm-* engine-sdk/lib/arm-linux-gnueabihf/ -cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libm-* engine-sdk/usr/lib/arm-linux-gnueabihf/ -cp -d $SYSROOT/lib/arm-linux-gnueabihf/libm.so* engine-sdk/lib/arm-linux-gnueabihf/ -cp -d $SYSROOT/usr/lib/arm-linux-gnueabihf/libm.so* engine-sdk/usr/lib/arm-linux-gnueabihf/ -cp $SYSROOT/lib/arm-linux-gnueabihf/libc-* engine-sdk/lib/arm-linux-gnueabihf/ -cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libc-* engine-sdk/usr/lib/arm-linux-gnueabihf/ -cp -d $SYSROOT/lib/arm-linux-gnueabihf/libc.so* engine-sdk/lib/arm-linux-gnueabihf/ -cp -d $SYSROOT/usr/lib/arm-linux-gnueabihf/libc.so* engine-sdk/usr/lib/arm-linux-gnueabihf/ - -# -# Strip Components +# /lib # -export CLANG_BIN_PATH=../../flutter/buildtools/linux-x64/clang/bin -mkdir -p .debug -for file in $(pwd)/engine-sdk/bin/clang_x64/*; do - if [ -f "$file" ]; then - $CLANG_BIN_PATH/llvm-strip --only-keep-debug -o $file.debug $file - $CLANG_BIN_PATH/llvm-strip $file - fi -done -mv $(pwd)/engine-sdk/bin/clang_x64/*.debug $(pwd)/.debug/ -for file in $(pwd)/engine-sdk/lib/*; do - if [ -f "$file" ]; then - $CLANG_BIN_PATH/llvm-strip --only-keep-debug -o $file.debug $file - $CLANG_BIN_PATH/llvm-strip $file - fi +cd so.unstripped +for file in *; do + cp "../$file" $cwd/engine-sdk/lib/ done -mv $(pwd)/engine-sdk/lib/*.debug $(pwd)/.debug/ +cd $cwd popd diff --git a/scripts/prepare-sdk-x86-64.sh b/scripts/prepare-sdk-x86-64.sh index d57f484..ade3c83 100755 --- a/scripts/prepare-sdk-x86-64.sh +++ b/scripts/prepare-sdk-x86-64.sh @@ -4,85 +4,59 @@ pushd $1 SYSROOT=$2 -mkdir -p engine-sdk/{data,bin,lib64,lib/x86_64-linux-gnu,usr/lib/x86_64-linux-gnu,usr/include,sdk/lib} +mkdir -p engine-sdk/{bin,include,lib,data,clang_x64/bin,clang_x64/lib64} # -# /data +# Include # -cp icudtl.dat engine-sdk/data/ +cp flutter_embedder.h engine-sdk/include/ # -# Include +# /data # -cp flutter_embedder.h engine-sdk/usr/include/ +cp icudtl.dat engine-sdk/data/ # # SDK # cp -r flutter_patched_sdk engine-sdk/sdk/ if [ -e shader_lib ]; then - cp -r shader_lib engine-sdk/sdk/lib + cp -r shader_lib engine-sdk/ fi -# -# /bin -# -cp exe.unstripped/* engine-sdk/bin/ +export cwd=$(pwd) # -# /lib +# host - x64 # -export cwd=$(pwd) -cd so.unstripped +cd clang_x64/exe.unstripped for file in *; do - cp "$file" $cwd/engine-sdk/lib/ - cp "../$file.TOC" $cwd/engine-sdk/sdk/lib/ + cp "../$file" $cwd/engine-sdk/clang_x64/bin/ + + # Copy each library with its parent directories to the target directory + for library in $(ldd "$file" | cut -d '>' -f 2 | awk '{print $1}') + do + [ -f "${library}" ] && cp --verbose --parents "${library}" "$cwd/engine-sdk/clang_x64/" + done done cd $cwd # -# /lib64 -# -cp $SYSROOT/lib64/ld-linux-x86-64.so* engine-sdk/lib64/ - -# -# /usr/lib/$ARCH-linux-gnu +# /bin # -cp $SYSROOT/lib/x86_64-linux-gnu/libdl-* engine-sdk/lib/x86_64-linux-gnu/ -cp $SYSROOT/usr/lib/x86_64-linux-gnu/libdl.so* engine-sdk/usr/lib/x86_64-linux-gnu/ -cp -d $SYSROOT/lib/x86_64-linux-gnu/libdl.so* engine-sdk/lib/x86_64-linux-gnu/ -cp -d $SYSROOT/usr/lib/x86_64-linux-gnu/libdl-* engine-sdk/usr/lib/x86_64-linux-gnu/ -cp $SYSROOT/lib/x86_64-linux-gnu/libpthread-* engine-sdk/lib/x86_64-linux-gnu/ -cp $SYSROOT/usr/lib/x86_64-linux-gnu/libpthread-* engine-sdk/usr/lib/x86_64-linux-gnu/ -cp -d $SYSROOT/lib/x86_64-linux-gnu/libpthread.so* engine-sdk/lib/x86_64-linux-gnu/ -cp -d $SYSROOT/usr/lib/x86_64-linux-gnu/libpthread.so* engine-sdk/usr/lib/x86_64-linux-gnu/ -cp $SYSROOT/lib/x86_64-linux-gnu/libm-* engine-sdk/lib/x86_64-linux-gnu/ -cp $SYSROOT/usr/lib/x86_64-linux-gnu/libm-* engine-sdk/usr/lib/x86_64-linux-gnu/ -cp -d $SYSROOT/lib/x86_64-linux-gnu/libm.so* engine-sdk/lib/x86_64-linux-gnu/ -cp -d $SYSROOT/usr/lib/x86_64-linux-gnu/libm.so* engine-sdk/usr/lib/x86_64-linux-gnu/ -cp $SYSROOT/lib/x86_64-linux-gnu/libc-* engine-sdk/lib/x86_64-linux-gnu/ -cp $SYSROOT/usr/lib/x86_64-linux-gnu/libc-* engine-sdk/usr/lib/x86_64-linux-gnu/ -cp -d $SYSROOT/lib/x86_64-linux-gnu/libc.so* engine-sdk/lib/x86_64-linux-gnu/ -cp -d $SYSROOT/usr/lib/x86_64-linux-gnu/libc.so* engine-sdk/usr/lib/x86_64-linux-gnu/ +cd exe.unstripped +for file in *; do + cp "../$file" $cwd/engine-sdk/bin/ +done +cd $cwd # -# Strip Components +# /lib # -export CLANG_BIN_PATH=../../flutter/buildtools/linux-x64/clang/bin -mkdir -p .debug -for file in $(pwd)/engine-sdk/bin/*; do - if [ -f "$file" ]; then - $CLANG_BIN_PATH/llvm-strip --only-keep-debug -o $file.debug $file - $CLANG_BIN_PATH/llvm-strip $file - fi -done -mv $(pwd)/engine-sdk/bin/*.debug $(pwd)/.debug/ -for file in $(pwd)/engine-sdk/lib/*; do - if [ -f "$file" ]; then - $CLANG_BIN_PATH/llvm-strip --only-keep-debug -o $file.debug $file - $CLANG_BIN_PATH/llvm-strip $file - fi +cd so.unstripped +for file in *; do + cp "../$file" $cwd/engine-sdk/lib/ done -mv $(pwd)/engine-sdk/lib/*.debug $(pwd)/.debug/ +cd $cwd popd