utc_from_string_no_optimize.patch raw
1 Modify optimisation flags for various functions.
2 This fixes non-determinism issues in the asm produced for
3 these function when cross-compiling on x86_64 and aarch64 for
4 the arm64-apple-darwin HOST.
5
6 --- a/qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp
7 +++ b/qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp
8 @@ -1078,9 +1078,9 @@ void QItemSelectionModelPrivate::_q_layoutChanged(const QList<QPersistentModelIn
9
10 if (hint != QAbstractItemModel::VerticalSortHint) {
11 // sort the "new" selection, as preparation for merging
12 - std::stable_sort(savedPersistentIndexes.begin(), savedPersistentIndexes.end(),
13 + std::sort(savedPersistentIndexes.begin(), savedPersistentIndexes.end(),
14 qt_PersistentModelIndexLessThan);
15 - std::stable_sort(savedPersistentCurrentIndexes.begin(), savedPersistentCurrentIndexes.end(),
16 + std::sort(savedPersistentCurrentIndexes.begin(), savedPersistentCurrentIndexes.end(),
17 qt_PersistentModelIndexLessThan);
18
19 // update the selection by merging the individual indexes
20 @@ -1092,8 +1092,8 @@ void QItemSelectionModelPrivate::_q_layoutChanged(const QList<QPersistentModelIn
21 savedPersistentCurrentIndexes.clear();
22 } else {
23 // sort the "new" selection, as preparation for merging
24 - std::stable_sort(savedPersistentRowLengths.begin(), savedPersistentRowLengths.end());
25 - std::stable_sort(savedPersistentCurrentRowLengths.begin(), savedPersistentCurrentRowLengths.end());
26 + std::sort(savedPersistentRowLengths.begin(), savedPersistentRowLengths.end());
27 + std::sort(savedPersistentCurrentRowLengths.begin(), savedPersistentCurrentRowLengths.end());
28
29 // update the selection by merging the individual indexes
30 ranges = mergeRowLengths(savedPersistentRowLengths);
31
32 --- a/qtbase/src/corelib/itemmodels/qitemselectionmodel_p.h
33 +++ b/qtbase/src/corelib/itemmodels/qitemselectionmodel_p.h
34 @@ -76,7 +76,7 @@ public:
35 void _q_rowsAboutToBeInserted(const QModelIndex &parent, int start, int end);
36 void _q_columnsAboutToBeInserted(const QModelIndex &parent, int start, int end);
37 void _q_layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
38 - void _q_layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
39 + __attribute__ ((optnone)) void _q_layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
40
41 inline void remove(QList<QItemSelectionRange> &r)
42 {
43
44 --- a/qtbase/src/corelib/time/qdatetimeparser_p.h
45 +++ b/qtbase/src/corelib/time/qdatetimeparser_p.h
46 @@ -215,7 +215,7 @@ private:
47 : value(ok == Invalid ? -1 : val), used(read), zeroes(zs), state(ok)
48 {}
49 };
50 - ParsedSection parseSection(const QDateTime ¤tValue, int sectionIndex,
51 + __attribute__ ((optnone)) ParsedSection parseSection(const QDateTime ¤tValue, int sectionIndex,
52 int offset, QString *text) const;
53 int findMonth(const QString &str1, int monthstart, int sectionIndex,
54 int year, QString *monthName = nullptr, int *used = nullptr) const;
55
56 --- a/qtbase/src/corelib/time/qtimezoneprivate_p.h
57 +++ b/qtbase/src/corelib/time/qtimezoneprivate_p.h
58 @@ -191,7 +191,7 @@ public:
59 virtual ~QUtcTimeZonePrivate();
60
61 // Fall-back for UTC[+-]\d+(:\d+){,2} IDs.
62 - static qint64 offsetFromUtcString(const QByteArray &id);
63 + static __attribute__ ((optnone)) qint64 offsetFromUtcString(const QByteArray &id);
64
65 QUtcTimeZonePrivate *clone() const override;
66
67 --- a/qtbase/src/widgets/widgets/qcalendarwidget.cpp
68 +++ b/qtbase/src/widgets/widgets/qcalendarwidget.cpp
69 @@ -329,13 +329,13 @@ class QCalendarYearValidator : public QCalendarDateSectionValidator
70
71 public:
72 QCalendarYearValidator();
73 - virtual Section handleKey(int key) override;
74 + __attribute__ ((optnone)) virtual Section handleKey(int key) override;
75 virtual QDate applyToDate(QDate date, QCalendar cal) const override;
76 virtual void setDate(QDate date, QCalendar cal) override;
77 virtual QString text() const override;
78 virtual QString text(QDate date, QCalendar cal, int repeat) const override;
79 private:
80 - int pow10(int n);
81 + __attribute__ ((optnone)) int pow10(int n);
82 int m_pos;
83 int m_year;
84 int m_oldYear;
85