build: fix library version and compile flags on Android
Compiling a library with -fPIE won't do, and on Android libraries are not versioned. PR-URL: https://github.com/nodejs/node/pull/29388 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
d8fc0ae50f
commit
99fe9dd112
@ -127,8 +127,8 @@
|
|||||||
'ldflags': [ '-Wl,-bbigtoc' ],
|
'ldflags': [ '-Wl,-bbigtoc' ],
|
||||||
}],
|
}],
|
||||||
['OS == "android"', {
|
['OS == "android"', {
|
||||||
'cflags': [ '-fPIE' ],
|
'cflags': [ '-fPIC' ],
|
||||||
'ldflags': [ '-fPIE', '-pie' ]
|
'ldflags': [ '-fPIC' ]
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
'msvs_settings': {
|
'msvs_settings': {
|
||||||
@ -187,8 +187,8 @@
|
|||||||
],
|
],
|
||||||
},],
|
},],
|
||||||
['OS == "android"', {
|
['OS == "android"', {
|
||||||
'cflags': [ '-fPIE' ],
|
'cflags': [ '-fPIC' ],
|
||||||
'ldflags': [ '-fPIE', '-pie' ]
|
'ldflags': [ '-fPIC' ]
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
'msvs_settings': {
|
'msvs_settings': {
|
||||||
|
@ -1122,14 +1122,17 @@ def configure_node(o):
|
|||||||
o['variables']['node_shared'] = b(options.shared)
|
o['variables']['node_shared'] = b(options.shared)
|
||||||
node_module_version = getmoduleversion.get_version()
|
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'
|
shlib_suffix = '%s.dylib'
|
||||||
elif sys.platform.startswith('aix'):
|
elif sys.platform.startswith('aix'):
|
||||||
shlib_suffix = '%s.a'
|
shlib_suffix = '%s.a'
|
||||||
else:
|
else:
|
||||||
shlib_suffix = 'so.%s'
|
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']['node_module_version'] = int(node_module_version)
|
||||||
o['variables']['shlib_suffix'] = shlib_suffix
|
o['variables']['shlib_suffix'] = shlib_suffix
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user