Skip to content

Commit d1c4fcc

Browse files
gcampaxMylesBorins
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 0379fb6 commit d1c4fcc

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
@@ -127,8 +127,8 @@
127127
'ldflags': [ '-Wl,-bbigtoc' ],
128128
}],
129129
['OS == "android"', {
130-
'cflags': [ '-fPIE' ],
131-
'ldflags': [ '-fPIE', '-pie' ]
130+
'cflags': [ '-fPIC' ],
131+
'ldflags': [ '-fPIC' ]
132132
}],
133133
],
134134
'msvs_settings': {
@@ -187,8 +187,8 @@
187187
],
188188
},],
189189
['OS == "android"', {
190-
'cflags': [ '-fPIE' ],
191-
'ldflags': [ '-fPIE', '-pie' ]
190+
'cflags': [ '-fPIC' ],
191+
'ldflags': [ '-fPIC' ]
192192
}],
193193
],
194194
'msvs_settings': {

configure.py

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

1125-
if sys.platform == 'darwin':
1125+
if options.dest_os == 'android':
1126+
shlib_suffix = 'so'
1127+
elif sys.platform == 'darwin':
11261128
shlib_suffix = '%s.dylib'
11271129
elif sys.platform.startswith('aix'):
11281130
shlib_suffix = '%s.a'
11291131
else:
11301132
shlib_suffix = 'so.%s'
1133+
if '%s' in shlib_suffix:
1134+
shlib_suffix %= node_module_version
11311135

1132-
shlib_suffix %= node_module_version
11331136
o['variables']['node_module_version'] = int(node_module_version)
11341137
o['variables']['shlib_suffix'] = shlib_suffix
11351138

0 commit comments

Comments
 (0)