jmpews / Dobby

a lightweight, multi-platform, multi-architecture hook framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

将此项目用于编写 Magisk Module 时编译不通过

suqiernb opened this issue · comments

  • 如标题所讲的那样, 我尝试编写一个模块
  • 在构建脚本中将 APP_STL 设置为 none 并且引用了 libcxx
  • 我不知道这属于libcxx的问题还是属于dobby的问题
  • 如果您不知道我在讲什么, 那么请参阅 Zygisk Module Sample

Erron

C/C++: ninja: Entering directory `xxx\module\.cxx\Debug\2x5n4s4e\armeabi-v7a'
C/C++: ld: error: undefined symbol: __cxa_end_cleanup
C/C++: ld: error: undefined symbol: __gxx_personality_v0
C/C++: ld: error: undefined symbol: vtable for __cxxabiv1::__class_type_info
C/C++: ld: error: undefined symbol: __cxa_begin_catch
C/C++: ld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
C/C++: ld: error: undefined symbol: vtable for __cxxabiv1::__vmi_class_type_info
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)

C/C++: ninja: Entering directory `xxx\module\.cxx\Debug\2x5n4s4e\arm64-v8a'
C/C++: ld: error: undefined symbol: __gxx_personality_v0
C/C++: ld: error: undefined symbol: vtable for __cxxabiv1::__class_type_info
C/C++: ld: error: undefined symbol: __cxa_begin_catch
C/C++: ld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
C/C++: ld: error: undefined symbol: vtable for __cxxabiv1::__vmi_class_type_info
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
commented

-fno-rtti -fno-exception

认真看 magisk 的 libcxx 说明啊,没有 rtti 和 exception 的。

Use this dobby version compiled by me:

dobby.zip

Add to Android.mk:

include $(CLEAR_VARS)
LOCAL_MODULE := dobby
LOCAL_SRC_FILES := $(LOCAL_PATH)/dobby/$(TARGET_ARCH_ABI)/libdobby.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/dobby
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := zygisk
LOCAL_SRC_FILES := main.cpp
LOCAL_STATIC_LIBRARIES := dobby
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)