-
Notifications
You must be signed in to change notification settings - Fork 286
Description
Description
This is minor, but when using ndk-build to compile native code with NDK r19 (probably due to switching to the stock toolchain) the assembler emits tons of warnings such as:
pngwrite-4abf69.s:1985: Rd and Rm should be different in mul
pngwrite-4abf69.s:7926: Rd and Rm should be different in mla
...
I understand these contraints date back from the armv5 architecture, and are irrelevant on armv7, so it seems that -march isn't correctly passed to clang, as the warnings go away if I add "-march-armv7-a" to LOCAL_CFLAGS in Android.mk.
I did not check if the fpu ABI flag is also incorrectly omitted due to the same issue, but that may be worth looking into as well.
All my new projects use Android Studio and cmake to build native code, and it's a warning that can be ignored, so that isn't a big deal, but I still have some legacy projects using ndk-build, maybe it's worth fixing at the NDK level so as not to pollute logs or have to add a conditional to add the -march flag to Android.mk
To reproduce:
- Build C or C++ sources for the armv7-eabi target using ndk-build. The pnglib 1.6.36 sources trigger the issue in multiple locations for instance.
Environment Details
Not all of these will be relevant to every bug, but please provide as much
information as you can.
- NDK Version: 19.0.5232133
- Build system: ndk-build
- Host OS: Mac (macOS 10.14.3)
- Compiler: clang
- ABI: armeabi-v7a
- STL: c++_static
- NDK API level: 16
- Device API level: 28