-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Greenlet Crystax/Python3 support, fixes #1245 #1250
Greenlet Crystax/Python3 support, fixes #1245 #1250
Conversation
Fixes CFLAGS, LDSHARED and LDFLAGS to point to Crystax.
@@ -62,6 +62,8 @@ def get_env(self, with_flags_in_cc=True): | |||
|
|||
if self.ctx.ndk == 'crystax': | |||
env['LDFLAGS'] += ' -L{}/sources/crystax/libs/{} -lcrystax'.format(self.ctx.ndk_dir, self.arch) | |||
env['CFLAGS'] += ' -I{}/sources/python/{}/include/python/'.format( | |||
self.ctx.ndk_dir, self.ctx.python_recipe.version[0:3]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe other recipes should benefit from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now probably addressed in #1361
def get_recipe_env(self, arch=None, with_flags_in_cc=True): | ||
env = super(GreenletRecipe, self).get_recipe_env(arch, with_flags_in_cc) | ||
# sets linker to use the correct gcc (cross compiler) | ||
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise the default host linker was picked up rather than the ARM cross compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also addressed in #1361
# required additional library and path for Crystax | ||
if self.ctx.ndk == 'crystax': | ||
env['LDFLAGS'] += ' -L{}'.format(os.path.join(self.ctx.bootstrap.build_dir, 'libs', arch.arch)) | ||
env['LDFLAGS'] += ' -lpython{}m'.format(self.ctx.python_recipe.version[0:3]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that we don't get run time cannot locate symbol
errors.
Edit: unimportant confused comment 😄 |
Fixes CFLAGS, LDSHARED and LDFLAGS to point to Crystax.
I've tested it with the following
main.py
on Android.It worked as expected, see
adb logcat | grep python
output:And
buildozer.spec
: