summaryrefslogtreecommitdiff
path: root/prebuilts_build-tools-aarch64-host.patch
blob: cd6aaa7d98467e4be439598e7af6b9bb17a50256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
diff --git a/build-prebuilts.sh b/build-prebuilts.sh
index e39f6bd..917c546 100755
--- a/build-prebuilts.sh
+++ b/build-prebuilts.sh
@@ -20,6 +20,23 @@ Darwin)
     ;;
 esac
 
+ARCH="$(uname -m)"
+case "$ARCH" in
+x86_64)
+    ARCHDIR=x86
+    SECONDARY=x86
+    ;;
+aarch64)
+    ARCH=arm64
+    ARCHDIR=arm64
+    SECONDARY=arm
+    ;;
+*)
+    ARCHDIR=$ARCH
+    SECONDARY=""
+    ;;
+esac
+
 build_soong=1
 if [ -d ${TOP}/toolchain/go ]; then
     build_go=1
@@ -28,14 +45,20 @@ fi
 if [ -n ${build_soong} ]; then
     # ckati and makeparallel (Soong)
     SOONG_OUT=${OUT_DIR}/soong
-    SOONG_HOST_OUT=${OUT_DIR}/soong/host/${OS}-x86
+    SOONG_HOST_OUT=${OUT_DIR}/soong/host/${OS}-${ARCHDIR}
     rm -rf ${SOONG_OUT}
     mkdir -p ${SOONG_OUT}
     cat > ${SOONG_OUT}/soong.variables << EOF
 {
     "Allow_missing_dependencies": true,
-    "HostArch":"x86_64",
-    "HostSecondaryArch":"x86"
+    "HostArch":"${ARCH}",
+EOF
+    if [ -n "${SECONDARY}" ]; then
+        cat >> ${SOONG_OUT}/soong.variables << EOF
+    "HostSecondaryArch":"${SECONDARY}"
+EOF
+    fi
+    cat >> ${SOONG_OUT}/soong.variables << EOF
 }
 EOF
     BUILDDIR=${SOONG_OUT} ./bootstrap.bash
@@ -53,8 +76,14 @@ EOF
         cat > ${SOONG_OUT}/soong.variables << EOF
 {
     "Allow_missing_dependencies": true,
-    "HostArch":"x86_64",
-    "HostSecondaryArch":"x86",
+    "HostArch":"${ARCH}",
+EOF
+        if [ -n "${SECONDARY}" ]; then
+            cat > ${SOONG_OUT}/soong.variables << EOF
+    "HostSecondaryArch":"${SECONDARY}",
+EOF
+        fi
+        cat > ${SOONG_OUT}/soong.variables << EOF
     "SanitizeHost": ["address"]
 }
 EOF
@@ -80,8 +109,8 @@ if [ -n ${build_go} ]; then
     cp -a ${TOP}/toolchain/go/* ${GO_OUT}/
     (
         cd ${GO_OUT}/src
-        export GOROOT_BOOTSTRAP=${TOP}/prebuilts/go/${OS}-x86
-        export GOROOT_FINAL=./prebuilts/go/${OS}-x86
+        export GOROOT_BOOTSTRAP=${TOP}/prebuilts/go/${OS}-${ARCHDIR}
+        export GOROOT_FINAL=./prebuilts/go/${OS}-${ARCHDIR}
         export GO_TEST_TIMEOUT_SCALE=100
         ./make.bash
         rm -rf ../pkg/bootstrap
Binary files /dev/null and build-tools/linux-arm64/bin/acp differ
Binary files /dev/null and build-tools/linux-arm64/bin/bpfmt differ
Binary files /dev/null and build-tools/linux-arm64/bin/ckati differ
Binary files /dev/null and build-tools/linux-arm64/bin/ckati_stamp_dump differ
Binary files /dev/null and build-tools/linux-arm64/bin/ijar differ
Binary files /dev/null and build-tools/linux-arm64/bin/makeparallel differ
Binary files /dev/null and build-tools/linux-arm64/bin/ninja differ
Binary files /dev/null and build-tools/linux-arm64/bin/ziptime differ