Skip to content

Commit f8b5242

Browse files
committed
Statically link C++ standard lib
1 parent fbd30c5 commit f8b5242

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

rebuild_native.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ build_arch() {
3838
local android_abi=$1
3939
local v8_arch=$2
4040
local ndk_arch=$3
41-
41+
# Set V8 library path for this architecture
42+
local v8_lib="v8.out/$v8_arch/libv8_monolith.a"
43+
4244
echo ""
4345
echo "Building for $android_abi ($v8_arch)..."
4446

@@ -85,6 +87,8 @@ build_arch() {
8587
local LDFLAGS="-shared -llog -s"
8688
LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=16384"
8789
LDFLAGS="$LDFLAGS -Wl,-z,common-page-size=16384"
90+
# Static link C++ standard library to avoid libc++_shared.so dependency
91+
LDFLAGS="$LDFLAGS -static-libstdc++"
8892

8993
# Output directly to src/main/jniLibs (replace existing files under version control)
9094
local OUTPUT="src/main/jniLibs/$android_abi/libj2v8.so"
802 KB
Binary file not shown.
467 KB
Binary file not shown.

src/main/jniLibs/x86/libj2v8.so

798 KB
Binary file not shown.

src/main/jniLibs/x86_64/libj2v8.so

844 KB
Binary file not shown.

0 commit comments

Comments
 (0)