How to tell Android NDK to use a different toolchain -
How to tell Android NDK to use a different toolchain -
i've downloaded custom toolchain (linaro) build arm based android apps. how tell ndk utilize it? can define or set in android.mk , application.mk allow me that? there way?
as other reply mentions, toolchains discovered ndk-build makefile scheme in $(ndk_root)/toolchains/ , can mirror ideas see there. there few concepts supporting non-android target platforms interesting although may outdated ndk-build starts explicitly back upwards other platforms, such mingw targeting win32 (or other gcc compilers targeting plain 'ol linux).
in config.mk:
toolchain_abis := (list of abis toolchain supports) this of import definition, because can utilize name in application.mk build using toolchain particular abi. 1 of benefits of corrupting usage of definition, ndk-build can simultaneously build multiple abis. always assumes platform android, if want target win32 using mingw based toolchain, can define "abi" x86-win32, , utilize abi in application.mk select additional target via app_abi:= x86-win32 in android.mk files can utilize target_arch_abi definition select win32 specific sources , include paths, example:
ifeq ($(target_arch_abi),x86-win32) local_src_files += my_win32_file.c local_cflags += -dsome_win32_specific endif the final piece in setup.mk toolchain, may insufficient @ other toolchains examples, because setup.mk particular toolchain really override build settings in default-build-commands.mk, want inspect file, , redefine things in don't like.
following previous example, mingw not back upwards noexec flag in binaries, , can rid of feature adding next lines in setup.mk:
# these flags used enforce nx (no execute) security feature in # generated machine code. adds special section generated shared # libraries instruct linux kernel disable code execution # stack , heap. target_no_execute_cflags := # our platform doesn't back upwards flag! target_no_execute_ldflags := # our platform doesn't back upwards flag! # these flags disable above security feature target_disable_no_execute_cflags := # our platform doesn't back upwards flag! target_disable_no_execute_ldflags := # our platform doesn't back upwards flag! this 1 illustration of many features in default-build-commands.mk may need overridden, , of course of study it's of import provide toolchain_name toolchain can selected via ndk_toolchain variable within application.mk file in add-on abi methodology mention above.
android android-ndk toolchain
Comments
Post a Comment