mirror of
https://github.com/topjohnwu/Magisk.git
synced 2026-01-16 06:43:23 -08:00
Initial crt0 implementation
Builds but cannot link, missing a lot of symbols
This commit is contained in:
@@ -22,18 +22,3 @@ LOCAL_SRC_FILES := \
|
||||
base-rs.cpp \
|
||||
../external/cxx-rs/src/cxx.cc
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
# All static executables should link with libcompat
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := libcompat
|
||||
LOCAL_SRC_FILES := compat/compat.cpp
|
||||
# Fix static variables' ctor/dtor when using LTO
|
||||
# See: https://github.com/android/ndk/issues/1461
|
||||
LOCAL_EXPORT_LDFLAGS := -static -T src/lto_fix.lds -Wl,--wrap=rename -Wl,--wrap=renameat
|
||||
# For some reason, using the hacky libc.a with x86 will trigger stack protection violation
|
||||
# when mixing Rust and C++ code. Disable stack protector to bypass this issue.
|
||||
ifeq ($(TARGET_ARCH), x86)
|
||||
LOCAL_EXPORT_CFLAGS := -fno-stack-protector
|
||||
endif
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifndef __call_bypassing_fortify
|
||||
#define __call_bypassing_fortify(fn) (&fn)
|
||||
#endif
|
||||
|
||||
#undef vsnprintf
|
||||
static int fmt_and_log_with_rs(LogLevel level, const char *fmt, va_list ap) {
|
||||
constexpr int sz = 4096;
|
||||
|
||||
Reference in New Issue
Block a user