GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — build: support android build on ndk version equal or above 23 · nodejs/node@e655869

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • android-configure
  • common.gypi
  • deps
    • cares/config/android
      • ares_config.h
    • openssl
      • openssl-cl_no_asm.gypi
      • openssl_no_asm.gypi
    • uv
      • uv.gyp
  • tools
    • gyp/pylib/gyp/generator
      • make.py
    • v8_gypfiles
      • v8.gyp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎android-configure‎

Copy file name to clipboardExpand all lines: android-configure
+42-36Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,72 +8,78 @@
88
# modules with npm. Also, don't forget to set the arch in npm config using
99
# 'npm config set arch=<arch>'
1010

11+
if [ $# -ne 3 ]; then
12+
echo "$0 should have 3 parameters: ndk_path, target_arch and sdk_version"
13+
exit 1
14+
fi
15+
16+
NDK_PATH=$1
17+
ARCH="$2"
18+
ANDROID_SDK_VERSION=$3
1119

12-
if [ -z "$2" ]; then
13-
ARCH=arm
14-
else
15-
ARCH="$2"
20+
if [ $ANDROID_SDK_VERSION -lt 23 ]; then
21+
echo "$ANDROID_SDK_VERSION should equal or later than 23(Android 6.0)"
1622
fi
1723

1824
CC_VER="4.9"
25+
1926
case $ARCH in
2027
arm)
21-
DEST_CPU="$ARCH"
22-
SUFFIX="$ARCH-linux-androideabi"
23-
TOOLCHAIN_NAME="$SUFFIX"
28+
DEST_CPU="arm"
29+
TOOLCHAIN_NAME="armv7-linux-androideabi"
2430
;;
2531
x86)
2632
DEST_CPU="ia32"
27-
SUFFIX="i686-linux-android"
28-
TOOLCHAIN_NAME="$ARCH"
33+
TOOLCHAIN_NAME="i686-linux-android"
2934
;;
3035
x86_64)
31-
DEST_CPU="ia32"
32-
SUFFIX="$ARCH-linux-android"
33-
TOOLCHAIN_NAME="$ARCH"
36+
DEST_CPU="x64"
37+
TOOLCHAIN_NAME="x86_64-linux-android"
38+
ARCH="x64"
39+
;;
40+
arm64|aarch64)
41+
DEST_CPU="arm64"
42+
TOOLCHAIN_NAME="aarch64-linux-android"
43+
ARCH="arm64"
3444
;;
3545
*)
3646
echo "Unsupported architecture provided: $ARCH"
3747
exit 1
3848
;;
3949
esac
4050

41-
NDK_PATH=$1
42-
function make_toolchain {
43-
$NDK_PATH/build/tools/make-standalone-toolchain.sh \
44-
--toolchain=$TOOLCHAIN_NAME-$CC_VER \
45-
--arch=$ARCH \
46-
--install-dir=$TOOLCHAIN \
47-
--platform=android-21
48-
}
51+
HOST_OS="linux"
52+
HOST_ARCH="x86_64"
53+
export CC_host=$(which gcc)
54+
export CXX_host=$(which g++)
4955

