diff options
author | Colin Cross <ccross@android.com> | 2022-06-27 18:37:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-06-27 18:37:07 +0000 |
commit | 60a3074d3efb2145ce0db1589e9847b6b4becd0e (patch) | |
tree | 94d7f3558089e898995491a97bcb0bdf8b4277d4 | |
parent | 726120a5ae386597b8b8b1f79c30c25ff1c5f9de (diff) | |
parent | 5ceabef1b05ae841b245910f025ac03d9ce8de69 (diff) | |
download | build-tools-60a3074d3efb2145ce0db1589e9847b6b4becd0e.tar.gz |
Merge "Build arm and arm64 sysroots when building for musl"
-rwxr-xr-x | build-prebuilts.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/build-prebuilts.sh b/build-prebuilts.sh index df68ced6..752c3395 100755 --- a/build-prebuilts.sh +++ b/build-prebuilts.sh @@ -54,6 +54,16 @@ if [[ ${OS} = linux ]]; then secondary_arch="\"HostSecondaryArch\":\"x86\"," fi +cross_compile="" +if [[ ${use_musl} = "true" ]]; then + cross_compile=$(cat <<EOF + "CrossHost": "linux_musl", + "CrossHostArch": "arm64", + "CrossHostSecondaryArch": "arm", +EOF + ) +fi + # Use toybox and other prebuilts even outside of the build (test running, go, etc) export PATH=${TOP}/prebuilts/build-tools/path/${OS}-x86:$PATH @@ -68,6 +78,7 @@ if [ -n "${build_soong}" ]; then "Allow_missing_dependencies": true, "HostArch":"x86_64", ${secondary_arch} + ${cross_compile} "HostMusl": $use_musl, "VendorVars": { "cpython3": { @@ -157,10 +168,15 @@ EOF musl_sysroot32="" musl_sysroot64="" + musl_arm_sysroot="" + musl_arm64_sysroot="" if [[ ${use_musl} = "true" ]]; then binaries="${binaries} ${SOONG_MUSL_BINARIES[@]/#/${SOONG_HOST_OUT}/bin/}" musl_sysroot32="${SOONG_OUT}/.intermediates/external/musl/libc_musl_sysroot/linux_musl_x86/gen/libc_musl_sysroot.zip" musl_sysroot64="${SOONG_OUT}/.intermediates/external/musl/libc_musl_sysroot/linux_musl_x86_64/gen/libc_musl_sysroot.zip" + + musl_arm_sysroot="${SOONG_OUT}/.intermediates/external/musl/libc_musl_sysroot/linux_musl_arm/gen/libc_musl_sysroot.zip" + musl_arm64_sysroot="${SOONG_OUT}/.intermediates/external/musl/libc_musl_sysroot/linux_musl_arm64/gen/libc_musl_sysroot.zip" fi # Build everything @@ -171,6 +187,8 @@ EOF ${py3_stdlib_zip} \ ${musl_sysroot32} \ ${musl_sysroot64} \ + ${musl_arm_sysroot} \ + ${musl_arm64_sysroot} \ ${SOONG_HOST_OUT}/nativetest64/ninja_test/ninja_test \ ${SOONG_HOST_OUT}/nativetest64/ckati_test/find_test \ soong_docs @@ -202,6 +220,8 @@ EOF if [[ ${use_musl} = "true" ]]; then cp ${musl_sysroot64} ${SOONG_OUT}/musl-sysroot64.zip cp ${musl_sysroot32} ${SOONG_OUT}/musl-sysroot32.zip + cp ${musl_arm_sysroot} ${SOONG_OUT}/musl-sysroot-arm-linux-musleabihf.zip + cp ${musl_arm64_sysroot} ${SOONG_OUT}/musl-sysroot-aarch64-linux-musl.zip fi if [[ $OS == "linux" ]]; then @@ -289,6 +309,8 @@ if [ -n "${DIST_DIR}" ]; then if [ ${use_musl} = "true" ]; then cp ${SOONG_OUT}/musl-sysroot64.zip ${DIST_DIR}/ cp ${SOONG_OUT}/musl-sysroot32.zip ${DIST_DIR}/ + cp ${SOONG_OUT}/musl-sysroot-arm-linux-musleabihf.zip ${DIST_DIR}/ + cp ${SOONG_OUT}/musl-sysroot-aarch64-linux-musl.zip ${DIST_DIR}/ fi fi if [ -n "${build_go}" ]; then |