'Generic Commit'
Some checks failed
dropshell-build / build (push) Failing after 1m25s

This commit is contained in:
Your Name 2025-06-02 23:38:28 +12:00
parent d8108ca75d
commit 25fa5be7e1
4 changed files with 107 additions and 4 deletions

View File

@ -79,8 +79,24 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
GIT_TAG v0.8.3
)
FetchContent_MakeAvailable(cpptrace)
# Explicitly configure cpptrace to use libunwind
set(CPPTRACE_UNWIND_WITH_LIBUNWIND ON CACHE BOOL "Use libunwind for unwinding" FORCE)
set(CPPTRACE_UNWIND_WITH_UNWIND OFF CACHE BOOL "Disable libgcc unwind" FORCE)
set(CPPTRACE_UNWIND_WITH_EXECINFO OFF CACHE BOOL "Disable execinfo" FORCE)
set(CPPTRACE_UNWIND_WITH_WINAPI OFF CACHE BOOL "Disable winapi" FORCE)
set(CPPTRACE_UNWIND_WITH_DBGHELP OFF CACHE BOOL "Disable dbghelp" FORCE)
set(CPPTRACE_UNWIND_WITH_NOTHING OFF CACHE BOOL "Disable nothing backend" FORCE)
# Disable cpptrace auto-configuration
set(CPPTRACE_NO_AUTO_CONFIG ON CACHE BOOL "Disable cpptrace auto-configuration" FORCE)
# Explicitly set libunwind paths
set(LibUnwind_INCLUDE_DIR "${CMAKE_SYSROOT}/usr/include" CACHE PATH "libunwind include directory" FORCE)
set(LibUnwind_LIBRARY "${CMAKE_SYSROOT}/usr/lib/libunwind.a" CACHE FILEPATH "libunwind library" FORCE)
set(LibUnwind_FOUND TRUE CACHE BOOL "libunwind found" FORCE)
FetchContent_MakeAvailable(cpptrace)
# Add nlohmann/json
FetchContent_Declare(
nlohmann_json
@ -92,8 +108,8 @@ FetchContent_MakeAvailable(nlohmann_json)
# Link libraries
target_link_libraries(${PROJECT_EXE_NAME} PRIVATE
libassert::assert
"${CMAKE_SYSROOT}/usr/lib/libunwind.a"
cpptrace::cpptrace
"${CMAKE_SYSROOT}/usr/lib/libunwind.a"
nlohmann_json::nlohmann_json
)

View File

@ -184,7 +184,8 @@ function build_arch() {
-DCMAKE_PREFIX_PATH="${ARCH_SYSROOT}/usr" \
-DCMAKE_LIBRARY_PATH="${ARCH_SYSROOT}/usr/lib" \
-DCMAKE_LIBRARY_PATH="${ARCH_SYSROOT}/usr/lib64" \
-DCMAKE_INCLUDE_PATH="${ARCH_SYSROOT}/usr/include"
-DCMAKE_INCLUDE_PATH="${ARCH_SYSROOT}/usr/include" \
-DCPPTRACE_STATIC_DEFINE="true"
cd "${ARCH_BUILD_DIR}" || exit 1
ninja -k0 -j"${JOBS}"

View File

@ -129,7 +129,7 @@ function check_packages() {
# }
#----------------------------------------------------------------------------------------------------------
# unwind for musl cross toolchains
# set_current_arch
#----------------------------------------------------------------------------------------------------------
function set_current_arch() {
@ -188,6 +188,10 @@ function set_current_arch() {
export MAKEFLAGS="-j${JOBS}"
}
#----------------------------------------------------------------------------------------------------------
# unwind for musl cross toolchains
#----------------------------------------------------------------------------------------------------------
function install_unwind_musl() {
set_current_arch "$1"
@ -219,6 +223,84 @@ function install_unwind_musl() {
rm -rf "$BUILD_DIR"
}
#----------------------------------------------------------------------------------------------------------
# libassert for musl cross toolchains
#----------------------------------------------------------------------------------------------------------
function install_libassert_musl() {
local TOOLCHAIN="$1"
set_current_arch "$TOOLCHAIN"
echo "Installing libassert for ${ARCH}"
local BUILD_DIR="/tmp/libassert-build-${ARCH}"
rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
pushd "${BUILD_DIR}"
git clone --depth 1 --branch v2.1.5 https://github.com/jeremy-rifkin/libassert.git .
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSROOT="${ARCH_SYSROOT}" \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_INSTALL_PREFIX="${ARCH_SYSROOT}/usr" \
-DBUILD_SHARED_LIBS=OFF
make
make install
popd
rm -rf "${BUILD_DIR}"
}
#----------------------------------------------------------------------------------------------------------
# cpptrace for musl cross toolchains
#----------------------------------------------------------------------------------------------------------
function install_cpptrace_musl() {
local TOOLCHAIN="$1"
set_current_arch "$TOOLCHAIN"
echo "Installing cpptrace for ${ARCH}"
local BUILD_DIR="/tmp/cpptrace-build-${ARCH}"
rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
pushd "${BUILD_DIR}"
git clone --depth 1 --branch v0.8.3 https://github.com/jeremy-rifkin/cpptrace.git .
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSROOT="${ARCH_SYSROOT}" \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DCMAKE_INSTALL_PREFIX="${ARCH_SYSROOT}/usr" \
-DCPPTRACE_UNWIND_WITH_LIBUNWIND=ON \
-DCPPTRACE_UNWIND_WITH_UNWIND=OFF \
-DCPPTRACE_UNWIND_WITH_EXECINFO=OFF \
-DCPPTRACE_UNWIND_WITH_WINAPI=OFF \
-DCPPTRACE_UNWIND_WITH_DBGHELP=OFF \
-DCPPTRACE_UNWIND_WITH_NOTHING=OFF \
-DCPPTRACE_NO_AUTO_CONFIG=ON \
-DLibUnwind_INCLUDE_DIR="${ARCH_SYSROOT}/usr/include" \
-DLibUnwind_LIBRARY="${ARCH_SYSROOT}/usr/lib/libunwind.a" \
-DLibUnwind_FOUND=TRUE \
-DBUILD_SHARED_LIBS=OFF \
-DCPPTRACE_STATIC_DEFINE=ON
make -j$(nproc)
make install
popd
rm -rf "${BUILD_DIR}"
}
#----------------------------------------------------------------------------------------------------------
# OpenSSL for musl cross toolchains
#----------------------------------------------------------------------------------------------------------
@ -330,6 +412,8 @@ function install_musl() {
install_openssl_musl "$TOOLCHAIN"
install_unwind_musl "$TOOLCHAIN"
install_libassert_musl "$TOOLCHAIN"
install_cpptrace_musl "$TOOLCHAIN"
done
# Clean up

View File

@ -6,6 +6,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo "Testing dropshell-build"
rm -rf "${SCRIPT_DIR}/ipdemo/build"
DROPSHELL_BUILD_TAG="test" "${SCRIPT_DIR}/src/dropshell-build" -r -m "${SCRIPT_DIR}/ipdemo"
"${SCRIPT_DIR}/ipdemo/output/ipdemo.x86_64"