50-
export TOOLCHAIN=$PWD/android-toolchain
51-
if [ -d "$TOOLCHAIN" ]; then
52-
read -r -p "NDK toolchain already exists. Replace it? [y/N]" response
53-
case "$response" in
54-
[Yy])
55-
rm -rf "$TOOLCHAIN"
56-
make_toolchain
57-
esac
58-
else
59-
make_toolchain
56+
host_gcc_version=$($CC_host --version | grep gcc | awk '{print $NF}')
57+
major=$(echo $host_gcc_version | awk -F . '{print $1}')
58+
minor=$(echo $host_gcc_version | awk -F . '{print $2}')
59+
if [ -z $major ] || [ -z $minor ] || [ $major -lt 6 ] || [ $major -eq 6 -a $minor -lt 3 ]; then
60+
echo "host gcc $host_gcc_version is too old, need gcc 6.3.0"
61+
exit 1
6062
fi
63+
64+
SUFFIX="$TOOLCHAIN_NAME$ANDROID_SDK_VERSION"
65+
TOOLCHAIN=$NDK_PATH/toolchains/llvm/prebuilt/$HOST_OS-$HOST_ARCH
66+
6167
export PATH=$TOOLCHAIN/bin:$PATH
62-
export AR=$TOOLCHAIN/bin/$SUFFIX-ar
63-
export CC=$TOOLCHAIN/bin/$SUFFIX-gcc
64-
export CXX=$TOOLCHAIN/bin/$SUFFIX-g++
65-
export LINK=$TOOLCHAIN/bin/$SUFFIX-g++
68+
export CC=$TOOLCHAIN/bin/$SUFFIX-clang
69+
export CXX=$TOOLCHAIN/bin/$SUFFIX-clang++
70+
6671

6772
GYP_DEFINES="target_arch=$ARCH"
6873
GYP_DEFINES+=" v8_target_arch=$ARCH"
6974
GYP_DEFINES+=" android_target_arch=$ARCH"
70-
GYP_DEFINES+=" host_os=linux OS=android"
75+
GYP_DEFINES+=" host_os=$HOST_OS OS=android"
7176
export GYP_DEFINES
7277

