summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-03 00:37:25 +0800
committerruki <[email protected]>2020-10-03 00:37:25 +0800
commitc1f1db8e3358255e95afb22b5f16da683ec696e2 (patch)
treee7a3a35efba7727ceef81178d54408f124911898 /core/src
parent378936872327105816196e2827eb5ad784faead6 (diff)
fix luajit crash for fedora/i386
Diffstat (limited to 'core/src')
-rw-r--r--core/src/luajit/makefile8
-rw-r--r--core/src/luajit/xmake.lua6
2 files changed, 13 insertions, 1 deletions
diff --git a/core/src/luajit/makefile b/core/src/luajit/makefile
index 4af63a873..0bfbaa0ff 100644
--- a/core/src/luajit/makefile
+++ b/core/src/luajit/makefile
@@ -125,7 +125,13 @@ luajit_CXFLAGS += -Wno-error=unused-function
ifeq ($(BUILD_ARCH),arm)
luajit_CXFLAGS += -DLUAJIT_USE_SYSMALLOC
endif
-
+
+# fix call math.sin/log crash for fedora/i386/lj_vm.S with `LDFLAGS = -specs=/usr/lib/rpm/redhat/redhat-hardened-ld` in xmake.spec/%set_build_flags
+ifeq ($(BUILD_ARCH),i386)
+luajit_ASFLAGS += -fPIC
+luajit_CXFLAGS += -fPIC
+endif
+
# suffix
include $(PRO_DIR)/suffix.mak
diff --git a/core/src/luajit/xmake.lua b/core/src/luajit/xmake.lua
index 2ab1ae5dd..2479be3ce 100644
--- a/core/src/luajit/xmake.lua
+++ b/core/src/luajit/xmake.lua
@@ -60,6 +60,12 @@ target("luajit")
add_defines("LUAJIT_USE_SYSMALLOC")
end
+ -- fix call math.sin/log crash for fedora/i386/lj_vm.S with `LDFLAGS = -specs=/usr/lib/rpm/redhat/redhat-hardened-ld` in xmake.spec/%set_build_flags
+ if is_plat("linux") and is_arch("i386") then
+ add_asflags("-fPIC")
+ add_ldflags("-fPIC")
+ end
+
-- enable lua5.2 compat, @see http://luajit.org/extensions.html
--[[
add_defines("LUAJIT_ENABLE_LUA52COMPAT")