Android.mk arm-linux-androideabi-g ++ exceptions and __cxa_allocate_exception

I am rebuilding Android from the source code (to run on the device right now using the emulator), trying to add one command line tool. I put my source in repo / exernal / ... and wrote Android.mk .

I get the following undefine:

 __cxa_allocate_exception __cxa_begin_catch __cxa_end_catch __cxa_end_cleanup __cxa_free_exception __cxa_get_exception_ptr __cxa_rethrow __cxa_throw __gxx_personality_v0 

I was looking for other problems with the same uncertainties, but I can not find a solution for Android.

The last communication command is generated as:

 prebuilt/darwin-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-g++ -nostdlib -Bdynamic -Wl,-T,build/core/armelf.x -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc -o out/target/product/generic/obj/EXECUTABLES/wavsender_intermediates/LINKED/wavsender -Lout/target/product/generic/obj/lib -Wl,-rpath-link=out/target/product/generic/obj/lib -lc -llog -lcutils -lnetutils -lc -lstdc++ -lm out/target/product/generic/obj/lib/crtbegin_dynamic.o out/target/product/generic/obj/EXECUTABLES/wavsender_intermediates/ohSongcast/WavSender/WavSender.o out/target/product/generic/obj/STATIC_LIBRARIES/liblog_intermediates/liblog.a out/target/product/generic/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a out/target/product/generic/obj/STATIC_LIBRARIES/libopenhome_intermediates/libopenhome.a out/target/product/generic/obj/STATIC_LIBRARIES/libgtest_intermediates/libgtest.a out/target/product/generic/obj/STATIC_LIBRARIES/libstlport_static_intermediates/libstlport_static.a out/target/product/generic/obj/STATIC_LIBRARIES/libstdc++_intermediates/libstdc++.a out/target/product/generic/obj/STATIC_LIBRARIES/libgabi++_intermediates/libgabi++.a -Wl,-z,noexecstack -Wl,--icf=safe -Wl,--fix-cortex-a8 prebuilt/darwin-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/armv7-a/libgcc.a out/target/product/generic/obj/lib/crtend_android.o 

Android.mk:

 include $(CLEAR_VARS) LOCAL_MODULE := wavsender LOCAL_MODULE_TAGS := eng LOCAL_CFLAGS += -fexceptions -D_GNU_SOURCE -DPLATFORM_ANDROID LOCAL_SRC_FILES += WavSender.cpp LOCAL_SHARED_LIBRARIES := libc libcutils libnetutils LOCAL_STATIC_LIBRARIES := libcutils libopenhome LOCAL_STATIC_LIBRARIES += libopenhome libgtest libstlport_static libstdc++ libgabi++ LOCAL_LDLIBS += -lstdc++ include external/stlport/libstlport.mk include $(BUILD_EXECUTABLE) 

Can someone see the problem or point me in the direction to get the correct behavior from arm-linux-androideabi-g ++?

+42
android exception
May 23 '12 at 18:32
source share
3 answers

Consider removing libstd ++ as static in Android.mk, it should use the standard Android implementation by default, and you should be fine

In fact, I see that you added it to both the static and dynamic libraries.

Remove static libstdc ++ or dynamic. If it does not, try deleting both

+1
Feb 29 '16 at 10:12
source share

All your undefine from libstdc ++.

This often happens when you have different versions of libstdc ++ and compiled with a specific version and linked to another, or forget to link.

Sometimes this can even happen if the link is executed after the library that needs it.

0
Feb 21 '14 at 9:10
source share

I came across a similar __cxa undefines some time ago as a result of creating a project that pulled libraries / shared objects where some specific APP_STL: = gnustl_shared and others declared gnustl_static in their Application.mk files.

Perhaps you may run into something similar? If so, I would recommend using one or the other in a combined solution, but not both.

0
Jun 04 '14 at 19:10
source share



All Articles