aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-02-07 22:48:22 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-02-07 22:48:22 +0000
commit674dacb61ed7ec74e882b6413316e027b279a2c7 (patch)
tree4ac21c4350bceb286c1b8b66d1bb05fd3c6bc2f4
parenta82c310af3601e5970845a9deac679e2790569b9 (diff)
parent97598f1763810e446ff21ec60fb0b222097b32c6 (diff)
downloadcurl-674dacb61ed7ec74e882b6413316e027b279a2c7.tar.gz
Merge "androidconfigure: update for clang." into main am: 97598f1763
Original change: https://android-review.googlesource.com/c/platform/external/curl/+/2954232 Change-Id: I77a0df32ec9ff5bdae057294ea851bb5e268ab6d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rwxr-xr-xandroidconfigure46
1 files changed, 24 insertions, 22 deletions
diff --git a/androidconfigure b/androidconfigure
index e8e15f548..91c1456c6 100755
--- a/androidconfigure
+++ b/androidconfigure
@@ -9,41 +9,44 @@ if [[ "${TARGET_PRODUCT}" != "aosp_arm" ]]; then
exit 1
fi
+T="${ANDROID_BUILD_TOP}"
cd $(dirname "$0")
+# Build all the dependencies we'll need, so we can find them under
+# /system/lib in the out directory.
+source ${T}/build/envsetup.sh
+mm
+
HOST="arm-linux-androideabi"
-T="${ANDROID_BUILD_TOP}"
CLANG_VERSION="$(exec ${T}/build/soong/scripts/get_clang_version.py)"
export CC="${T}/prebuilts/clang/host/linux-x86/${CLANG_VERSION}/bin/clang"
export LD="${T}/prebuilts/clang/host/linux-x86/${CLANG_VERSION}/bin/lld"
CFLAGS=(
- "-isystem ${T}/external/libcxx/include"
- "-isystem ${T}/bionic/libc/include/"
- "-isystem ${T}/bionic/libc/arch-arm/include"
- "-isystem ${T}/bionic/libc/kernel/uapi/"
- "-isystem ${T}/bionic/libc/kernel/android/uapi/"
- "-isystem ${T}/bionic/libm/include"
- "-fno-exceptions"
- "-ffunction-sections"
- "-fdata-sections"
- "-fstack-protector"
- "-fno-short-enums"
- "-no-canonical-prefixes"
- "-fmessage-length=0"
- "-fomit-frame-pointer"
- "-fPIC"
- "-fno-strict-aliasing"
- "-nostdlib"
+ # We don't have an NDK sysroot prebuilt in AOSP, so we'll have use
+ # soong's.
+ "--sysroot ${T}/out/soong/ndk/sysroot/"
+ # We also need zlib. (We don't have to do anything for boringssl here,
+ # because we provide that path directly on the configure command line.)
+ "-I${T}/external/zlib/"
+ # We don't have target-specific clang binaries like the NDK, so provide
+ # a target. The "34" here is arbitrary.
+ "--target=armv7a-linux-androideabi34"
)
CFLAGS="${CFLAGS[@]}"
+LDFLAGS=(
+ # We need the device zlib and openssl/boringssl libraries, so tell ld
+ # where they are.
+ "-L${ANDROID_PRODUCT_OUT}/system/lib/"
+)
+LDFLAGS="${LDFLAGS[@]}"
+
CONFIGURE_ARGS=(
--host="${HOST}"
CFLAGS="${CFLAGS}"
- LIBS="-lc"
- CPPFLAGS="${CFLAGS} -I${T}/external/zlib/src"
- LDFLAGS="-L${ANDROID_PRODUCT_OUT}/system/lib/"
+ CPPFLAGS="${CFLAGS}"
+ LDFLAGS="${LDFLAGS}"
# Disable NTLM delegation to winbind's ntlm_auth.
--disable-ntlm-wb
@@ -72,7 +75,6 @@ CONFIGURE_ARGS=(
# Disable DICT support (RFC 2229).
--disable-dict
-
### Enable HTTP and FILE explicitly. These are enabled by default but
# listed here as documentation.
--enable-http