Skip to content

Commit aee404f

Browse files
committed
Improve ARM compatibility
STANDALONE-TOOLCHAIN.html in Android NDK says: It is recommended to use the -mthumb compiler flag to force the generation of 16-bit Thumb-1 instructions (the default being 32-bit ARM ones). If you want to target the 'armeabi-v7a' ABI, you will need ensure that the following two flags are being used: CFLAGS='-march=armv7-a -mfloat-abi=softfp' Note: The first flag enables Thumb-2 instructions, and the second one enables H/W FPU instructions while ensuring that floating-point parameters are passed in core registers, which is critical for ABI compatibility. Do *not* use these flags separately! Thanks to Peter Osterlund for pointout this doc and for showing me an example Makefile to follow. No functional change.
1 parent 0915f85 commit aee404f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ ifeq ($(optimize),yes)
296296
endif
297297

298298
ifeq ($(arch),armv7)
299-
CXXFLAGS += -fno-gcse
299+
CXXFLAGS += -fno-gcse -mthumb -march=armv7-a -mfloat-abi=softfp
300300
endif
301301
endif
302302

0 commit comments

Comments
 (0)