Skip to content

Commit

Permalink
build: fix library version and compile flags on Android
Browse files Browse the repository at this point in the history
Compiling a library with -fPIE won't do, and on Android libraries
are not versioned.
  • Loading branch information
gcampax committed Oct 22, 2019
1 parent 71b342f commit 77c2273
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions common.gypi
Expand Up @@ -156,8 +156,8 @@
'ldflags': [ '-Wl,-bbigtoc' ],
}],
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
'cflags': [ '-fPIC' ],
'ldflags': [ '-fPIC' ]
}],
],
'msvs_settings': {
Expand Down Expand Up @@ -216,8 +216,8 @@
],
},],
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
'cflags': [ '-fPIC' ],
'ldflags': [ '-fPIC' ]
}],
],
'msvs_settings': {
Expand Down
7 changes: 5 additions & 2 deletions configure.py
Expand Up @@ -1103,14 +1103,17 @@ def configure_node(o):
o['variables']['node_shared'] = b(options.shared)
node_module_version = getmoduleversion.get_version()

if sys.platform == 'darwin':
if options.dest_os == 'android':
shlib_suffix = 'so'
elif sys.platform == 'darwin':
shlib_suffix = '%s.dylib'
elif sys.platform.startswith('aix'):
shlib_suffix = '%s.a'
else:
shlib_suffix = 'so.%s'
if '%s' in shlib_suffix:
shlib_suffix %= node_module_version

shlib_suffix %= node_module_version
o['variables']['node_module_version'] = int(node_module_version)
o['variables']['shlib_suffix'] = shlib_suffix

Expand Down

0 comments on commit 77c2273

Please sign in to comment.