Skip to content

Commit b3e7998

Browse files
committed
Added directory change during biglink
This seems to be necessary with the ndk 15 changes, otherwise some object files can't be linked. It seems like this should be fixable with an LDFLAG, but I can't any changes here that would have broken it.
1 parent ae2cd93 commit b3e7998

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

pythonforandroid/build.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,12 +666,16 @@ def biglink(ctx, arch):
666666
info('target {}'.format(join(ctx.get_libs_dir(arch.arch),
667667
'libpymodules.so')))
668668
do_biglink = copylibs_function if ctx.copy_libs else biglink_function
669-
do_biglink(
670-
join(ctx.get_libs_dir(arch.arch), 'libpymodules.so'),
671-
obj_dir.split(' '),
672-
extra_link_dirs=[join(ctx.bootstrap.build_dir,
673-
'obj', 'local', arch.arch)],
674-
env=env)
669+
670+
# Move to the directory containing crtstart_so.o and crtend_so.o
671+
# This is necessary with newer NDKs? A gcc bug?
672+
with current_directory(join(ctx.ndk_platform, 'usr', 'lib')):
673+
do_biglink(
674+
join(ctx.get_libs_dir(arch.arch), 'libpymodules.so'),
675+
obj_dir.split(' '),
676+
extra_link_dirs=[join(ctx.bootstrap.build_dir,
677+
'obj', 'local', arch.arch)],
678+
env=env)
675679

676680

677681
def biglink_function(soname, objs_paths, extra_link_dirs=[], env=None):

0 commit comments

Comments
 (0)