From d57c7e685f9ef2f00aa0cd5661194e8059e84d00 Mon Sep 17 00:00:00 2001 From: guworks Date: Wed, 8 Jul 2015 23:20:31 -0400 Subject: [PATCH] build: proper support for android cross compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build script needs to properly specify the target as android so the gyp build scripts can properly leverage cross compilation using the android NDK. PR-URL: https://github.com/libuv/libuv/pull/433 Reviewed-By: Saúl Ibarra Corretgé --- android-configure | 4 ++-- common.gypi | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/android-configure b/android-configure index 97505812..e0b250fb 100755 --- a/android-configure +++ b/android-configure @@ -6,7 +6,7 @@ $1/build/tools/make-standalone-toolchain.sh \ --toolchain=arm-linux-androideabi-4.8 \ --arch=arm \ --install-dir=$TOOLCHAIN \ - --platform=android-9 + --platform=android-21 export PATH=$TOOLCHAIN/bin:$PATH export AR=arm-linux-androideabi-ar export CC=arm-linux-androideabi-gcc @@ -16,5 +16,5 @@ export PLATFORM=android if [ $2 -a $2 == 'gyp' ] then - ./gyp_uv.py -Dtarget_arch=arm -DOS=android + ./gyp_uv.py -Dtarget_arch=arm -DOS=android -f make-android fi diff --git a/common.gypi b/common.gypi index c754a461..c6f6dec8 100644 --- a/common.gypi +++ b/common.gypi @@ -35,7 +35,13 @@ 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '0', 'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ], - } + }, + 'conditions': [ + ['OS == "android"', { + 'cflags': [ '-fPIE' ], + 'ldflags': [ '-fPIE', '-pie' ] + }] + ] }, 'Release': { 'defines': [ 'NDEBUG' ],