Skip to content
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: 2 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ jobs:
}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Ccache
uses: hendrikmuhs/[email protected] # https://github.com/hendrikmuhs/ccache-action/issues/181
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "riscv-tests"]
path = tests/riscv-official/riscv-tests
url = https://github.com/riscv-software-src/riscv-tests.git
[submodule "external/libelfin"]
path = external/libelfin
url = https://github.com/mortbopet/libelfin
25 changes: 3 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,30 +226,11 @@ if ("${WASM}")
else ()
# Not available for WASM
enable_testing()

if (NOT "${FORCE_ELFLIB_STATIC}")
find_package(LibElf)
if ("${LibElf_FOUND}")
include(CheckSymbolExists)
check_symbol_exists(EM_RISCV "gelf.h" LIBELF_HAS_RISCV)
if ("${LIBELF_HAS_RISCV}")
# Turn non-cmake library into a cmake target
add_library(libelf INTERFACE)
target_link_libraries(libelf INTERFACE ${LIBELF_LIBRARY})
target_include_directories(libelf INTERFACE ${LIBELF_INCLUDE_DIR})
message(STATUS "Using system libelf")
else ()
message(STATUS "System libelf does not support RISC-V")
set(LibElf_FOUND FALSE) # Force fallback
endif ()
endif ()
endif ()
endif ()

if ("${WASM}" OR "${FORCE_ELFLIB_STATIC}" OR NOT "${LibElf_FOUND}")
message(STATUS "Using local libelf fallback.")
add_subdirectory("external/libelf")
endif ()
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
set(CMAKE_PROJECT_libelfin_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibElfinSettings.cmake")
add_subdirectory("external/libelfin")

# Detect Qt used qt version
# Based on article https://www.steinzone.de/wordpress/how-to-support-both-qt5-and-qt6-using-cmake/
Expand Down
21 changes: 21 additions & 0 deletions cmake/FindPythonInterp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Compatibility wrapper for CMake > 3.12 where FindPythonInterp is deprecated/removed
# This allows external projects using the old module to work with newer CMake and Python3

find_package(Python3 COMPONENTS Interpreter QUIET)

if(Python3_Interpreter_FOUND)
set(PYTHONINTERP_FOUND TRUE)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
set(PYTHON_VERSION_STRING ${Python3_VERSION})
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR})
set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH})

if(NOT PythonInterp_FIND_QUIETLY)
message(STATUS "Found PythonInterp (via Python3): ${PYTHON_EXECUTABLE} (found version \"${PYTHON_VERSION_STRING}\")")
endif()
else()
if(PythonInterp_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)")
endif()
endif()
7 changes: 7 additions & 0 deletions cmake/LibElfinSettings.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if(POLICY CMP0148)
cmake_policy(SET CMP0148 OLD)
endif()

# Libelfin requires Threads for dwarf++ library
find_package(Threads REQUIRED)

141 changes: 0 additions & 141 deletions external/libelf/32.fsize.c

This file was deleted.

52 changes: 0 additions & 52 deletions external/libelf/32.getehdr.c

This file was deleted.

52 changes: 0 additions & 52 deletions external/libelf/32.getphdr.c

This file was deleted.

57 changes: 0 additions & 57 deletions external/libelf/32.getshdr.c

This file was deleted.

Loading
Loading