build: revert strtold workarounds — GCC cstdlib fix is the root fix
Remove per-package workarounds that were needed before the root-cause fix in mk/prefix.mk (which adds #include <stdlib.h> to GCC's <cstdlib> header at prefix build time). The cstdlib fix makes strtold visible globally, so per-recipe -include stdlib.h and P1-*.patch are redundant. Reverted: - redox-toolchain.cmake: removed -include stdlib.h and PCH disable - kf6-ki18n: restored full build (removed stub recipe + P1 patch) - kf6-ki18n: removed ECM version sed (ECM bumped to 6.11.0 already) - redbear-greeter: removed #include <stdlib.h> workarounds in source - local/patches/kf6-ki18n/: removed unused P1 patch directory
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
--- a/src/i18n/common_helpers_p.h
|
||||
+++ b/src/i18n/common_helpers_p.h
|
||||
@@ -7,6 +7,10 @@
|
||||
#ifndef COMMON_HELPERS_P_H
|
||||
#define COMMON_HELPERS_P_H
|
||||
|
||||
+// Ensure C99 stdlib declarations (strtold etc.) are visible before
|
||||
+// Qt headers pull in <cstdlib>. relibc declares strtold via cbindgen
|
||||
+// trailer; GCC <cstdlib> needs it in :: scope.
|
||||
+#include <stdlib.h>
|
||||
#include <QString>
|
||||
|
||||
// Standalone (pure Qt) functionality needed internally in more than
|
||||
@@ -1 +0,0 @@
|
||||
../../../../local/patches/kf6-ki18n/P1-strtold-include.patch
|
||||
@@ -1,9 +1,6 @@
|
||||
#TODO: KI18n — internationalization framework, gettext integration. Depends on qtbase, qtdeclarative, kf6-extra-cmake-modules.
|
||||
[source]
|
||||
tar = "https://invent.kde.org/frameworks/ki18n/-/archive/v6.10.0/ki18n-v6.10.0.tar.gz"
|
||||
patches = [
|
||||
"P1-strtold-include.patch",
|
||||
]
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
@@ -20,30 +17,42 @@ source "${COOKBOOK_ROOT}/local/scripts/lib/qt-sysroot.sh"
|
||||
|
||||
redbear_qt_link_sysroot_dirs "${COOKBOOK_SYSROOT}" plugins mkspecs metatypes modules
|
||||
|
||||
# Build a minimal cmake-only package. Actual i18n library blocked by
|
||||
# strtold visibility (GCC <cstdlib> ::strtold not found in relibc).
|
||||
# This provides KF6I18nConfig.cmake so dependents can configure.
|
||||
# ECMGenerateQDoc requires Qt6Tools which we don't build. Remove.
|
||||
find "${COOKBOOK_SOURCE}" -name "CMakeLists.txt" -exec sed -i '/include(ECMGenerateQDoc)/d; /ecm_generate_qdoc/d' {} +
|
||||
# ki18n_install(po) tries to build translation files; skip for cross-compile.
|
||||
sed -i 's/^ki18n_install(po)/#ki18n_install(po)/' \
|
||||
"${COOKBOOK_SOURCE}/CMakeLists.txt" 2>/dev/null || true
|
||||
# i18n-qml is needed by KNewStuffWidgets. Disable localedata-qml (runtime data unpackage).
|
||||
sed -i 's/^# add_subdirectory(i18n-qml)/ add_subdirectory(i18n-qml)/' \
|
||||
"${COOKBOOK_SOURCE}/src/CMakeLists.txt" 2>/dev/null || true
|
||||
sed -i 's/^ add_subdirectory(localedata-qml)/# add_subdirectory(localedata-qml)/' \
|
||||
"${COOKBOOK_SOURCE}/src/CMakeLists.txt" 2>/dev/null || true
|
||||
|
||||
mkdir -p "${COOKBOOK_STAGE}/usr/lib/cmake/KF6I18n"
|
||||
cat > "${COOKBOOK_STAGE}/usr/lib/cmake/KF6I18n/KF6I18nConfig.cmake" << 'CMEOF'
|
||||
set(KF6I18n_VERSION "6.10.0")
|
||||
set(KF6I18n_FOUND TRUE)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/KF6I18nTargets.cmake")
|
||||
CMEOF
|
||||
cat > "${COOKBOOK_STAGE}/usr/lib/cmake/KF6I18n/KF6I18nTargets.cmake" << 'CMEOF'
|
||||
if(NOT TARGET KF6::I18n)
|
||||
add_library(KF6::I18n SHARED IMPORTED)
|
||||
set_target_properties(KF6::I18n PROPERTIES
|
||||
IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/../../libKF6I18n.so"
|
||||
)
|
||||
endif()
|
||||
CMEOF
|
||||
cat > "${COOKBOOK_STAGE}/usr/lib/cmake/KF6I18n/KF6I18nConfigVersion.cmake" << 'CMEOF'
|
||||
set(PACKAGE_VERSION "6.10.0")
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
CMEOF
|
||||
# Create a stub .so for package dependency resolution
|
||||
mkdir -p "${COOKBOOK_STAGE}/usr/lib"
|
||||
touch "${COOKBOOK_STAGE}/usr/lib/libKF6I18n.so"
|
||||
"""
|
||||
rm -f CMakeCache.txt
|
||||
rm -rf CMakeFiles
|
||||
|
||||
export LDFLAGS+=" -liconv"
|
||||
|
||||
cmake "${COOKBOOK_SOURCE}" \
|
||||
-DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \
|
||||
-DQT_HOST_PATH="${HOST_BUILD}" \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
|
||||
-DCMAKE_C_STANDARD_LIBRARIES="-liconv" \
|
||||
-DCMAKE_CXX_STANDARD_LIBRARIES="-liconv" \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS="-liconv" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-liconv" \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DBUILD_QCH=OFF \
|
||||
-DBUILD_WITH_QML=ON \
|
||||
-Wno-dev
|
||||
|
||||
cmake --build . -j${COOKBOOK_MAKE_JOBS}
|
||||
cmake --install . --prefix "${COOKBOOK_STAGE}/usr"
|
||||
|
||||
for lib in "${COOKBOOK_STAGE}/usr/lib/"libKF6*.so.*; do
|
||||
[ -f "${lib}" ] || continue
|
||||
patchelf --remove-rpath "${lib}" 2>/dev/null || true
|
||||
done
|
||||
"""
|
||||
@@ -42,13 +42,10 @@ set(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
# Redox userspace currently must not emit CET/IBT entry instructions (endbr64),
|
||||
# because they trap as invalid opcode in the current runtime stack.
|
||||
set(CMAKE_C_FLAGS "-fcf-protection=none -march=x86-64 -include strings.h -include stdlib.h" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "-fcf-protection=none -march=x86-64 -fpermissive -include strings.h -include stdlib.h -I${COOKBOOK_SYSROOT}/usr/include/QtQml -I${COOKBOOK_SYSROOT}/usr/include/QtQuick" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE "-fcf-protection=none -march=x86-64 -include strings.h -include stdlib.h" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-fcf-protection=none -march=x86-64 -fpermissive -include strings.h -include stdlib.h" CACHE STRING "" FORCE)
|
||||
# Disable precompiled headers — PCH compiles without -include flags,
|
||||
# missing C99 stdlib declarations (strtold) needed by GCC <cstdlib>.
|
||||
set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON CACHE BOOL "" FORCE)
|
||||
set(CMAKE_C_FLAGS "-fcf-protection=none -march=x86-64 -include strings.h" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "-fcf-protection=none -march=x86-64 -fpermissive -include strings.h -I${COOKBOOK_SYSROOT}/usr/include/QtQml -I${COOKBOOK_SYSROOT}/usr/include/QtQuick" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE "-fcf-protection=none -march=x86-64 -include strings.h" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-fcf-protection=none -march=x86-64 -fpermissive -include strings.h" CACHE STRING "" FORCE)
|
||||
|
||||
# Flag for redox.patch: enables REDOX-specific CMake code paths (mkspec, QPA plugin).
|
||||
# QtPlatformSupport.cmake checks this variable. Set as CACHE INTERNAL so it persists
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <stdlib.h>
|
||||
#include "greeter_backend.h"
|
||||
|
||||
#include <QByteArray>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <stdlib.h>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
|
||||
Reference in New Issue
Block a user