From 21ed09560184abe18e213b890a9b8950181b1d77 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 25 Mar 2024 16:11:02 -0700 Subject: [PATCH] Update crt0 --- native/src/Android.mk | 1 - native/src/boot/main.cpp | 4 ++-- native/src/external/crt0 | 2 +- native/src/init/init.cpp | 4 ++++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/native/src/Android.mk b/native/src/Android.mk index 406fd5cc7..165fc627a 100644 --- a/native/src/Android.mk +++ b/native/src/Android.mk @@ -111,7 +111,6 @@ LOCAL_LDFLAGS := -static -T src/lto_fix.lds ifdef B_CRT0 LOCAL_STATIC_LIBRARIES += crt0 -LOCAL_CFLAGS += -DUSE_MUSL_PRINTF LOCAL_LDFLAGS := -lm endif diff --git a/native/src/boot/main.cpp b/native/src/boot/main.cpp index 9ac263e44..252058b20 100644 --- a/native/src/boot/main.cpp +++ b/native/src/boot/main.cpp @@ -6,9 +6,9 @@ using namespace std; -#ifdef USE_MUSL_PRINTF -// Switch to use the musl vfprintf +#ifdef USE_CRT0 __asm__(".global vfprintf \n vfprintf = musl_vfprintf"); +__asm__(".global vsscanf \n vsscanf = tfp_vsscanf"); #endif static void print_formats() { diff --git a/native/src/external/crt0 b/native/src/external/crt0 index 6ec46be76..2afb00eb0 160000 --- a/native/src/external/crt0 +++ b/native/src/external/crt0 @@ -1 +1 @@ -Subproject commit 6ec46be760069d4645204b09b96e8dd414c3ac2e +Subproject commit 2afb00eb00575864009cbc62bd7a27842633c6b6 diff --git a/native/src/init/init.cpp b/native/src/init/init.cpp index 65a21b9a3..0e4cbf1dc 100644 --- a/native/src/init/init.cpp +++ b/native/src/init/init.cpp @@ -12,6 +12,10 @@ using namespace std; +#ifdef USE_CRT0 +__asm__(".global vfprintf \n vfprintf = tfp_vfprintf"); +#endif + bool unxz(out_stream &strm, rust::Slice bytes) { uint8_t out[8192]; xz_crc32_init();