Skip to content

Commit 60e6584

Browse files
committed
merge bitcoin#25643: compile FastFixedDtoa with -O1 to fix cross-arch reproducibility for arm32
1 parent 9510cc1 commit 60e6584

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
$(package)_patches += glibc_compatibility.patch
2526

2627
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
@@ -251,6 +252,7 @@ define $(package)_preprocess_cmds
251252
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
252253
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
253254
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
255+
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
254256
patch -p1 -i $($(package)_patch_dir)/glibc_compatibility.patch && \
255257
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
256258
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
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)