Advance redbear-full Wayland, greeter, and Qt integration
Consolidate the active desktop path around redbear-full while landing the greeter/session stack and the runtime fixes needed to keep Wayland and KWin bring-up moving forward.
This commit is contained in:
@@ -19,8 +19,39 @@ dependencies = [
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
RELIBC_STAGE_INCLUDE="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage/usr/include"
|
||||
RELIBC_STAGE_LIB="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage/usr/lib"
|
||||
RELIBC_STAGE_INCLUDE_STAGE="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage/usr/include"
|
||||
RELIBC_STAGE_INCLUDE_TMP="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage.tmp/usr/include"
|
||||
RELIBC_STAGE_LIB_STAGE="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage/usr/lib"
|
||||
RELIBC_STAGE_LIB_TMP="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage.tmp/usr/lib"
|
||||
RELIBC_BUILD_LIB="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/build/target/${TARGET}/release"
|
||||
|
||||
RELIBC_STAGE_INCLUDE="$RELIBC_STAGE_INCLUDE_STAGE"
|
||||
if [ ! -d "$RELIBC_STAGE_INCLUDE" ] && [ -d "$RELIBC_STAGE_INCLUDE_TMP" ]; then
|
||||
RELIBC_STAGE_INCLUDE="$RELIBC_STAGE_INCLUDE_TMP"
|
||||
fi
|
||||
|
||||
choose_relibc_lib_stage() {
|
||||
local candidate="$1"
|
||||
if [ -f "$candidate/libc.so" ] && readelf -Ws "$candidate/libc.so" | grep -q '_Z7strtoldPKcPPc'; then
|
||||
printf '%s\n' "$candidate"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
if RELIBC_STAGE_LIB="$(choose_relibc_lib_stage "$RELIBC_STAGE_LIB_STAGE")"; then
|
||||
:
|
||||
elif RELIBC_STAGE_LIB="$(choose_relibc_lib_stage "$RELIBC_STAGE_LIB_TMP")"; then
|
||||
:
|
||||
elif RELIBC_STAGE_LIB="$(choose_relibc_lib_stage "$RELIBC_BUILD_LIB")"; then
|
||||
:
|
||||
elif [ -d "$RELIBC_STAGE_LIB_STAGE" ]; then
|
||||
RELIBC_STAGE_LIB="$RELIBC_STAGE_LIB_STAGE"
|
||||
elif [ -d "$RELIBC_BUILD_LIB" ]; then
|
||||
RELIBC_STAGE_LIB="$RELIBC_BUILD_LIB"
|
||||
else
|
||||
RELIBC_STAGE_LIB="$RELIBC_STAGE_LIB_TMP"
|
||||
fi
|
||||
if [ -d "${RELIBC_STAGE_INCLUDE}" ]; then
|
||||
mkdir -p "${COOKBOOK_SYSROOT}/include"
|
||||
cp -a "${RELIBC_STAGE_INCLUDE}/." "${COOKBOOK_SYSROOT}/include/"
|
||||
@@ -34,6 +65,24 @@ if [ -d "${RELIBC_STAGE_LIB}" ]; then
|
||||
export LDFLAGS="-L${RELIBC_STAGE_LIB} -Wl,-rpath-link,${RELIBC_STAGE_LIB} ${LDFLAGS}"
|
||||
fi
|
||||
|
||||
cat > strtold_cpp_compat.c <<'EOF'
|
||||
long double strtold(const char *nptr, char **endptr);
|
||||
|
||||
long double relibc_compat_cpp_strtold(const char *nptr, char **endptr)
|
||||
__asm__("_Z7strtoldPKcPPc");
|
||||
|
||||
long double relibc_compat_cpp_strtold(const char *nptr, char **endptr) {
|
||||
return strtold(nptr, endptr);
|
||||
}
|
||||
EOF
|
||||
"${GNU_TARGET}-gcc" \
|
||||
--sysroot="${COOKBOOK_SYSROOT}" \
|
||||
-shared -fPIC strtold_cpp_compat.c \
|
||||
-o "${COOKBOOK_SYSROOT}/lib/libredbear-qt-strtold-compat.so"
|
||||
mkdir -p "${COOKBOOK_STAGE}/usr/lib"
|
||||
cp -f "${COOKBOOK_SYSROOT}/lib/libredbear-qt-strtold-compat.so" "${COOKBOOK_STAGE}/usr/lib/"
|
||||
export LDFLAGS="${LDFLAGS} -Wl,--no-as-needed -L${COOKBOOK_SYSROOT}/lib -lredbear-qt-strtold-compat"
|
||||
|
||||
export CFLAGS="${CFLAGS} -fcf-protection=none"
|
||||
export CXXFLAGS="${CXXFLAGS} -fcf-protection=none"
|
||||
|
||||
|
||||
@@ -320,17 +320,76 @@ diff -ruwN source-old/src/corelib/plugin/qelfparser_p.cpp source/src/corelib/plu
|
||||
return header.e_version == EV_CURRENT;
|
||||
}
|
||||
|
||||
@@ -742,7 +752,9 @@
|
||||
|
||||
qEDebug << ElfHeaderDebug{ reinterpret_cast<const uchar *>(data.data()) };
|
||||
|
||||
- auto header = reinterpret_cast<const T::Ehdr *>(data.data());
|
||||
+ typename T::Ehdr headerStorage;
|
||||
+ memcpy(&headerStorage, data.data(), sizeof(headerStorage));
|
||||
+ const auto header = &headerStorage;
|
||||
if (!ElfHeaderCheck<>::checkHeader(*header))
|
||||
return error(ElfHeaderCheck<>::explainCheckFailure(*header));
|
||||
|
||||
diff -ruwN source-old/src/corelib/plugin/qlibrary.cpp source/src/corelib/plugin/qlibrary.cpp
|
||||
--- source-old/src/corelib/plugin/qlibrary.cpp 2024-12-02 05:39:06.000000000 +0000
|
||||
+++ source/src/corelib/plugin/qlibrary.cpp 2026-04-16 00:00:00.000000000 +0000
|
||||
@@ -232,24 +232,37 @@
|
||||
+++ source/src/corelib/plugin/qlibrary.cpp 2026-04-19 00:00:00.000000000 +0000
|
||||
@@ -17,6 +17,10 @@
|
||||
#include <qoperatingsystemversion.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
+#ifdef Q_OS_REDOX
|
||||
+# include <unistd.h>
|
||||
+#endif
|
||||
+
|
||||
#ifdef Q_OS_DARWIN
|
||||
# include <private/qcore_mac_p.h>
|
||||
#endif
|
||||
@@ -176,7 +180,14 @@
|
||||
to it being used in the plugin in the first place.
|
||||
*/
|
||||
#if defined(Q_OF_ELF)
|
||||
+# if defined(Q_OS_REDOX)
|
||||
+ // Redox currently reaches the plugin file successfully but the ELF-specific
|
||||
+ // metadata parser misreads shared plugins inside the guest runtime. Fall
|
||||
+ // back to the generic QTMETADATA search path until the Redox ELF loader /
|
||||
+ // parser path is trustworthy again.
|
||||
+# else
|
||||
return QElfParser::parse({s, s_len}, errMsg);
|
||||
+# endif
|
||||
#elif defined(Q_OF_MACH_O)
|
||||
return QMachOParser::parse(s, s_len, errMsg);
|
||||
#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
|
||||
@@ -230,7 +234,41 @@
|
||||
Q_INT64_C(1) << (sizeof(qsizetype) > 4 ? 40 : 29);
|
||||
|
||||
qsizetype fdlen = qMin(file.size(), MaxMemoryMapSize);
|
||||
- const char *filedata = reinterpret_cast<char *>(file.map(0, fdlen));
|
||||
+ const char *filedata = nullptr;
|
||||
+ QByteArray data;
|
||||
+
|
||||
+#ifdef Q_OS_REDOX
|
||||
+ data = file.read(qMin<qsizetype>(fdlen, 64 * 1024 * 1024));
|
||||
+ const qsizetype readLimit = qMin<qsizetype>(fdlen, 64 * 1024 * 1024);
|
||||
+ data.resize(readLimit);
|
||||
+ qsizetype total = 0;
|
||||
+ const int fd = file.handle();
|
||||
+ if (fd < 0) {
|
||||
+ qCWarning(qt_lcDebugPlugins, "%ls: failed to acquire file descriptor: %ls",
|
||||
+ qUtf16Printable(library), qUtf16Printable(file.errorString()));
|
||||
+ return {};
|
||||
+ }
|
||||
+ while (total < readLimit) {
|
||||
+ const qint64 chunk = ::pread(fd, data.data() + total, size_t(readLimit - total), off_t(total));
|
||||
+ if (chunk < 0) {
|
||||
+ qCWarning(qt_lcDebugPlugins, "%ls: failed to pread for metadata scan: %ls",
|
||||
+ qUtf16Printable(library), qUtf16Printable(qt_error_string(errno)));
|
||||
+ return {};
|
||||
+ }
|
||||
+ if (chunk == 0)
|
||||
+ break;
|
||||
+ total += chunk;
|
||||
+ }
|
||||
+ data.truncate(total);
|
||||
+ filedata = data.constData();
|
||||
+ fdlen = data.size();
|
||||
+ if (filedata == nullptr || fdlen == 0) {
|
||||
@@ -344,10 +403,7 @@ diff -ruwN source-old/src/corelib/plugin/qlibrary.cpp source/src/corelib/plugin/
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
if (filedata == nullptr) {
|
||||
// If we can't mmap(), then the dynamic loader won't be able to either.
|
||||
// This can't be used as a plugin.
|
||||
qCWarning(qt_lcDebugPlugins, "%ls: failed to map to memory: %ls",
|
||||
qUtf16Printable(library), qUtf16Printable(file.errorString()));
|
||||
@@ -241,7 +279,6 @@
|
||||
return {};
|
||||
}
|
||||
#else
|
||||
@@ -355,14 +411,6 @@ diff -ruwN source-old/src/corelib/plugin/qlibrary.cpp source/src/corelib/plugin/
|
||||
if (filedata == nullptr) {
|
||||
// It's unknown at this point whether Windows supports LoadLibrary() on
|
||||
// files that fail to CreateFileMapping / MapViewOfFile, so we err on
|
||||
// the side of doing a regular read into memory (up to 64 MB).
|
||||
data = file.read(64 * 1024 * 1024);
|
||||
filedata = data.constData();
|
||||
fdlen = data.size();
|
||||
}
|
||||
#endif
|
||||
|
||||
QString errMsg = library;
|
||||
|
||||
diff -ruwN source-old/src/corelib/global/qsimd.cpp source/src/corelib/global/qsimd.cpp
|
||||
--- source-old/src/corelib/global/qsimd.cpp 2024-12-02 05:39:06.000000000 +0000
|
||||
|
||||
@@ -226,4 +226,12 @@ if [ -d "${COOKBOOK_STAGE}/usr/qml" ]; then
|
||||
mkdir -p "${SYSROOT}/qml"
|
||||
cp -a "${COOKBOOK_STAGE}/usr/qml/"* "${SYSROOT}/qml/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
for stdlib in \
|
||||
"${COOKBOOK_STAGE}/usr/include/stdlib.h" \
|
||||
"${SYSROOT}/include/stdlib.h" \
|
||||
"${SYSROOT}/usr/include/stdlib.h"; do
|
||||
[ -f "$stdlib" ] || continue
|
||||
sed -i '/strtold[[:space:]]*(/d' "$stdlib" 2>/dev/null || true
|
||||
done
|
||||
"""
|
||||
|
||||
@@ -28,9 +28,9 @@ if [ -d "${QTBASE_BUILD_INCLUDE}/6.11.0/QtGui/rhi" ]; then
|
||||
mkdir -p "${COOKBOOK_SYSROOT}/include"
|
||||
cp -a "${QTBASE_BUILD_INCLUDE}/6.11.0/QtGui/rhi" "${COOKBOOK_SYSROOT}/include/"
|
||||
fi
|
||||
export CPPFLAGS="${CPPFLAGS} -I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui"
|
||||
export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui"
|
||||
export CXXFLAGS="${CXXFLAGS} -I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui"
|
||||
export CPPFLAGS="${CPPFLAGS} -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui"
|
||||
export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui"
|
||||
export CXXFLAGS="${CXXFLAGS} -I${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui"
|
||||
|
||||
python - <<'PY'
|
||||
import os
|
||||
@@ -185,10 +185,10 @@ cmake "${COOKBOOK_SOURCE}" \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
|
||||
-DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES="${COOKBOOK_SYSROOT}/include;${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" \
|
||||
-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES="${COOKBOOK_SYSROOT}/include;${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" \
|
||||
-DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES="${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" \
|
||||
-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES="${COOKBOOK_SYSROOT}/include/QtGui/6.11.0/QtGui" \
|
||||
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS} -I${COOKBOOK_SYSROOT}/include" \
|
||||
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||
-DQT_BUILD_EXAMPLES=OFF \
|
||||
-DQT_BUILD_TESTS=OFF \
|
||||
-DQT_GENERATE_SBOM=OFF \
|
||||
|
||||
Reference in New Issue
Block a user