Skip to content

Commit 7757f8f

Browse files
committed
Fixes gevent recipe on arm64-v8a arch
Adding `libm.so` to the `arm64-v8a` build fixes undefined reference errors. The (truncated) config.log errors were: ``` ... libpython3.7m.so: undefined reference to `hypot@LIBC' libpython3.7m.so: undefined reference to `frexp@LIBC' libpython3.7m.so: undefined reference to `cos@LIBC' libpython3.7m.so: undefined reference to `pow@LIBC' libpython3.7m.so: undefined reference to `atan2@LIBC' libpython3.7m.so: undefined reference to `modf@LIBC' libpython3.7m.so: undefined reference to `exp@LIBC' libpython3.7m.so: undefined reference to `sin@LIBC' libpython3.7m.so: undefined reference to `log@LIBC' libpython3.7m.so: undefined reference to `fmod@LIBC' clang: error: linker command failed with exit code 1 (use -v to see invocation) ... ``` Refs: kivy#1722 (comment)
1 parent 22eb6c9 commit 7757f8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pythonforandroid/recipes/gevent/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
1313
"""
1414
- Moves all -I<inc> -D<macro> from CFLAGS to CPPFLAGS environment.
1515
- Moves all -l<lib> from LDFLAGS to LIBS environment.
16+
- Copies all -l<lib> from LDLIBS to LIBS environment.
1617
- Fixes linker name (use cross compiler) and flags (appends LIBS)
1718
"""
18-
env = super(GeventRecipe, self).get_recipe_env(arch, with_flags_in_cc)
19+
env = super().get_recipe_env(arch, with_flags_in_cc)
1920
# CFLAGS may only be used to specify C compiler flags, for macro definitions use CPPFLAGS
2021
regex = re.compile(r'(?:\s|^)-[DI][\S]+')
2122
env['CPPFLAGS'] = ''.join(re.findall(regex, env['CFLAGS'])).strip()
@@ -24,6 +25,7 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
2425
# LDFLAGS may only be used to specify linker flags, for libraries use LIBS
2526
regex = re.compile(r'(?:\s|^)-l[\w\.]+')
2627
env['LIBS'] = ''.join(re.findall(regex, env['LDFLAGS'])).strip()
28+
env['LIBS'] += ' {}'.format(''.join(re.findall(regex, env['LDLIBS'])).strip())
2729
env['LDFLAGS'] = re.sub(regex, '', env['LDFLAGS'])
2830
info('Moved "{}" from LDFLAGS to LIBS.'.format(env['LIBS']))
2931
return env

0 commit comments

Comments
 (0)