Skip to content

Commit 65e67cb

Browse files
gcampaxtargos
authored andcommitted
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: #29388 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 70dc7a2 commit 65e67cb

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

common.gypi

+4-4
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@
161161
'ldflags': [ '-Wl,-bbigtoc' ],
162162
}],
163163
['OS == "android"', {
164-
'cflags': [ '-fPIE' ],
165-
'ldflags': [ '-fPIE', '-pie' ]
164+
'cflags': [ '-fPIC' ],
165+
'ldflags': [ '-fPIC' ]
166166
}],
167167
],
168168
'msvs_settings': {
@@ -221,8 +221,8 @@
221221
],
222222
},],
223223
['OS == "android"', {
224-
'cflags': [ '-fPIE' ],
225-
'ldflags': [ '-fPIE', '-pie' ]
224+
'cflags': [ '-fPIC' ],
225+
'ldflags': [ '-fPIC' ]
226226
}],
227227
],
228228
'msvs_settings': {

configure.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1089,14 +1089,17 @@ def configure_node(o):
10891089
o['variables']['node_shared'] = b(options.shared)
10901090
node_module_version = getmoduleversion.get_version()
10911091

1092-
if sys.platform == 'darwin':
1092+
if options.dest_os == 'android':
1093+
shlib_suffix = 'so'
1094+
elif sys.platform == 'darwin':
10931095
shlib_suffix = '%s.dylib'
10941096
elif sys.platform.startswith('aix'):
10951097
shlib_suffix = '%s.a'
10961098
else:
10971099
shlib_suffix = 'so.%s'
1100+
if '%s' in shlib_suffix:
1101+
shlib_suffix %= node_module_version
10981102

1099-
shlib_suffix %= node_module_version
11001103
o['variables']['node_module_version'] = int(node_module_version)
11011104
o['variables']['shlib_suffix'] = shlib_suffix
11021105

0 commit comments

Comments
 (0)