summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-04-04 22:53:08 +0800
committerruki <[email protected]>2022-04-04 22:53:08 +0800
commitd7115ae9ce36bf98d54d4c48705c304f543c8c7b (patch)
tree9c6bec36ffb4b7c75fbd7db6dd9e9a1ce1e99835
parenteb4ed40168b3e2e309bdc1fbe6ba826d7c101905 (diff)
fix panic for luajit
-rw-r--r--core/plat/macosx/prefix.mak6
-rw-r--r--core/src/xmake/io/file_write.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/core/plat/macosx/prefix.mak b/core/plat/macosx/prefix.mak
index d75f65c10..722c42567 100644
--- a/core/plat/macosx/prefix.mak
+++ b/core/plat/macosx/prefix.mak
@@ -53,8 +53,8 @@ CPDIR = cp -r
MKDIR = mkdir -p
MAKE = make -r
-# cxflags: .c/.cc/.cpp files
-CXFLAGS_RELEASE = -Oz -fvisibility=hidden -fvisibility-inlines-hidden -flto
+# cxflags: .c/.cc/.cpp files, @note luajit cannot use -Oz, because it will panic
+CXFLAGS_RELEASE = -Os -fvisibility=hidden -fvisibility-inlines-hidden -flto
CXFLAGS_DEBUG = -g -D__tb_debug__
CXFLAGS = -m$(BITS) -c -Wall -Werror -Wno-error=deprecated-declarations -Qunused-arguments
CXFLAGS-I = -I
@@ -84,7 +84,7 @@ CCFLAGS = \
-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
# mxflags: .m/.mm files
-MXFLAGS_RELEASE = -Oz -fvisibility=hidden -fvisibility-inlines-hidden -flto
+MXFLAGS_RELEASE = -Os -fvisibility=hidden -fvisibility-inlines-hidden -flto
MXFLAGS_DEBUG = -g -D__tb_debug__
MXFLAGS = \
-m$(BITS) -c -Wall -Werror -Wno-error=deprecated-declarations -Qunused-arguments \
diff --git a/core/src/xmake/io/file_write.c b/core/src/xmake/io/file_write.c
index c7db01937..d2d150353 100644
--- a/core/src/xmake/io/file_write.c
+++ b/core/src/xmake/io/file_write.c
@@ -36,7 +36,7 @@
static tb_void_t xm_io_file_write_file_utfbom(xm_io_file_t* file)
{
// check
- tb_assert(file && data && xm_io_file_is_file(file) && file->file_ref);
+ tb_assert(file && xm_io_file_is_file(file) && file->file_ref);
// write bom
switch (file->encoding)