7378
if [ -f "configure" ]; then
7479
./configure \
7580
--dest-cpu=$DEST_CPU \
7681
--dest-os=android \
7782
--without-snapshot \
78-
--openssl-no-asm
83+
--openssl-no-asm \
84+
--cross-compiling
7985
fi
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@
442442
'defines': [ '_GLIBCXX_USE_C99_MATH' ],
443443
'libraries': [ '-llog' ],
444444
}],
445+
['_toolset=="host"', {
446+
'cflags': [ '-pthread' ],
447+
'ldflags': [ '-pthread' ],
448+
}],
445449
],
446450
}],
447451
['OS=="mac"', {
Collapse file

‎deps/cares/config/android/ares_config.h‎

Copy file name to clipboardExpand all lines: deps/cares/config/android/ares_config.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
#define HAVE_GETNAMEINFO 1
129129

130130
/* Define to 1 if you have the getservbyport_r function. */
131-
#define HAVE_GETSERVBYPORT_R 1
131+
/* #undef HAVE_GETSERVBYPORT_R */
132132

133133
/* Define to 1 if you have the `gettimeofday' function. */
134134
#define HAVE_GETTIMEOFDAY 1
Collapse file

‎deps/openssl/openssl-cl_no_asm.gypi‎

Copy file name to clipboardExpand all lines: deps/openssl/openssl-cl_no_asm.gypi
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
'includes': ['config/archs/linux-ppc64/no-asm/openssl-cl.gypi'],
1313
}, 'target_arch=="s390x" and OS=="linux"', {
1414
'includes': ['config/archs/linux64-s390x/no-asm/openssl-cl.gypi'],
15-
}, 'target_arch=="arm" and OS=="linux"', {
15+
}, 'target_arch=="arm" and OS in ("linux", "android")', {
1616
'includes': ['config/archs/linux-armv4/no-asm/openssl-cl.gypi'],
17-
}, 'target_arch=="arm64" and OS=="linux"', {
17+
}, 'target_arch=="arm64" and OS in ("linux", "android")', {
1818
'includes': ['config/archs/linux-aarch64/no-asm/openssl-cl.gypi'],
1919
}, 'target_arch=="arm64" and OS=="win"', {
2020
'includes': ['config/archs/VC-WIN64-ARM/no-asm/openssl-cl.gypi'],
Collapse file

‎deps/openssl/openssl_no_asm.gypi‎

Copy file name to clipboardExpand all lines: deps/openssl/openssl_no_asm.gypi
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
'includes': ['config/archs/linux-ppc64/no-asm/openssl.gypi'],
1414
}, 'target_arch=="s390x" and OS=="linux"', {
1515
'includes': ['config/archs/linux64-s390x/no-asm/openssl.gypi'],
16-
}, 'target_arch=="arm" and OS=="linux"', {
16+
}, 'target_arch=="arm" and OS in ("linux", "android")', {
1717
'includes': ['config/archs/linux-armv4/no-asm/openssl.gypi'],
18-
}, 'target_arch=="arm64" and OS=="linux"', {
18+
}, 'target_arch=="arm64" and OS in ("linux", "android")', {
1919
'includes': ['config/archs/linux-aarch64/no-asm/openssl.gypi'],
2020
}, 'target_arch=="ia32" and OS=="freebsd"', {
2121
'includes': ['config/archs/BSD-x86/no-asm/openssl.gypi'],
Collapse file

‎deps/uv/uv.gyp‎

Copy file name to clipboardExpand all lines: deps/uv/uv.gyp
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
'src/unix/android-ifaddrs.c',
262262
'src/unix/procfs-exepath.c',
263263
'src/unix/random-getrandom.c',
264+
'src/unix/random-getentropy.c',
264265
'src/unix/random-sysctl-linux.c',
265266
'src/unix/sysinfo-loadavg.c',
266267
],
Collapse file

‎tools/gyp/pylib/gyp/generator/make.py‎

Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/make.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def CalculateGeneratorInputInfo(params):
201201
quiet_cmd_link = LINK($(TOOLSET)) $@
202202
quiet_cmd_link_host = LINK($(TOOLSET)) $@
203203
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
204-
cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
204+
cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
205205
206206
# Other shared-object link notes:
207207
# - Set SONAME to the library filename so our binaries don't reference
Collapse file

‎tools/v8_gypfiles/v8.gyp‎

Copy file name to clipboardExpand all lines: tools/v8_gypfiles/v8.gyp
+17-27Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -956,41 +956,31 @@
956956
}],
957957
['is_android', {
958958
'sources': [
959-
'<(V8_ROOT)/src/base/debug/stack_trace_android.cc',
960959
'<(V8_ROOT)/src/base/platform/platform-posix.cc',
961960
'<(V8_ROOT)/src/base/platform/platform-posix.h',
962961
'<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
963962
'<(V8_ROOT)/src/base/platform/platform-posix-time.h',
964963
],
965-
'conditions': [
966-
['_toolset=="host"', {
967-
'link_settings': {
964+
'link_settings': {
965+
'target_conditions': [
966+
['_toolset=="host" and host_os=="linux"', {
968967
'libraries': [
969968
'-ldl',
970969
'-lrt'
971-
]
972-
},
973-
'conditions': [
974-
['_toolset=="host"', {
975-
'conditions': [
976-
['host_os == "mac"', {
977-
'sources': [
978-
'<(V8_ROOT)/src/base/debug/stack_trace_posix.cc'
979-
'<(V8_ROOT)/src/base/platform/platform-macos.cc'
980-
]
981-
}, {
982-
'sources': [
983-
'<(V8_ROOT)/src/base/debug/stack_trace_posix.cc'
984-
'<(V8_ROOT)/src/base/platform/platform-linux.cc'
985-
]
986-
}],
987-
],
988-
}, {
989-
'sources': [
990-
'<(V8_ROOT)/src/base/debug/stack_trace_android.cc'
991-
'<(V8_ROOT)/src/base/platform/platform-linux.cc'
992-
]
993-
}],
970+
],
971+
}],
972+
],
973+
},
974+
'target_conditions': [
975+
['_toolset=="host"', {
976+
'sources': [
977+
'<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
978+
'<(V8_ROOT)/src/base/platform/platform-linux.cc',
979+
],
980+
}, {
981+
'sources': [
982+
'<(V8_ROOT)/src/base/debug/stack_trace_android.cc',
983+
'<(V8_ROOT)/src/base/platform/platform-linux.cc',
994984
],
995985
}],
996986
],

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.