Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4ad7184

Browse filesBrowse files
robertchirasMyles Borins
authored andcommitted
build: add suport for x86 architecture
Modified android-configure script to support also x86 arch. Currently added support only for ia32 target arch. Also, compile openssl without asm, since using the asm sources will make node fail to run on Android, because it adds text relocations. Signed-off-by: Robert Chiras <robert.chiras@intel.com> PR-URL: #5544 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent c893cd3 commit 4ad7184
Copy full SHA for 4ad7184

File tree

Expand file treeCollapse file tree

2 files changed

+47
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+47
-8
lines changed
Open diff view settings
Collapse file

‎android-configure‎

Copy file name to clipboard
+39-8Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,49 @@
11
#!/bin/bash
22

3+
if [ -z "$2" ]; then
4+
ARCH=arm
5+
else
6+
ARCH="$2"
7+
fi
8+
9+
CC_VER="4.9"
10+
case $ARCH in
11+
arm)
12+
DEST_CPU="$ARCH"
13+
SUFFIX="$ARCH-linux-androideabi"
14+
TOOLCHAIN_NAME="$SUFFIX"
15+
;;
16+
x86)
17+
DEST_CPU="ia32"
18+
SUFFIX="i686-linux-android"
19+
TOOLCHAIN_NAME="$ARCH"
20+
;;
21+
x86_64)
22+
DEST_CPU="ia32"
23+
SUFFIX="$ARCH-linux-android"
24+
TOOLCHAIN_NAME="$ARCH"
25+
;;
26+
*)
27+
echo "Unsupported architecture provided: $ARCH"
28+
exit 1
29+
;;
30+
esac
31+
332
export TOOLCHAIN=$PWD/android-toolchain
433
mkdir -p $TOOLCHAIN
534
$1/build/tools/make-standalone-toolchain.sh \
6-
--toolchain=arm-linux-androideabi-4.9 \
7-
--arch=arm \
35+
--toolchain=$TOOLCHAIN_NAME-$CC_VER \
36+
--arch=$ARCH \
837
--install-dir=$TOOLCHAIN \
938
--platform=android-21
1039
export PATH=$TOOLCHAIN/bin:$PATH
11-
export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar
12-
export CC=$TOOLCHAIN/bin/arm-linux-androideabi-gcc
13-
export CXX=$TOOLCHAIN/bin/arm-linux-androideabi-g++
14-
export LINK=$TOOLCHAIN/bin/arm-linux-androideabi-g++
40+
export AR=$TOOLCHAIN/bin/$SUFFIX-ar
41+
export CC=$TOOLCHAIN/bin/$SUFFIX-gcc
42+
export CXX=$TOOLCHAIN/bin/$SUFFIX-g++
43+
export LINK=$TOOLCHAIN/bin/$SUFFIX-g++
1544

1645
./configure \
17-
--dest-cpu=arm \
18-
--dest-os=android
46+
--dest-cpu=$DEST_CPU \
47+
--dest-os=android \
48+
--without-snapshot \
49+
--openssl-no-asm
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
'cflags': [ '-gxcoff' ],
7171
'ldflags': [ '-Wl,-bbigtoc' ],
7272
}],
73+
['OS == "android"', {
74+
'cflags': [ '-fPIE' ],
75+
'ldflags': [ '-fPIE', '-pie' ]
76+
}]
7377
],
7478
'msvs_settings': {
7579
'VCCLCompilerTool': {
@@ -103,6 +107,10 @@
103107
['OS!="mac" and OS!="win"', {
104108
'cflags': [ '-fno-omit-frame-pointer' ],
105109
}],
110+
['OS == "android"', {
111+
'cflags': [ '-fPIE' ],
112+
'ldflags': [ '-fPIE', '-pie' ]
113+
}]
106114
],
107115
'msvs_settings': {
108116
'VCCLCompilerTool': {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.