From e2401e1395bef1d3c8acec268b42dc5fb71c4a38 Mon Sep 17 00:00:00 2001 From: Jens Date: Sat, 20 Oct 2018 23:14:58 +0200 Subject: [PATCH] tools: fix usage of inherited -fPIC and -fPIE PR-URL: https://github.com/nodejs/node-gyp/pull/1340 Reviewed-By: Refael Ackermann --- addon.gypi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addon.gypi b/addon.gypi index 55fb321118..6b4641b693 100644 --- a/addon.gypi +++ b/addon.gypi @@ -55,6 +55,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 @@ -138,10 +146,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' ], - }] + }], ] } }