From 5a5548369888a2aca8b1d48ea808bd0e7b2e1362 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Thu, 8 Aug 2024 18:20:02 +0800 Subject: [PATCH] Set `-fno-threadsafe-statics` for crt0 Since crt0 has no pthread support, we don't need lock for statics. --- native/src/Application.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/src/Application.mk b/native/src/Application.mk index 82f8c272d..650f7c978 100644 --- a/native/src/Application.mk +++ b/native/src/Application.mk @@ -24,7 +24,7 @@ endif ifdef B_CRT0 # Disable all security and debugging features -APP_CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-stack-protector -U_FORTIFY_SOURCE +APP_CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-stack-protector -fno-threadsafe-statics -U_FORTIFY_SOURCE # Override output folder to make sure all dependencies are rebuilt with new CFLAGS NDK_APP_OUT := $(NDK_APP_OUT)-nolibc