GeezerVison is showing github.com — build: add suport for x86 architecture · nodejs/node@4ad7184
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +39-8Lines changed: 39 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | #!/bin/bash |
2 | 2 |
|
| 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 | + |
3 | 32 | export TOOLCHAIN=$PWD/android-toolchain |
4 | 33 | mkdir -p $TOOLCHAIN |
5 | 34 | $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 \ |
8 | 37 | --install-dir=$TOOLCHAIN \ |
9 | 38 | --platform=android-21 |
10 | 39 | 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++ |
15 | 44 |
|
16 | 45 | ./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
Copy file name to clipboardExpand all lines: common.gypi +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
70 | 70 | 'cflags': [ '-gxcoff' ], |
71 | 71 | 'ldflags': [ '-Wl,-bbigtoc' ], |
72 | 72 | }], |
| 73 | + ['OS == "android"', { |
| 74 | + 'cflags': [ '-fPIE' ], |
| 75 | + 'ldflags': [ '-fPIE', '-pie' ] |
| 76 | + }] |
73 | 77 | ], |
74 | 78 | 'msvs_settings': { |
75 | 79 | 'VCCLCompilerTool': { |
|
103 | 107 | ['OS!="mac" and OS!="win"', { |
104 | 108 | 'cflags': [ '-fno-omit-frame-pointer' ], |
105 | 109 | }], |
| 110 | + ['OS == "android"', { |
| 111 | + 'cflags': [ '-fPIE' ], |
| 112 | + 'ldflags': [ '-fPIE', '-pie' ] |
| 113 | + }] |
106 | 114 | ], |
107 | 115 | 'msvs_settings': { |
108 | 116 | 'VCCLCompilerTool': { |
|