我正在从源代码重新构建Android(用于刷写设备,目前使用模拟器),尝试添加一个单独的命令行工具。我已经将我的源代码放在repo / external / ...中,并编写了Android.mk
文件。
我遇到了以下未定义错误:
__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
我在这里搜索了其他与未定义变量相同的问题,但似乎无法找到适用于Android的解决方案。
最终的链接命令生成如下:
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)
有人能发现问题或指引我去获取arm-linux-androideabi-g++的正确行为吗?