From 551e13abf82522bad7fdde4ff4bd15d2c8f88b23 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 2 Apr 2025 09:15:01 +0100 Subject: [PATCH] guix: Adjust for Qt 6 1. Do not set `C{PLUS}_INCLUDE_PATH` variables The build system for Qt 6 differs entirely from that of Qt 5. Building a set of native Qt 6 tools now forms a separate step when cross-compiling. Under these new circumstances, the `C{PLUS}_INCLUDE_PATH` environment variables may alter the default include directories for both native and cross compilers. Previously, we explicitly unset these variables when invoking clang for cross-compiling; however, that approach proved suboptimal (see #30451). This change sets the native toolchain for dependencies explicitly, rather than relying on the `C{PLUS}_INCLUDE_PATH` environment variables. Additionally, it facilitates the transition towards using clang for building native tools when cross-compiling for macOS. 2. Add `ninja` package. 3. Adjust allowed symbol lists. --- contrib/devtools/symbol-check.py | 16 +++++++++++++++- contrib/guix/libexec/build.sh | 9 +++++---- contrib/guix/manifest.scm | 2 ++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 564f1db5ac0..17ea6d60e54 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -112,6 +112,7 @@ ELF_ALLOWED_LIBRARIES = { 'libfontconfig.so.1', # font support 'libfreetype.so.6', # font parsing 'libdl.so.2', # programming interface to dynamic linker +'libxcb-cursor.so.0', 'libxcb-icccm.so.4', 'libxcb-image.so.0', 'libxcb-shm.so.0', @@ -146,8 +147,9 @@ MACHO_ALLOWED_LIBRARIES = { 'IOSurface', # cross process image/drawing buffers 'libobjc.A.dylib', # Objective-C runtime library 'Metal', # 3D graphics -'Security', # access control and authentication 'QuartzCore', # animation +'Security', # access control and authentication +'UniformTypeIdentifiers', # collection of types that map to MIME and file types } PE_ALLOWED_LIBRARIES = { @@ -158,7 +160,17 @@ PE_ALLOWED_LIBRARIES = { 'SHELL32.dll', # shell API 'WS2_32.dll', # sockets # bitcoin-qt only +'api-ms-win-core-synch-l1-2-0.dll', # Synchronization Primitives API +'api-ms-win-core-winrt-l1-1-0.dll', # Windows Runtime API +'api-ms-win-core-winrt-string-l1-1-0.dll', # WinRT String API +'AUTHZ.dll', # Windows Authorization Framework +'comdlg32.dll', # Common Dialog Box Library +'d3d11.dll', # Direct3D 11 API +'d3d12.dll', # Direct3D 12 API +'d3d9.dll', # Direct3D 9 API 'dwmapi.dll', # desktop window manager +'DWrite.dll', # DirectX Typography Services +'dxgi.dll', # DirectX Graphics Infrastructure 'GDI32.dll', # graphics device interface 'IMM32.dll', # input method editor 'NETAPI32.dll', # network management @@ -171,6 +183,8 @@ PE_ALLOWED_LIBRARIES = { 'VERSION.dll', # version checking 'WINMM.dll', # WinMM audio API 'WTSAPI32.dll', # Remote Desktop +'SETUPAPI.dll', # Windows Setup API +'SHCORE.dll', # Stream Handler Core } def check_version(max_versions, version, arch) -> bool: diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 389706a8cf4..26180bae24b 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -69,8 +69,9 @@ unset CPLUS_INCLUDE_PATH unset OBJC_INCLUDE_PATH unset OBJCPLUS_INCLUDE_PATH -export C_INCLUDE_PATH="${NATIVE_GCC}/include" -export CPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include" +# Set native toolchain +build_CC="${NATIVE_GCC}/bin/gcc -isystem ${NATIVE_GCC}/include" +build_CXX="${NATIVE_GCC}/bin/g++ -isystem ${NATIVE_GCC}/include/c++ -isystem ${NATIVE_GCC}/include" case "$HOST" in *darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;; # Required for qt/qmake @@ -171,6 +172,8 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \ ${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \ ${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \ ${SDK_PATH+SDK_PATH="$SDK_PATH"} \ + ${build_CC+build_CC="$build_CC"} \ + ${build_CXX+build_CXX="$build_CXX"} \ x86_64_linux_CC=x86_64-linux-gnu-gcc \ x86_64_linux_CXX=x86_64-linux-gnu-g++ \ x86_64_linux_AR=x86_64-linux-gnu-gcc-ar \ @@ -181,8 +184,6 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \ case "$HOST" in *darwin*) # Unset now that Qt is built - unset C_INCLUDE_PATH - unset CPLUS_INCLUDE_PATH unset LIBRARY_PATH ;; esac diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 4e7e9552182..c1e72bd1e64 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -13,6 +13,7 @@ ((gnu packages linux) #:select (linux-libre-headers-6.1)) (gnu packages llvm) (gnu packages mingw) + (gnu packages ninja) (gnu packages pkg-config) ((gnu packages python) #:select (python-minimal)) ((gnu packages python-build) #:select (python-tomli python-poetry-core)) @@ -547,6 +548,7 @@ inspecting signatures in Mach-O binaries.") gcc-toolchain-13 cmake-minimal gnu-make + ninja ;; Scripting python-minimal ;; (3.10) ;; Git