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

Yet another luajit.cmake unwind detection fix #614

Merged
merged 1 commit into from
Sep 8, 2022
Merged
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
5 changes: 4 additions & 1 deletion deps/luajit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ ELSEIF(NOT WIN32)
execute_process(COMMAND "${CMAKE_C_COMPILER}" -c -x c "${TMPUNWIND_DIR}/tmpunwind.c" -o "${TMPUNWIND_DIR}/tmpunwind.o"
RESULT_VARIABLE UNWIND_TEST_ERRORED)
IF(UNWIND_TEST_ERRORED EQUAL 0)
file(READ "${TMPUNWIND_DIR}/tmpunwind.o" TMPUNWIND_O)
# Use STRINGS here so that CMake doesn't stop reading the file once it hits a NUL character.
# Note: STRINGS skips all non-ASCII/binary bytes, but that's okay since we're only checking
# for the presence of some ASCII strings.
file(STRINGS "${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 GREATER -1 OR UNWIND_INFO_FOUND GREATER -1)
Expand Down