I'm trying to build a library with android ndk-11 and I'm getting a linker error:
arm-linux-androideabi/bin/ld: error: treating warnings as errors
I figured this out as I was writing it, so I thought I'd share the solution.
<NDK_ROOT>/build/core has a bunch of .mk files that are used when running ndk-build. Inside
build-binary.mk, there are a few new (undocumented) checks for variables you can define. For this particular one, there is the following block:
# We enable fatal linker warnings by default. # If LOCAL_DISABLE_FATAL_LINKER_WARNINGS is true, we don't enable this check. ifneq ($(LOCAL_DISABLE_FATAL_LINKER_WARNINGS),true) LOCAL_LDFLAGS += -Wl,--fatal-warnings endif
LOCAL_DISABLE_FATAL_LINKER_WARNINGS=true to my .mk file made the error go away.
There are lots of other things defined in these files, so if you're getting weird build errors all of a sudden, take a look in there to see if something new has been enabled.