Skip to content

Commit c32fa85

Browse files
committed
depends: modify FastFixedDtoa optimisation flags
This fixes a non-determinism issue in the asm produced for this function when cross-compiling on x86_64 and aarch64 for the arm-linux-gnueabihf HOST. Related to #21194.
1 parent 47dad42 commit c32fa85

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

depends/packages/qt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ $(package)_patches += fix_limits_header.patch
2121
$(package)_patches += use_android_ndk23.patch
2222
$(package)_patches += rcc_hardcode_timestamp.patch
2323
$(package)_patches += duplicate_lcqpafonts.patch
24+
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
2425

2526
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
2627
$(package)_qttranslations_sha256_hash=5d7869f670a135ad0986e266813b9dd5bbae2b09577338f9cdf8904d4af52db0
@@ -251,6 +252,7 @@ define $(package)_preprocess_cmds
251252
patch -p1 -i $($(package)_patch_dir)/use_android_ndk23.patch && \
252253
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
253254
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
255+
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
254256
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
255257
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
256258
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Modify the optimisation flags for FastFixedDtoa.
2+
This fixes a non-determinism issue in the asm produced for
3+
this function when cross-compiling on x86_64 and aarch64 for
4+
the arm-linux-gnueabihf HOST.
5+
6+
--- a/qtbase/src/3rdparty/double-conversion/fixed-dtoa.h
7+
+++ b/qtbase/src/3rdparty/double-conversion/fixed-dtoa.h
8+
@@ -48,9 +48,12 @@ namespace double_conversion {
9+
//
10+
// This method only works for some parameters. If it can't handle the input it
11+
// returns false. The output is null-terminated when the function succeeds.
12+
+#pragma GCC push_options
13+
+#pragma GCC optimize ("-O1")
14+
bool FastFixedDtoa(double v, int fractional_count,
15+
Vector<char> buffer, int* length, int* decimal_point);
16+
17+
+#pragma GCC pop_options
18+
} // namespace double_conversion
19+
20+
#endif // DOUBLE_CONVERSION_FIXED_DTOA_H_

0 commit comments

Comments
 (0)