Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#1968 closed defect (fixed)

Failure in configure-android when specifying --use-ndk-cflags with Android NDK r13 or later

Reported by: riza Owned by: bennylp
Priority: normal Milestone: release-2.7
Component: common Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description (last modified by riza)

Starting NDK r13, Android NDK has set NDK_TOOLCHAIN_VERSION default value to Clang.
This will result the configure-android to fail with this error:

configure-android error: compiler not found, please check environment 
settings (TARGET_ABI, etc)

Furthermore, r13 release notes states that:

GCC is no longer supported. It will not be removed from the NDK just yet, 
but is no longer receiving backports. 
It cannot be removed until after libc++ has become stable enough to be the default, 
as some parts of gnustl are still incompatible with Clang. 
It will likely be removed after that point.

So, the same issue should be expected on r14 and later.

At the moment (on r13), you can force the ndk to use gcc by specifying the NDK_TOOLCHAIN_VERSION to 4.9.

e.g:

NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags

Update:

Since r5620. configure-android have been modified to support clang, hence user wouldn't need to specify NDK_TOOLCHAIN_VERSION.

Known Issue when building with clang:

When building for older android device, it is needed to specify APP_PLATFORM.

e.g: APP_PLATFORM=android-17

The build might fail with these error:

In file included from ../../yuv/source/compare.cc:14:
/app/android-ndk-r13b//sources/cxx-stl/llvm-libc++/include/math.h:661:91: error: use of undeclared identifier 'acosl'
inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);}
                                                                                          ^
/app/android-ndk-r13b//sources/cxx-stl/llvm-libc++/include/math.h:673:91: error: use of undeclared identifier 'asinl'
inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return asinl(__lcpp_x);}

The error is described in detail in here.

To handle it user need to include $(NDKRoot)/sources/android/support/include in the CFLAGS (user.mak).

Change History (2)

comment:1 Changed 7 years ago by riza

  • Resolution set to fixed
  • Status changed from new to closed

In 5620:

Fix #1968: Failure in configure-android when specifying --use-ndk-cflags with
Android NDK r13 or later.

comment:2 Changed 7 years ago by riza

  • Description modified (diff)
Note: See TracTickets for help on using tickets.