curl static executable binary for Android

my link command

prebuilts/misc/linux-x86/ccache/ccache prebuilts/clang/host/linux-x86/clang-2690385/bin/clang++ -nostdlib -Bstatic -static -Wl,--gc-secti
ons -o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/LINKED/curl -Lout/target/product/tcthz6750_66m5_n1/obj/lib out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/libcurl
_intermediates/lib/*.o out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/libcurl_intermediates/libcurl.a out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/libssl_static_intermediates/libss
l_static.a out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/liblog_intermediates/*.o out/target/product/tcthz6750_66m5_n1/obj/lib/crtbegin_static.o -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -W
l,--build-id=md5 -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,-maarch64linux -Wl,--hash-style=gnu -Wl,--fix-cortex-a53-843419 -fuse-ld=gold -Wl,--icf=safe -Wl,--no-undefined-version -Wl,--allow-shli
b-undefined -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin -Wl,--no-undefined out/target/product/tcthz6750_66m5_n1/obj
/EXECUTABLES/curl_intermediates/src/slist_wc.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_binmode.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermed
iates/src/tool_bname.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_cb_dbg.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_cb_hdr.o o
ut/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_cb_prg.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_cb_rea.o out/target/product/tcthz6
750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_cb_see.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_cb_wrt.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTAB
LES/curl_intermediates/src/tool_cfgable.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_convert.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates
/src/tool_dirhie.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_doswin.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_easysrc.o out/
target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_formparse.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_getparam.o out/target/product/tcth
z6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_getpass.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_help.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTA
BLES/curl_intermediates/src/tool_helpers.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_homedir.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediate
s/src/tool_hugehelp.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_libinfo.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_main.o out
/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_metalink.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_mfiles.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_msgs.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_operate.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABL
ES/curl_intermediates/src/tool_operhlp.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_panykey.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/
src/tool_paramhlp.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_parsecfg.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_strdup.o ou
t/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_setopt.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_sleep.o out/target/product/tcthz675
0_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_urlglob.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_util.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES
/curl_intermediates/src/tool_vms.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_writeenv.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/t
ool_writeout.o out/target/product/tcthz6750_66m5_n1/obj/EXECUTABLES/curl_intermediates/src/tool_xattr.o -Wl,--whole-archive -Wl,--no-whole-archive out/target/product/tcthz6750_66m5_n1/obj/STATIC
_LIBRARIES/libcrypto_static_intermediates/libcrypto_static.a out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/libssl_static_intermediates/libssl_static.a out/target/product/tcthz6750_66m5_n1/obj/
STATIC_LIBRARIES/libz_intermediates/libz.a out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/libc++_static_intermediates/libc++_static.a out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/l
ibm_intermediates/libm.a out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/libdl_intermediates/libdl.a out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/libcompiler_rt-extras_intermediates
/libcompiler_rt-extras.a -Wl,--start-group out/target/product/tcthz6750_66m5_n1/obj/STATIC_LIBRARIES/libc_intermediates/libc.a prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/../lib/gcc/
aarch64-linux-android/4.9/../../../../aarch64-linux-android/lib/../lib64/libatomic.a prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/../lib/gcc/aarch64-linux-android/4.9/libgcc.a -Wl,--end
-group out/target/product/tcthz6750_66m5_n1/obj/lib/crtend_android.o

 

my diff on Android.mk

repos/external/curl$ git diff
diff --git a/Android.mk b/Android.mk
index 691baf4..983de64 100644
--- a/Android.mk
+++ b/Android.mk
@@ -83,7 +83,8 @@ LOCAL_SRC_FILES := $(addprefix src/,$(CURL_CFILES))
LOCAL_MODULE := curl
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_LIBRARIES := libcurl
-LOCAL_SHARED_LIBRARIES := libcrypto libssl libz
+LOCAL_STATIC_LIBRARIES := libcrypto_static libssl_static libz
+LOCAL_FORCE_STATIC_EXECUTABLE := true

built from AOSP

download here https://drive.google.com/file/d/1bpUnhaJynDN9xkb0B4vPSkG_9AP0n_dP/view?usp=sharing

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com 標誌

您的留言將使用 WordPress.com 帳號。 登出 /  變更 )

Google photo

您的留言將使用 Google 帳號。 登出 /  變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 /  變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 /  變更 )

連結到 %s