jmpews / Dobby

a lightweight, multi-platform, multi-architecture hook framework.
Apache License 2.0
3.88k stars 794 forks source link

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

Open suqiernb opened 1 year ago

suqiernb commented 1 year ago

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)

yujincheng08 commented 1 year ago

-fno-rtti -fno-exception

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

chiteroman commented 8 months ago

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)