Skip to content

Commit 020c152

Browse files
committed
Minor bug fixes for Android 7.
1 parent 4a2739d commit 020c152

File tree

1 file changed

+89
-29
lines changed

1 file changed

+89
-29
lines changed

docker/android-system.sh

Lines changed: 89 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,7 @@ main() {
4040
td="$(mktemp -d)"
4141
pushd "${td}"
4242

43-
# fake java and javac, it is not necessary for what we build, but the build
44-
# script asks for it
45-
cat << EOF > /usr/bin/java
46-
#!/usr/bin/env bash
47-
echo "java version \"1.7.0\""
48-
echo "OpenJDK Runtime Environment (IcedTea 2.6.9)"
49-
echo "OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)"
50-
EOF
51-
52-
cat << EOF > /usr/bin/javac
53-
#!/usr/bin/env bash
54-
echo "javac 1.7.0"
55-
EOF
56-
57-
chmod +x /usr/bin/java
58-
chmod +x /usr/bin/javac
59-
60-
# more faking
61-
export ANDROID_JAVA_HOME=/tmp
62-
mkdir /tmp/lib/
63-
touch /tmp/lib/tools.jar
43+
fake_java "${major_version}"
6444

6545
install_packages ca-certificates \
6646
curl \
@@ -98,10 +78,9 @@ EOF
9878
6)
9979
android_repo_v6 "${arch}"
10080
;;
101-
# 7)
102-
# #android_repo_v7 "${arch}"
103-
# # TODO(ahuszagh) Here.
104-
# ;;
81+
7)
82+
android_repo_v7 "${arch}"
83+
;;
10584
# 8)
10685
# #android_repo_v8 "${arch}"
10786
# # TODO(ahuszagh) Here.
@@ -143,6 +122,44 @@ EOF
143122
rm "${0}"
144123
}
145124

125+
fake_java() {
126+
local major_version="${1}"
127+
local java_version=
128+
local icedtea_version=
129+
case "${major_version}" in
130+
5|6)
131+
java_version=1.7.0
132+
icedtea_version=2.6.9
133+
;;
134+
*)
135+
java_version=1.8.0
136+
icedtea_version=2.6.9
137+
;;
138+
esac
139+
140+
# fake java and javac, it is not necessary for what we build, but the build
141+
# script asks for it
142+
cat << EOF > /usr/bin/java
143+
#!/usr/bin/env bash
144+
echo "java version \"${java_version}\""
145+
echo "OpenJDK Runtime Environment (IcedTea ${icedtea_version})"
146+
echo "OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)"
147+
EOF
148+
149+
cat << EOF > /usr/bin/javac
150+
#!/usr/bin/env bash
151+
echo "javac ${java_version}"
152+
EOF
153+
154+
chmod +x /usr/bin/java
155+
chmod +x /usr/bin/javac
156+
157+
# more faking
158+
export ANDROID_JAVA_HOME=/tmp
159+
mkdir /tmp/lib/
160+
touch /tmp/lib/tools.jar
161+
}
162+
146163
build_android() {
147164
local arch="${1}"
148165
local major_version="${2}"
@@ -282,16 +299,59 @@ android_repo_v6() {
282299
rm bionic/tools/relocation_packer/Android.mk
283300
}
284301

285-
# TODO
302+
# TODO: tested on 7.0.0_r36 (SDK 24)
303+
# TODO: tested on 7.1.2_r39 (SDK 25)
286304
android_repo_v7() {
287305
# TODO(ahuszagh) This is the first one using the soong build system
288306
local arch="${1}"
289307

290308
sync bionic
291309
sync build
292-
sync prebuilts/clang/linux-x86/host/3.6
293-
# TODO(ahuszagh) Here...
294-
# TODO(ahuszagh) Having issues rn with using git directly.
310+
sync build/kati
311+
sync external/compiler-rt
312+
sync external/elfutils
313+
sync external/jemalloc
314+
sync external/libcxx
315+
sync external/libcxxabi
316+
sync external/libunwind
317+
sync external/libunwind_llvm
318+
sync external/llvm
319+
sync external/mksh
320+
sync external/zlib
321+
sync prebuilts/clang/host/linux-x86
322+
sync prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
323+
sync prebuilts/ninja/linux-x86
324+
sync system/core
325+
326+
case "${arch}" in
327+
arm)
328+
sync prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9
329+
;;
330+
arm64)
331+
sync prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9
332+
sync prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
333+
;;
334+
x86)
335+
sync prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
336+
;;
337+
x86_64)
338+
sync prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
339+
;;
340+
esac
341+
342+
# avoid build tests
343+
rm bionic/linker/tests/Android.mk
344+
rm bionic/tests/Android.mk
345+
rm bionic/benchmarks/Android.mk
346+
# we don't need the relocation packer, and removing
347+
# the unittests from it is a bit of work.
348+
rm bionic/tools/relocation_packer/Android.mk
349+
350+
python3 /remove_soong_tests.py
351+
352+
# FIXME: 7.0.0 Currently failing with:
353+
# ninja: error: 'out/target/product/generic_arm64/obj/STATIC_LIBRARIES/libgtest_main_intermediates/export_includes', needed by 'out/target/product/generic_arm64/obj/EXECUTABLES/malloc_debug_unit_tests_intermediates/import_includes', missing and no known rule to make it
354+
# make: *** [build/core/ninja.mk:149: ninja_wrapper] Error 1
295355
}
296356

297357
# tested on 9.0.0_r1 (SDK 28)

0 commit comments

Comments
 (0)