(ctx, arch)
| 944 | |
| 945 | |
| 946 | def biglink(ctx, arch): |
| 947 | # First, collate object files from each recipe |
| 948 | info('Collating object files from each recipe') |
| 949 | obj_dir = join(ctx.bootstrap.build_dir, 'collated_objects') |
| 950 | ensure_dir(obj_dir) |
| 951 | recipes = [Recipe.get_recipe(name, ctx) for name in ctx.recipe_build_order] |
| 952 | for recipe in recipes: |
| 953 | recipe_obj_dir = join(recipe.get_build_container_dir(arch.arch), |
| 954 | 'objects_{}'.format(recipe.name)) |
| 955 | if not exists(recipe_obj_dir): |
| 956 | info('{} recipe has no biglinkable files dir, skipping' |
| 957 | .format(recipe.name)) |
| 958 | continue |
| 959 | files = glob.glob(join(recipe_obj_dir, '*')) |
| 960 | if not len(files): |
| 961 | info('{} recipe has no biglinkable files, skipping' |
| 962 | .format(recipe.name)) |
| 963 | continue |
| 964 | info('{} recipe has object files, copying'.format(recipe.name)) |
| 965 | files.append(obj_dir) |
| 966 | shprint(sh.cp, '-r', *files) |
| 967 | |
| 968 | env = arch.get_env() |
| 969 | env['LDFLAGS'] = env['LDFLAGS'] + ' -L{}'.format( |
| 970 | join(ctx.bootstrap.build_dir, 'obj', 'local', arch.arch)) |
| 971 | |
| 972 | if not len(glob.glob(join(obj_dir, '*'))): |
| 973 | info('There seem to be no libraries to biglink, skipping.') |
| 974 | return |
| 975 | info('Biglinking') |
| 976 | info('target {}'.format(join(ctx.get_libs_dir(arch.arch), |
| 977 | 'libpymodules.so'))) |
| 978 | do_biglink = copylibs_function if ctx.copy_libs else biglink_function |
| 979 | |
| 980 | # Move to the directory containing crtstart_so.o and crtend_so.o |
| 981 | # This is necessary with newer NDKs? A gcc bug? |
| 982 | with current_directory(arch.ndk_lib_dir): |
| 983 | do_biglink( |
| 984 | join(ctx.get_libs_dir(arch.arch), 'libpymodules.so'), |
| 985 | obj_dir.split(' '), |
| 986 | extra_link_dirs=[join(ctx.bootstrap.build_dir, |
| 987 | 'obj', 'local', arch.arch), |
| 988 | os.path.abspath('.')], |
| 989 | env=env) |
| 990 | |
| 991 | |
| 992 | def biglink_function(soname, objs_paths, extra_link_dirs=None, env=None): |
no test coverage detected