mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
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: https://github.com/nodejs/node/pull/5544 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
c9c387fdac
commit
271201fea9
@ -1,18 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
ARCH=arm
|
||||
else
|
||||
ARCH="$2"
|
||||
fi
|
||||
|
||||
CC_VER="4.9"
|
||||
case $ARCH in
|
||||
arm)
|
||||
DEST_CPU="$ARCH"
|
||||
SUFFIX="$ARCH-linux-androideabi"
|
||||
TOOLCHAIN_NAME="$SUFFIX"
|
||||
;;
|
||||
x86)
|
||||
DEST_CPU="ia32"
|
||||
SUFFIX="i686-linux-android"
|
||||
TOOLCHAIN_NAME="$ARCH"
|
||||
;;
|
||||
x86_64)
|
||||
DEST_CPU="ia32"
|
||||
SUFFIX="$ARCH-linux-android"
|
||||
TOOLCHAIN_NAME="$ARCH"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported architecture provided: $ARCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
export TOOLCHAIN=$PWD/android-toolchain
|
||||
mkdir -p $TOOLCHAIN
|
||||
$1/build/tools/make-standalone-toolchain.sh \
|
||||
--toolchain=arm-linux-androideabi-4.9 \
|
||||
--arch=arm \
|
||||
--toolchain=$TOOLCHAIN_NAME-$CC_VER \
|
||||
--arch=$ARCH \
|
||||
--install-dir=$TOOLCHAIN \
|
||||
--platform=android-21
|
||||
export PATH=$TOOLCHAIN/bin:$PATH
|
||||
export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar
|
||||
export CC=$TOOLCHAIN/bin/arm-linux-androideabi-gcc
|
||||
export CXX=$TOOLCHAIN/bin/arm-linux-androideabi-g++
|
||||
export LINK=$TOOLCHAIN/bin/arm-linux-androideabi-g++
|
||||
export AR=$TOOLCHAIN/bin/$SUFFIX-ar
|
||||
export CC=$TOOLCHAIN/bin/$SUFFIX-gcc
|
||||
export CXX=$TOOLCHAIN/bin/$SUFFIX-g++
|
||||
export LINK=$TOOLCHAIN/bin/$SUFFIX-g++
|
||||
|
||||
./configure \
|
||||
--dest-cpu=arm \
|
||||
--dest-os=android
|
||||
--dest-cpu=$DEST_CPU \
|
||||
--dest-os=android \
|
||||
--without-snapshot \
|
||||
--openssl-no-asm
|
||||
|
@ -68,6 +68,10 @@
|
||||
'cflags': [ '-gxcoff' ],
|
||||
'ldflags': [ '-Wl,-bbigtoc' ],
|
||||
}],
|
||||
['OS == "android"', {
|
||||
'cflags': [ '-fPIE' ],
|
||||
'ldflags': [ '-fPIE', '-pie' ]
|
||||
}]
|
||||
],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
@ -101,6 +105,10 @@
|
||||
['OS!="mac" and OS!="win"', {
|
||||
'cflags': [ '-fno-omit-frame-pointer' ],
|
||||
}],
|
||||
['OS == "android"', {
|
||||
'cflags': [ '-fPIE' ],
|
||||
'ldflags': [ '-fPIE', '-pie' ]
|
||||
}]
|
||||
],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
|
Loading…
Reference in New Issue
Block a user