Closed carlocab closed 2 years ago
There's mention of setting TARGET_ARCH
in https://github.com/luvit/luvi/commit/a9dc8dae2eb69d4a754a0cf5c08622d70f6b7067, but that seems to be only useful for cross-compiling. Still, I thought it might be worth a try [1], but it doesn't help. I still get the exact same error. [2]
[1] https://github.com/Homebrew/homebrew-core/pull/69036/commits/fa3d9876d6137f31e7913f1b3972ff781311b917 [2] https://github.com/Homebrew/homebrew-core/runs/1739322226#step:7:338
I think this is basically a duplicate of #230 because the apple silicon is basically ARM (aarch64) under the hood. Same error, same place.
Yes, it does look like the same error. Apple ARM isn't exactly the same as aarch64, however. There are still a lot of things that work fine on aarch64 but don't run on Apple Silicon.
Actually, I'm not sure. Is missing LC_SEGMENT file
the same as a segfault?
modify the luajit source code.bcsave_machobj function in the bcsave.lua. delete the fat mode, only use the thin mode for apple m1
modify the luajit source code.bcsave_machobj function in the bcsave.lua. delete the fat mode, only use the thin mode for apple m1
This seems like a likely fix. See LuaJIT/LuaJIT#649.
This is fixed by LuaJIT/LuaJIT#863 and the following patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index abb2f15..f27858f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -170,10 +170,6 @@ lua_add_executable(luvi
${lpeg_re_lua}
)
-if(APPLE)
- set(CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000 ${CMAKE_EXE_LINKER_FLAGS}")
-endif()
-
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-E")
endif()
Not quite fixed yet, as this still needs https://github.com/LuaJIT/LuaJIT/pull/863. But I suppose that's not really actionable here, so I'm ok to leave this closed.
As I mentioned in #242, I'm trying to build luvi on Apple Silicon. However, this fails with a linker error:
CI logs available at https://github.com/Homebrew/homebrew-core/pull/69036/checks?check_run_id=1739201673.
The error starts here and the CMake invocation is here.
This compiles successfully on the Intel CI nodes. As previously mentioned, I'm building with a custom libuv (v1.40), a custom LuaJIT (OpenResty v2.1-20201229), and a shared libluv (v1.36.0, built with the aforementioned libuv and LuaJIT).