Skip to content

Commit

Permalink
android: remove -fPIE if building a native module
Browse files Browse the repository at this point in the history
NDK's clang won't link an android shared library when the
intermediate objects are build with the -fPIE flag. We remove the
-fPIE flag from android native loadable modules and use the
approppriate -fPIC instead.
  • Loading branch information
jaimecbernardo committed Feb 12, 2018
1 parent 12747ef commit 7b809ea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
'cflags': [ '-gxcoff' ],
'ldflags': [ '-Wl,-bbigtoc' ],
}],
['OS == "android" and node_shared!="true"', {
['OS == "android" and node_shared!="true" and _type!="loadable_module"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
Expand Down Expand Up @@ -188,7 +188,7 @@
['OS!="mac" and OS != "ios" and OS!="win"', {
'cflags': [ '-fno-omit-frame-pointer' ],
}],
['OS == "android" and node_shared!="true"', {
['OS == "android" and node_shared!="true" and _type!="loadable_module"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
Expand Down Expand Up @@ -394,16 +394,16 @@
'ldflags!': [ '-rdynamic' ],
}],
[ 'node_shared=="true"', {
'conditions': [
[ 'OS=="android"', {
'ldflags': [ '-fPIC' ],
}]
],
'cflags': [ '-fPIC' ],
}],
],
}],
['OS=="android"', {
'conditions': [
[ 'node_shared=="true" or _type=="loadable_module"', {
'ldflags': [ '-fPIC' ],
}]
],
'target_conditions': [
['_toolset=="target"', {
'defines': [ '_GLIBCXX_USE_C99_MATH' ],
Expand Down

0 comments on commit 7b809ea

Please sign in to comment.