From 9d2ab227a37f13772a8551692e7a4e97f31621f2 Mon Sep 17 00:00:00 2001 From: Jens Date: Thu, 16 Nov 2017 11:05:36 +0100 Subject: [PATCH] Fix usage of -fPIC and -fPIE flags for compiling modules in termux on android --- addon.gypi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addon.gypi b/addon.gypi index 878f61f3a6..2859b05fac 100644 --- a/addon.gypi +++ b/addon.gypi @@ -52,6 +52,14 @@ 'standalone_static_library': '<(standalone_static_library)' }], + ['_type!="executable"', { + 'conditions': [ + [ 'OS=="android"', { + 'cflags!': [ '-fPIE' ], + }] + ] + }], + ['_win_delay_load_hook=="true"', { # If the addon specifies `'win_delay_load_hook': 'true'` in its # binding.gyp, link a delay-load hook into the DLL. This hook ensures @@ -135,10 +143,10 @@ '_FILE_OFFSET_BITS=64' ], }], - [ 'OS in "freebsd openbsd netbsd solaris" or \ + [ 'OS in "freebsd openbsd netbsd solaris android" or \ (OS=="linux" and target_arch!="ia32")', { 'cflags': [ '-fPIC' ], - }] + }], ] } }