Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump luajit to latest HEAD of v2.1 branch #573

Merged
merged 3 commits into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/luajit
Submodule luajit updated 215 files
35 changes: 34 additions & 1 deletion deps/luajit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ ENDIF()
if ( WIN32 AND NOT CYGWIN )
set ( LJVM_MODE peobj )
elseif ( APPLE )
set ( CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000 ${CMAKE_EXE_LINKER_FLAGS}" )
set ( LJVM_MODE machasm )
else ()
set ( LJVM_MODE elfasm )
Expand Down Expand Up @@ -213,6 +212,39 @@ IF(TARGET_LJARCH STREQUAL "ppc")
ENDIF()
ENDIF()

IF(APPLE)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLUAJIT_UNWIND_EXTERNAL")
ELSEIF(NOT WIN32)
IF(NOT LJ_NO_UNWIND_1)
# Find out whether the target toolchain always generates unwind tables.
MESSAGE(STATUS "Checking if the toolchain always generates unwind tables")
SET(TOOLCHAIN_GENERATES_UNWIND_TABLES 0)
SET(TMPUNWIND_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp")
file(WRITE "${TMPUNWIND_DIR}/tmpunwind.c" "extern void b(void);int a(void){b();return 0;}")
# This seems flimsy; it would be better to use something like CMake's try_compile but
# there doesn't seem to be a way to avoid linking when using try_compile so this particular
# code can't use it (at least without modifying the test code)
execute_process(COMMAND "${CMAKE_C_COMPILER}" -c -x c "${TMPUNWIND_DIR}/tmpunwind.c" -o "${TMPUNWIND_DIR}/tmpunwind.o"
RESULT_VARIABLE UNWIND_TEST_ERRORED)
IF(NOT UNWIND_TEST_ERRORED)
file(READ "${TMPUNWIND_DIR}/tmpunwind.o" TMPUNWIND_O)
string(FIND "${TMPUNWIND_O}" "eh_frame" EH_FRAME_FOUND)
string(FIND "${TMPUNWIND_O}" "__unwind_info" UNWIND_INFO_FOUND)
IF(EH_FRAME_FOUND OR UNWIND_INFO_FOUND)
SET(TOOLCHAIN_GENERATES_UNWIND_TABLES 1)
ENDIF()
ENDIF()

IF(TOOLCHAIN_GENERATES_UNWIND_TABLES)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLUAJIT_UNWIND_EXTERNAL")
MESSAGE(STATUS "Toolchain does generate unwind tables")
ELSE()
MESSAGE(STATUS "Toolchain does not generate unwind tables")
ENDIF()
ENDIF()
ENDIF()


add_executable(minilua ${LUAJIT_DIR}/src/host/minilua.c)
SET_TARGET_PROPERTIES(minilua PROPERTIES COMPILE_DEFINITIONS "${TARGET_ARCH}")
CHECK_LIBRARY_EXISTS(m sin "" MINILUA_USE_LIBM)
Expand All @@ -238,6 +270,7 @@ SET(SRC_LJLIB
${LUAJIT_DIR}/src/lib_debug.c
${LUAJIT_DIR}/src/lib_jit.c
${LUAJIT_DIR}/src/lib_ffi.c
${LUAJIT_DIR}/src/lib_buffer.c
)

SET(SRC_LIBAUX
Expand Down