def cxx_android5_gxx49_x64(conf): """ Detect and setup the Android 5.0+ g++ 4.9 compiler for x86_64 """ # Note: The x86_64 platform was introduced in Android 5 (API Level 21). # Therefore the standalone toolchain must be created with the # --api=21 option (or above). conf.mkspec_gxx_android_configure(4, 9, 'x86_64-linux-android') # The PIE binary must be the default in this case conf.mkspec_add_common_flag('-fPIE') conf.env['LINKFLAGS'] += ['-pie']
def cxx_android_gxx48_armv7(conf): """ Detect and setup the Android g++ 4.8 compiler for ARMv7 """ conf.mkspec_gxx_android_configure(4, 8, 'arm-linux-androideabi') # Specify the ARMv7 architecture and the 'softfp' float ABI to compile for # hardware FPU, but with software linkage (required for -mfpu=neon flag). # The __ARM_NEON__ macro will be defined only if the -mfloat-abi=softfp and # -mfpu=neon flags are used together. flags = ['-march=armv7-a', '-mtune=generic-armv7-a', '-mfloat-abi=softfp'] conf.env['CFLAGS'] += flags conf.env['CXXFLAGS'] += flags
def cxx_android5_gxx49_arm64(conf): """ Detects and setup the Android 5.0+ g++ 4.9 compiler for ARM64 """ # Note: The arm64 platform was introduced in Android 5 (API Level 21). # Therefore the standalone toolchain must be created with the # --api=21 option (or above). # Only position independent executables (PIE) are supported on Android 5. conf.mkspec_gxx_android_configure(4, 9, 'aarch64-linux-android') conf.mkspec_add_common_flag('-fPIE') conf.env['LINKFLAGS'] += ['-pie'] # Default "bfd" linker for the arm64 toolchain has an issue with linking # shared libraries: https://github.com/android-ndk/ndk/issues/148 # Force the use of the "gold" linker until it becomes the default conf.env['LINKFLAGS'] += ['-fuse-ld=gold'] conf.env['DEST_CPU'] = 'arm64'
def cxx_android_gxx49_armv7(conf): """ Detect and setup the Android g++ 4.9 compiler for ARMv7 """ conf.mkspec_gxx_android_configure(4, 9, 'arm-linux-androideabi') # Specify the ARMv7 architecture and the 'softfp' float ABI to compile for # hardware FPU, but with software linkage (required for -mfpu=neon flag). # The __ARM_NEON__ macro will be defined only if the -mfloat-abi=softfp and # -mfpu=neon flags are used together. flags = ['-march=armv7-a', '-mtune=generic-armv7-a', '-mfloat-abi=softfp'] conf.env['CFLAGS'] += flags conf.env['CXXFLAGS'] += flags # Specify the ARMv7 architecture in the LINKFLAGS to link with the # atomic support that is required for std::threads (without this flag, # the threading code might call pure virtual methods) conf.env['LINKFLAGS'] += ['-march=armv7-a']
def cxx_android_gxx49_x86(conf): """ Detect and setup the Android g++ 4.9 compiler for x86 """ conf.mkspec_gxx_android_configure(4, 9, 'i686-linux-android')
def cxx_android_gxx49_arm(conf): """ Detect and setup the Android g++ 4.9 compiler for ARM """ conf.mkspec_gxx_android_configure(4, 9, 'arm-linux-androideabi')