Skip to content

Commit 3ac1465

Browse files
committed
Merge bitcoin#30198: depends: qt 5.15.14 and fix macOS build with Clang 18
0a3631f depends: fix Qt macOS build with Clang 18 (fanquake) b018bd7 depends: qt 5.15.14 (fanquake) Pull request description: Also adds a patch to Qts internal libpng, to fix compilation using Clang 18, when targetting macOS. I'd like to get this patched, so we can continue working on removing `FORCE_USE_SYSTEM_CLANG` (bitcoin#30201); otherwise builds will be broken using the default Clang (`18`) on the current Ubuntu LTS (`24.04`). With this PR, anyone using Ubuntu 24.04 should be able to `apt install clang llvm lld`, and then cross-compile for macOS using: ```bash # clang --version Ubuntu clang version 18.1.3 (1) make -C depends HOST=arm64-apple-darwin FORCE_USE_SYSTEM_CLANG=1 ./autogen.sh CONFIG_SITE=/path/to/depends/arm64-apple-darwin/share/config.site ./configure make # file src/qt/bitcoin-qt src/qt/bitcoin-qt: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|WEAK_DEFINES|BINDS_TO_WEAK|PIE|HAS_TLV_DESCRIPTORS> ``` ACKs for top commit: TheCharlatan: ACK 0a3631f theuni: utACK 0a3631f hebasto: ACK 0a3631f, a new patch indeed fixes cross-compiling on Ubuntu 24.04 with `FORCE_USE_SYSTEM_CLANG=1`. Tree-SHA512: 711d321b1efbb1aeef802d1d7e72fff8f4e28aa2420d19df9db6f4449fc7d281e1d08ba242ce20122dfe21129e713bd59e7e6ade0b67d7271eea18b39ceb9283
2 parents 62f7f59 + 0a3631f commit 3ac1465

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

depends/packages/qt.mk

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package=qt
2-
$(package)_version=5.15.13
2+
$(package)_version=5.15.14
33
$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules
44
$(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz
55
$(package)_file_name=qtbase-$($(package)_suffix)
6-
$(package)_sha256_hash=4cca51dcc1f22ceeee6b3e33cd1c3a60b14e85e24644dca3af89a2c2989ab809
6+
$(package)_sha256_hash=500d3b390048e9538c28b5f523dfea6936f9c2e10d24ab46580ff57d430b98be
77
$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm
88
$(package)_qt_libs=corelib network widgets gui plugins testlib
99
$(package)_linguist_tools = lrelease lupdate lconvert
@@ -20,15 +20,16 @@ $(package)_patches += duplicate_lcqpafonts.patch
2020
$(package)_patches += guix_cross_lib_path.patch
2121
$(package)_patches += fix-macos-linker.patch
2222
$(package)_patches += memory_resource.patch
23+
$(package)_patches += clang_18_libpng.patch
2324
$(package)_patches += utc_from_string_no_optimize.patch
2425
$(package)_patches += windows_lto.patch
2526
$(package)_patches += zlib-timebits64.patch
2627

2728
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
28-
$(package)_qttranslations_sha256_hash=24d4c58bc2a40c0f44f59ee64af4192c7d0038c1e45af61646cfc5b65058f271
29+
$(package)_qttranslations_sha256_hash=5b94d1a11b566908622fcca2f8b799744d2f8a68da20be4caa5953ed63b10489
2930

3031
$(package)_qttools_file_name=qttools-$($(package)_suffix)
31-
$(package)_qttools_sha256_hash=57c9794c572c4e02871f2e7581525752b0cf85ea16cfab23a4ac9ba7b39a5d34
32+
$(package)_qttools_sha256_hash=12061a85baf5f4de8fbc795e1d3872b706f340211b9e70962caeffc6f5e89563
3233

3334
$(package)_extra_sources = $($(package)_qttranslations_file_name)
3435
$(package)_extra_sources += $($(package)_qttools_file_name)
@@ -229,6 +230,7 @@ define $(package)_preprocess_cmds
229230
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
230231
patch -p1 -i $($(package)_patch_dir)/memory_resource.patch && \
231232
patch -p1 -i $($(package)_patch_dir)/no_warnings_for_symbols.patch && \
233+
patch -p1 -i $($(package)_patch_dir)/clang_18_libpng.patch && \
232234
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
233235
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
234236
patch -p1 -i $($(package)_patch_dir)/utc_from_string_no_optimize.patch && \
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
fix Qt macOS build with Clang 18
2+
3+
See:
4+
https://github.com/pnggroup/libpng/commit/893b8113f04d408cc6177c6de19c9889a48faa24.
5+
6+
In a similar manner as zlib (madler/zlib#895),
7+
libpng contains a header configuration that's no longer valid and
8+
hasn't been exercised for the macOS target.
9+
10+
- The target OS conditional macros are misused. Specifically
11+
`TARGET_OS_MAC` covers all Apple targets, including iOS, and it
12+
should not be checked with `#if defined` as they would always be
13+
defined (to either 1 or 0) on Apple platforms.
14+
- `#include <fp.h>` no longer works for the macOS target and results
15+
in a compilation failure. macOS ships all required functions in
16+
`math.h`, and clients should use `math.h` instead.
17+
18+
--- a/qtbase/src/3rdparty/libpng/pngpriv.h
19+
+++ b/qtbase/src/3rdparty/libpng/pngpriv.h
20+
@@ -514,18 +514,8 @@
21+
*/
22+
# include <float.h>
23+
24+
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
25+
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
26+
- /* We need to check that <math.h> hasn't already been included earlier
27+
- * as it seems it doesn't agree with <fp.h>, yet we should really use
28+
- * <fp.h> if possible.
29+
- */
30+
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
31+
-# include <fp.h>
32+
-# endif
33+
-# else
34+
-# include <math.h>
35+
-# endif
36+
+# include <math.h>
37+
+
38+
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
39+
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
40+
* MATH=68881

0 commit comments

Comments
 (0)