Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 7f36c32

Browse files
committed
Stop building/updating Darwin clang-tools prebuilt
This prebuilt contains only the Bionic versioner, which is only used to version the Bionic headers, which are needed to cross-compile to Android. We don't support building the Android platform on Darwin, though, so these headers should be unnecessary. Bug: 333484421 Test: development/vndk/tools/header-checker/android/build-prebuilts.sh Test: development/vndk/tools/header-checker/android/update_clang-tools.sh Change-Id: Id341479c3fe4978021761fcc8dad76f5b2f68fe0
1 parent 1bcd000 commit 7f36c32

File tree

2 files changed

+14
-53
lines changed

2 files changed

+14
-53
lines changed

vndk/tools/header-checker/android/build-prebuilts.sh

Lines changed: 13 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
usage() {
1818
echo "Usage: $(basename "$0") [build_target]..."
1919
echo " Build all targets if build_target is not specified."
20-
echo " Supported build targets for macOS: ${MACOS_SOONG_BINARIES[*]}"
21-
echo " Supported build targets for Linux:" \
22-
"${LINUX_SOONG_BINARIES[@]}" "${LINUX_SOONG_TESTS[@]}"
20+
echo " Supported build targets:" \
21+
"${VALID_SOONG_BINARIES[@]}" "${VALID_SOONG_TESTS[@]}"
2322
}
2423

2524
in_array () {
@@ -31,7 +30,7 @@ in_array () {
3130
return 1
3231
}
3332

34-
LINUX_SOONG_BINARIES=(
33+
VALID_SOONG_BINARIES=(
3534
"bindgen"
3635
"cxx_extractor"
3736
"header-abi-linker"
@@ -43,14 +42,10 @@ LINUX_SOONG_BINARIES=(
4342
"versioner"
4443
)
4544

46-
LINUX_SOONG_TESTS=(
45+
VALID_SOONG_TESTS=(
4746
"header-checker-unittests"
4847
)
4948

50-
MACOS_SOONG_BINARIES=(
51-
"versioner"
52-
)
53-
5449
BUILD_TARGETS=()
5550

5651
while [ $# -gt 0 ]; do
@@ -70,29 +65,12 @@ set -ex
7065

7166
source "$(dirname "$0")/envsetup.sh"
7267

73-
UNAME="$(uname)"
74-
case "${UNAME}" in
75-
Linux)
76-
OS='linux'
77-
;;
78-
Darwin)
79-
OS='darwin'
80-
;;
81-
*)
82-
echo "error: Unknown uname: ${UNAME}"
68+
if [ "$(uname)" != "Linux" ]; then
69+
echo "error: Unsupported uname: $(uname)"
8370
exit 1
84-
;;
85-
esac
86-
87-
# Targets to be built
88-
if [ "${OS}" = "darwin" ]; then
89-
VALID_SOONG_BINARIES=("${MACOS_SOONG_BINARIES[@]}")
90-
VALID_SOONG_TESTS=()
91-
else
92-
VALID_SOONG_BINARIES=("${LINUX_SOONG_BINARIES[@]}")
93-
VALID_SOONG_TESTS=("${LINUX_SOONG_TESTS[@]}")
9471
fi
9572

73+
# Targets to be built
9674
SOONG_BINARIES=()
9775
SOONG_TESTS=()
9876

@@ -124,7 +102,7 @@ TOP=$(pwd)
124102

125103
# Setup Soong configuration
126104
SOONG_OUT="${OUT_DIR}/soong"
127-
SOONG_HOST_OUT="${OUT_DIR}/soong/host/${OS}-x86"
105+
SOONG_HOST_OUT="${OUT_DIR}/soong/host/linux-x86"
128106
rm -rf "${SOONG_OUT}"
129107
mkdir -p "${SOONG_OUT}"
130108
cat > "${SOONG_OUT}/soong.variables" << __EOF__
@@ -143,14 +121,9 @@ for name in "${SOONG_BINARIES[@]}"; do
143121
binaries+=("${SOONG_HOST_OUT}/bin/${name}")
144122
done
145123

146-
libs=()
147-
if [ "${OS}" = "darwin" ]; then
148-
libs+=("${SOONG_HOST_OUT}/lib64/libc++abi_host.dylib")
149-
fi
150-
151124
# Build binaries and shared libs
152125
build/soong/soong_ui.bash --make-mode --skip-config --soong-only \
153-
"${binaries[@]}" "${libs[@]}" "${SOONG_TESTS[@]}"
126+
"${binaries[@]}" "${SOONG_TESTS[@]}"
154127

155128
# Copy binaries and shared libs
156129
SOONG_DIST="${SOONG_OUT}/dist"
@@ -164,7 +137,7 @@ cp -R "${SOONG_HOST_OUT}/lib64" "${SOONG_DIST}"
164137
ln -s "lib64" "${SOONG_DIST}/lib"
165138

166139
# Copy clang header and share files
167-
CLANG_DIR="prebuilts/clang/host/${OS}-x86/${LLVM_PREBUILTS_VERSION}"
140+
CLANG_DIR="prebuilts/clang/host/linux-x86/${LLVM_PREBUILTS_VERSION}"
168141
CLANG_LIB_DIR="${CLANG_DIR}/lib/clang/${LLVM_RELEASE_VERSION}"
169142
CLANG_LIB_DIR_OUT="${SOONG_DIST}/lib/clang/${LLVM_RELEASE_VERSION}"
170143
mkdir -p "${CLANG_LIB_DIR_OUT}"
@@ -175,20 +148,9 @@ ln -s "lib/clang/${LLVM_RELEASE_VERSION}/include" "${SOONG_DIST}/clang-headers"
175148
# Normalize library file names. All library file names must match their soname.
176149
function extract_soname () {
177150
local file="$1"
178-
179-
case "${OS}" in
180-
linux)
181-
readelf -d "${file}" | \
182-
grep '(SONAME)\s*Library soname: \[.*\]$' -o | \
183-
sed 's/(SONAME)\s*Library soname: \[\(.*\)\]$/\1/g'
184-
;;
185-
darwin)
186-
local install_path="$(otool -D "${file}" | sed -n 2p)"
187-
if [ -n "${install_path}" ]; then
188-
basename "${install_path}"
189-
fi
190-
;;
191-
esac
151+
readelf -d "${file}" | \
152+
grep '(SONAME)\s*Library soname: \[.*\]$' -o | \
153+
sed 's/(SONAME)\s*Library soname: \[\(.*\)\]$/\1/g'
192154
}
193155

194156
for file in "${SOONG_OUT}/dist/lib"*"/"*; do

vndk/tools/header-checker/android/update_clang-tools.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ update_prebuilts () {
6666
commit () {
6767
cd "${CLANG_TOOLS_DIR}"
6868
echo "Update clang-tools to ab/${BUILD_ID}" > "/tmp/clang-tools-update.msg"
69-
git add manifest.xml linux-x86 darwin-x86
69+
git add manifest.xml linux-x86
7070
git commit -a -t "/tmp/clang-tools-update.msg"
7171
}
7272

@@ -76,5 +76,4 @@ repo start "update_${BUILD_ID}" .
7676

7777
update_manifest
7878
update_prebuilts "linux-x86" "linux"
79-
update_prebuilts "darwin-x86" "darwin_mac"
8079
commit

0 commit comments

Comments
 (0)