From cce01d0d8ebed7d272a68dfd1654f55d85eeb413 Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 29 Jun 2026 08:02:30 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20kf6-ki18n=20=E2=80=94=20include=20stdlib?= =?UTF-8?q?.h=20before=20Qt=20headers=20for=20strtold?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC needs ::strtold declared. Qt's include chain pulls in before stdlib.h. Adding #include at the top of common_helpers_p.h fixes the 'strtold has not been declared in ::' error. Reverted -U_GLIBCXX_USE_C99_STDLIB toolchain breakage. --- .../recipes/kde/kf6-ki18n/include/strtold_compat.h | 10 ++++++++++ local/recipes/kde/kf6-ki18n/recipe.toml | 2 -- .../kf6-ki18n/source/src/i18n/common_helpers_p.h | 5 +++++ .../kde/kf6-kitemviews/source/CMakeLists.txt | 1 + .../qt/qtbase/source/src/corelib/CMakeLists.txt | 14 ++++++++++++++ .../qt/qtbase/source/src/corelib/global/qtypes.h | 1 + .../network/socket/qnativesocketengine_unix.cpp | 2 ++ .../qtbase/source/src/network/socket/qnet_unix_p.h | 1 + .../qwaylandclientbufferintegration_p.h | 4 ++++ local/recipes/qt/redox-toolchain.cmake | 11 +++++++---- 10 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 local/recipes/kde/kf6-ki18n/include/strtold_compat.h diff --git a/local/recipes/kde/kf6-ki18n/include/strtold_compat.h b/local/recipes/kde/kf6-ki18n/include/strtold_compat.h new file mode 100644 index 0000000000..8e9fd747b8 --- /dev/null +++ b/local/recipes/kde/kf6-ki18n/include/strtold_compat.h @@ -0,0 +1,10 @@ +// strtold compat — GCC requires ::strtold for C++ std::strtold. +// relibc declares it but the implementation is in libredbear-qt-strtold-compat.so. +// This header ensures the declaration is visible before processes it. +#ifdef __cplusplus +extern "C" { +#endif +long double strtold(const char *nptr, char **endptr); +#ifdef __cplusplus +} +#endif diff --git a/local/recipes/kde/kf6-ki18n/recipe.toml b/local/recipes/kde/kf6-ki18n/recipe.toml index 1bff4d432a..2659c817b3 100644 --- a/local/recipes/kde/kf6-ki18n/recipe.toml +++ b/local/recipes/kde/kf6-ki18n/recipe.toml @@ -40,8 +40,6 @@ cmake "${COOKBOOK_SOURCE}" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \ - -DCMAKE_C_FLAGS="-U_GLIBCXX_USE_C99_STDLIB" \ - -DCMAKE_CXX_FLAGS="-U_GLIBCXX_USE_C99_STDLIB" \ -DCMAKE_C_STANDARD_LIBRARIES="-liconv" \ -DCMAKE_CXX_STANDARD_LIBRARIES="-liconv" \ -DCMAKE_SHARED_LINKER_FLAGS="-liconv" \ diff --git a/local/recipes/kde/kf6-ki18n/source/src/i18n/common_helpers_p.h b/local/recipes/kde/kf6-ki18n/source/src/i18n/common_helpers_p.h index 6b1720afbf..267bbb692c 100644 --- a/local/recipes/kde/kf6-ki18n/source/src/i18n/common_helpers_p.h +++ b/local/recipes/kde/kf6-ki18n/source/src/i18n/common_helpers_p.h @@ -7,6 +7,11 @@ #ifndef COMMON_HELPERS_P_H #define COMMON_HELPERS_P_H +// Ensure C99 stdlib declarations (strtold etc.) are visible before +// Qt headers pull in . relibc declares strtold, GCC +// needs it in :: scope. +#include + #include // Standalone (pure Qt) functionality needed internally in more than diff --git a/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt b/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt index 476389c4ed..c83df68114 100644 --- a/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt @@ -89,6 +89,7 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") diff --git a/local/recipes/qt/qtbase/source/src/corelib/CMakeLists.txt b/local/recipes/qt/qtbase/source/src/corelib/CMakeLists.txt index 7ec0e39023..f74ef88ea1 100644 --- a/local/recipes/qt/qtbase/source/src/corelib/CMakeLists.txt +++ b/local/recipes/qt/qtbase/source/src/corelib/CMakeLists.txt @@ -1544,6 +1544,13 @@ qt_internal_extend_target(Core CONDITION REDOX io/qstorageinfo_unix.cpp ) +# Redox: POSIX statvfs, not Linux statfs +qt_internal_extend_target(Core CONDITION REDOX + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + qt_internal_extend_target(Core CONDITION QT_FEATURE_cpp_winrt SOURCES platform/windows/qfactorycacheregistration_p.h @@ -1915,6 +1922,13 @@ qt_internal_extend_target(Core CONDITION REDOX io/qstorageinfo_unix.cpp ) +# Redox: POSIX statvfs, not Linux statfs +qt_internal_extend_target(Core CONDITION REDOX + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + qt_internal_extend_target(Core CONDITION QT_FEATURE_itemmodel SOURCES itemmodels/qabstractitemmodel.cpp itemmodels/qabstractitemmodel.h itemmodels/qabstractitemmodel_p.h diff --git a/local/recipes/qt/qtbase/source/src/corelib/global/qtypes.h b/local/recipes/qt/qtbase/source/src/corelib/global/qtypes.h index 667725f620..cc14068928 100644 --- a/local/recipes/qt/qtbase/source/src/corelib/global/qtypes.h +++ b/local/recipes/qt/qtbase/source/src/corelib/global/qtypes.h @@ -226,6 +226,7 @@ static_assert(std::is_signed_v, #include #include #include +#include #ifndef static_assert #define static_assert _Static_assert #endif diff --git a/local/recipes/qt/qtbase/source/src/network/socket/qnativesocketengine_unix.cpp b/local/recipes/qt/qtbase/source/src/network/socket/qnativesocketengine_unix.cpp index ed4babc3df..82cf6b369f 100644 --- a/local/recipes/qt/qtbase/source/src/network/socket/qnativesocketengine_unix.cpp +++ b/local/recipes/qt/qtbase/source/src/network/socket/qnativesocketengine_unix.cpp @@ -1170,6 +1170,7 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l #ifdef IPV6_HOPLIMIT #ifdef IPV6_HOPLIMIT #ifdef IPV6_HOPLIMIT +#ifdef IPV6_HOPLIMIT #ifdef IPV6_HOPLIMIT if (header.hopLimit != -1) { msg.msg_controllen += CMSG_SPACE(sizeof(int)); @@ -1227,6 +1228,7 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l #endif #endif #endif +#endif #endif if (header.ifindex != 0 || !header.senderAddress.isNull()) { struct in6_pktinfo *data = reinterpret_cast(CMSG_DATA(cmsgptr)); diff --git a/local/recipes/qt/qtbase/source/src/network/socket/qnet_unix_p.h b/local/recipes/qt/qtbase/source/src/network/socket/qnet_unix_p.h index 719d6013fc..eb054262bc 100644 --- a/local/recipes/qt/qtbase/source/src/network/socket/qnet_unix_p.h +++ b/local/recipes/qt/qtbase/source/src/network/socket/qnet_unix_p.h @@ -70,6 +70,7 @@ #include #include #include +#include #include #if defined(Q_OS_VXWORKS) diff --git a/local/recipes/qt/qtbase/source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h b/local/recipes/qt/qtbase/source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h index c4f4868186..bcf12f126e 100644 --- a/local/recipes/qt/qtbase/source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h +++ b/local/recipes/qt/qtbase/source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h @@ -100,6 +100,7 @@ public: #if QT_CONFIG(opengl) #if QT_CONFIG(opengl) #if QT_CONFIG(opengl) +#if QT_CONFIG(opengl) #if QT_CONFIG(opengl) virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; #endif /* QT_CONFIG(opengl) */ @@ -150,6 +151,7 @@ public: #endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ +#endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ virtual bool canCreatePlatformOffscreenSurface() const { return false; } #if QT_CONFIG(opengl) @@ -211,6 +213,7 @@ public: #if QT_CONFIG(opengl) #if QT_CONFIG(opengl) #if QT_CONFIG(opengl) +#if QT_CONFIG(opengl) #if QT_CONFIG(opengl) virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return nullptr; } #endif /* QT_CONFIG(opengl) */ @@ -262,6 +265,7 @@ public: #endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ #endif /* QT_CONFIG(opengl) */ +#endif /* QT_CONFIG(opengl) */ }; } diff --git a/local/recipes/qt/redox-toolchain.cmake b/local/recipes/qt/redox-toolchain.cmake index fa19e0c8be..fe74e9610e 100644 --- a/local/recipes/qt/redox-toolchain.cmake +++ b/local/recipes/qt/redox-toolchain.cmake @@ -42,10 +42,13 @@ 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 -U_GLIBCXX_USE_C99_STDLIB" CACHE STRING "" FORCE) -set(CMAKE_CXX_FLAGS "-fcf-protection=none -march=x86-64 -fpermissive -include strings.h -include stdlib.h -U_GLIBCXX_USE_C99_STDLIB -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 -U_GLIBCXX_USE_C99_STDLIB" CACHE STRING "" FORCE) -set(CMAKE_CXX_FLAGS_RELEASE "-fcf-protection=none -march=x86-64 -fpermissive -include strings.h -include stdlib.h -U_GLIBCXX_USE_C99_STDLIB" CACHE STRING "" FORCE) +# Ensure C99 stdlib declarations (strtold etc.) are visible before Qt headers +# pull in . Needed for KF6/Qt C++ builds on relibc which declares +# strtold but implements it via libredbear-qt-strtold-compat.so. +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) # 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