104 Commits

Author SHA1 Message Date
Aurélien Brooke
03d5daf943 Add jemalloc support
Large graphical Qt applications heavily rely on heap allocations.
Jemalloc is a general-purpose malloc(3) implementation designed to
reduce heap fragmentation and improve scalability. It also provides
extensive tuning options.

Add a -jemalloc configure option, disabled by default. When enabled, Qt
and user code link to jemalloc, overriding the system's default
malloc().

Add cooperation with jemalloc for some Qt key classes: QArrayData (used
by QByteArray, QString and QList<T>), QBindingStoragePrivate,
QDataBuffer (used by the Qt Quick renderer), QDistanceFieldData,
QImageData, QObjectPrivate::TaggedSignalVector, QVarLengthArray.

This cooperation relies on two jemalloc-specific optimizations:
1. Efficient allocation via fittedMalloc():
   Determine the actual allocation size using nallocx(), then adjust the
   container’s capacity to match. This minimizes future reallocations.
   Note: we round allocSize to a multiple of sizeof(T) to ensure that
   we can later recompute the exact allocation size during deallocation.
2. Optimized deallocation via sizedFree():
   Use sdallocx(), which is faster than free when the allocation size
   is known, as it avoids internal size lookups.

Adapt the QVarLengthArray auto tests on capacity.

Non-standard functions docs are at https://jemalloc.net/jemalloc.3.html

[ChangeLog][QtCore] Added optional support for the jemalloc allocator,
and optimized memory allocations and deallocations in core Qt classes to
cooperate with it.

Change-Id: I6166e64e66876dee22662d3f3ea3e42a6647cfeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-04-09 13:49:11 +02:00
Giuseppe D'Angelo
3cb58b053c Update PCRE2 to 10.45
New upstream version.

Importing note: 10.45 is missing a licence file for the sljit
dependency. This is tracked upstream at

https://github.com/PCRE2Project/pcre2/issues/686

so it may get fixed in 10.46 (in which case the import script /
qt_attribution.json may need to be amended).

[ChangeLog][Third-Party Code] PCRE2 was updated to version 10.45.

Pick-to: 6.9 6.8 6.5
Change-Id: Ifa0430782bed8ffb1c26f44ca6eb06cd26aaa1f9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-02-17 10:45:06 +01:00
Thiago Macieira
d7007090bb Bootstrap: depopulate qcore_mac.mm to remove QOperatingSystemVersion
We don't need anything that the class provided, but we needed it because
everything is in a large .mm source file.

I've also removed portions of qcore_mac.mm that aren't needed for
bootstrapped tools, like telling whether dark mode is in effect (the
bootstrapped tools aren't GUI). I've also had to remove the check for
running under Rosetta, which hopefully is going to affect no one:
running moc & cmake_automoc_parser under Rosetta is going to be mighty
slow. Just use a native set of tools instead.

Change-Id: I4c0c716a5b57833abf63fffdf0c66b9ebaccffdb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-01-24 16:26:33 -08:00
Thiago Macieira
bf8a5ab418 Bootstrap: remove qcoreapplication_{mac,win}.cpp & QStandardPaths
We don't need to discover the application's name or file path. This also
removes the only use of QStandardPaths::findExecutable(), so we can
remove the entire class too.

Change-Id: Id297dc9b56ada635cfc9fffd679ead9378fffb03
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-01-15 19:10:30 -08:00
Thiago Macieira
2d2cba103f Bootstrap: remove QSystemLibrary and QWinRegistryKey
They're unused.

Pick-to: 6.9
Change-Id: I781690cca811cdbab757fffd30b64fccb197ef46
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-01-13 12:04:21 -03:00
Thiago Macieira
0604a6e760 Bootstrap: disable all debug/info/warning messages and assertions
The three bootstrapped tools should validate their arguments properly,
so there's no need to have them print something. They aren't means to
test the Qt classes either, so assertions shouldn't apply.

Change-Id: I580758610c7262414b64fffd54f84eb16743673d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-01-13 12:04:21 -03:00
Thiago Macieira
24b5cea95c Bootstrap: remove the QDebug streaming class
And fix some compilation bugs if QT_NO_DEBUG_STREAM is defined.

Drive-by fix the grammar in the qcommandlineparser.cpp qWarning().

Change-Id: Ia9287ea189ae4a4b7545fffdbff7dbb9196de519
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-01-13 09:04:21 -06:00
Thiago Macieira
2d40e30e34 Bootstrap: remove unused sources
None of this is used.

Change-Id: I8ced5410f276d47065fafffd4bcad394de968599
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-01-13 12:04:20 -03:00
Thiago Macieira
c7f64d84fb Bootstrap: remove QUuid and QCryptographicHash: they're now unused
The previous commit removed the one use of QUuid and, through it,
QCryptographicHash in one of the three bootstrapped tools.

Change-Id: I31b7f9f6aa402709bad7fffd3a65e86be7f6d882
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-12-30 19:45:58 -03:00
Marc Mutz
bd7d54249e Introduce QT_NO_QSNPRINTF and mark QtCore as qsnprintf-free
... except, of course, the implementation file, which therefore has to
be excluded from PCH'ed builds.

Remove qvsnprintf.cpp from libbootstrap, as it's no longer needed
after porting all five uses of qsnprintf() in QtCore to C++11's
std::snprintf(), which even Windows implements with std behavior.

The reason we're removing the function is that std::snprintf() is the
better alternative: qsnprintf() just introduces even more platform
variance than any implementation-defined behavior of C or C++
snprintf().

To wit:

- On Windows, the return value is sometimes "wrong"
  (cf. Windows-specific qsnprintf() tests in tst_qbytearray.cpp)

- On WASM and at least some Android configurations, it is incorrectly
  implmented using the QString::asprintf().toLocal8Bit() work-around,
  even though both platforms have a working snprintf().
  QString::asprintf() is implemented in Qt itself, so has some
  differences:

  - the `a` format for hex floats is not supported

  - %ls expects char16_t*, not wchar_t* (these are, in general, not
     the same width)

We will deprecate these functions in 6.9, but before we do, we need to
get the Qt code in order, and that's where this macro comes in.

[ChangeLog][QtCore] Added the QT_NO_QSNPRINTF macro to disable
qsnprintf() and qvsnprintf(), which will also be deprecated in 6.9.
See the documentation for details why we take this step.

Task-number: QTBUG-127110
Pick-to: 6.8
Change-Id: I4e1c1f213bcfd615f83387f5f51e77fa1ff2062e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-08-03 10:30:05 +00:00
Peter Varga
7b049e1eb6 clang-cl: Link against clang_rt.builtins-x86_64.lib
Fixes build with clang-cl on Windows.

This is a workaround for
https://github.com/llvm/llvm-project/issues/25679

Change-Id: I6dc8b045376101d8b8cc26fe5db3e7bf87a6a8f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-06-20 19:32:34 +02:00
Alexandru Croitor
79f9b490e7 CMake: Annotate some targets with SBOM information
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I2eb70ca4d52e30c8e15ca7b350df6965d93732f8
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-06-13 16:54:47 +02:00
Thiago Macieira
6708107873 Bootstrap: remove unused sources
qiterable.cpp is even a comment-only source.

Change-Id: I01ec3c774d9943adb903fffd17b79d567a435594
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-13 18:48:21 -08:00
Thiago Macieira
6508902d89 Bootstrap: remove qnumeric.cpp by using qnumeric_p.h
That is, use the inline functions that refer to <numeric_limits> and
<cmath> directly, instead of the out-of-line wrappers. Someone should
verify if the hacks for QNX's <math.h> are still required.

Change-Id: I01ec3c774d9943adb903fffd17b7ee560b4b71b9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 17:29:14 -08:00
Thiago Macieira
d637bc0a5a Bootstrap: remove QDirListing/QDirIterator
Bootstrapped tools don't usually need to list directories; they should
operate on file lists passed to it by the build system instead.

This may deserve a QT_FEATURE.

Change-Id: I01ec3c774d9943adb903fffd17b7ecfba2702fc5
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 18:29:13 -07:00
Thiago Macieira
b57a9a3cd9 Bootstrap: remove QTemporaryFile
Done by harmonizing the use on the QT_CONFIG(temporaryfile) macro and
fixing one test that was missing. We can't remove the older macro
because it is marked PBULIC) but we don't need to use it ourselves.

Change-Id: I01ec3c774d9943adb903fffd17b7eb4dd1a4e63f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-13 09:41:02 -08:00
Thiago Macieira
9e214cbcdd Bootstrap: remove QRandomGenerator
The bootstrapped tools really mustn't produce random output (they must
always be reproducible exactly). Therefore, ensure we don't need this
file.

Change-Id: I01ec3c774d9943adb903fffd17b7eb94dbd4be89
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-03-13 00:00:48 -08:00
Thiago Macieira
cdbc76360a Bootstrap: remove QVariant
I added QT_NO_VARIANT to qconfig-bootstrapped.h to be clearer on what
the #ifs are, but there's no testing of that feature outside of
QT_BOOTSTRAPPED.

Change-Id: I01ec3c774d9943adb903fffd17b7e8ac4340fb89
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-03-13 00:00:48 -08:00
Thiago Macieira
4be7c046b1 Bootstrap: remove QDataStream
It was only used by the cmake_automoc_parser so it would write a 64-bit
in big-endian format. So bypass QDataStream and write it native
endianness.

Change-Id: I01ec3c774d9943adb903fffd17b79c78e56db4cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-13 00:00:48 -08:00
Thiago Macieira
907e9a8b29 Move qAbort from qglobal.cpp to qassert.cpp
It makes more sense there, as all the other functions in that file are
about early termination. This allows us to remove qglobal.cpp from the
bootstrap library, because qglobal.cpp now only has the callback tables.

Amends 8f13af5d7b9b659208a8a93e6581d30b434dae1f.

Change-Id: I01ec3c774d9943adb903fffd17b7ea92404bdbd3
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-06 02:09:16 -08:00
Ahmad Samir
7cf39bd785 Port to QDirListing
Use QDirListing in the Bootstrap build instead of QDirIterator.

Drive-by changes:
- more const variables
- use emplace_back() instead of append() where appropriate

Change-Id: Ie1f0d03856e557c4bfabfff38a87edc7da86d091
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-03 14:02:07 +02:00
Giuseppe D'Angelo
909d881e75 PCRE2: upgrade to 10.43
Apart from some source code reshuffling, 10.43's JIT has
dropped its support for ARMv5.

[ChangeLog][Third-Party Code] PCRE2 was updated to version 10.43.

Pick-to: 6.7 6.6 6.5
Change-Id: I7909f0a9358f38282f5eaeacd2eb10529b47e63c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-19 23:48:13 +01:00
Tor Arne Vestbø
2a2a301557 Apple: Fix a few deprecation warnings after bumping deployment targets
- kIOMasterPortDefault -> kIOMainPortDefault
 - Use UTType instead of Carbon Core functions/constants
 - NSWorkspace iconForFileType -> iconForContentType
 - Removed obsoleted kUTTypeInkText pasteboard type

There are still a few more, but these will be fixed in follow ups.

Change-Id: Ibbca226d578b4ba64bd9c8c5d0addc1870114a20
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-02-19 18:03:11 +01:00
Marc Mutz
e57f7b1b01 Bootstrap: remove QBitArray
It appears to be used only in qlalr, which is, however, not
bootstrapped.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: Idc16d957bf687238c7b0ee603d8b092e2048ef18
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 11:50:37 +01:00
Amir Masoud Abdol
cfed658747 Utilize NO_UNITY_BUILD arguments instead of manual exclusion
Unity build is disabled by default for all 3rdparty libraries, so we
don't need to set the manually anymore; and for the plugins we can use
NO_UNITY_BUILD instead.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ia2f83ae083924d31adf07e7647b34ae6571ed01f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-14 17:28:44 +01:00
Friedemann Kleint
64dc6fe87d Add some exclusions for CMake Unity (Jumbo) builds
Add exclusions for issues that are likely not fixable
(3rd party code, X11 define clashes, etc) in 3rd party,
tools and plugins.

Pick-to: 6.5
Task-number: QTBUG-109394
Done-with: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I698c004201a76a48389271c130e44fba20f5adf7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-16 16:03:06 +01:00
Friedemann Kleint
08c2010708 src: Remove remains of qmake conversion from CMakeLists.txt files
Pick-to: 6.5
Change-Id: Id644d322a602038403bb7f46c532744575fbf6d3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-02-10 23:36:51 +01:00
Edward Welbourne
ae6186c7e8 Adapt QTimeZone to handle Qt::TimeSpec machinery
[ChangeLog][QtCore][QTimeZone] QTimeZone is now always defined;
feature timezone now controls most of its prior API and some new API
is added, most of it always present, to enable QTimeZone to package a
Qt::TimeSpec and, for Qt::OffsetFromUTC, its offset. Prior to this
change, APIs using Qt::TimeSpec had to provide a separate function
taking a QTimeZone alongside a function taking a Qt::TimeSpec and
optional offset; it will now be possible to unify these into a single
function taking a QTimeZone. Adaptation of other Qt classes to do so
shall follow.

Task-number: QTBUG-108199
Change-Id: If5ec3cc63920af882ebb333bf69cde266b1f6ad7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-12-09 16:16:47 +01:00
Øystein Heskestad
3fedcd4e4a Add Boyer-Moore Latin-1 string searcher with optional case sensitivity
[ChangeLog][QtCore][QString] Added Boyer-Moore Latin-1 string searcher with optional case sensitivity

Task-number: QTBUG-100236
Change-Id: I200a0dac7c8012add1ee02511dba791d233115e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-08 17:56:47 +01:00
Sona Kurazyan
fce36ac866 Rename the header qenvironmentvariables.h -> qtenvironmentvariables.h
Change-Id: I8153c856c2cd93ec6932cd7dd5e9d7273d5712dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-09-30 14:19:17 +02:00
Alexey Edelev
b89d63515b Replace the syncqt.pl script with syncqt tool
syncqt.pl adds an extra dependency on perl when building Qt. Modern C++
provides the convenient cross-platform way to access a filesystem and
to use regular expressions, so we may replace the perl script with C++
application. The syncqt executable is built at configure time and
installed as QtCore tool. It's running at configure time to deliver the
required header files for IDE to build a consistent code model and at
the build time to keep tracking changes in header files and generate
the missing aliases without reconfiguring. 'syncqt' only parses header
files from a CMake build tree, so the resulting Qt installation only
contains interfacing headers that belong to the platform that Qt is
built for. 'sync.profile' files are not used as the 'source of truth'
for sync qt procedure anymore, all the necessary information is taken
from either CMake files at configure time or from the module header
files while parsing them.

syncqt.pl is still in place since it's required as fallback solution
for a smooth transition to the new syncqt implementation for all qt
repositories.

This patchset only enables the C++ based syncqt for 'qtbase'
repository.

From the performance perspective C++ version works faster then perl
script, also the configure time is reduced significally on subsequent
reconfigurations - up x2 times faster when re-configuring repository,
but it also takes time to compile the tool itself the first time.
Numbers for qtbase:
           syncqt.pl  syncqt.cpp
 initial:  0m16,035s  0m20,413s
 reconfig: 0m6,819s   0m3,725s

The syncing procedure can be run separately for each module using
<ModuleName>_sync_headers targets. The 'sync_headers' target can be
used to sync all the modules at once.

Task-number: QTBUG-87480
Task-number: QTBUG-103196
Change-Id: I8c938bcaf88a8713b39bbfd66d9e7ef12b2c3523
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-27 13:12:11 +02:00
Tor Arne Vestbø
1bc7e9e77b Add QComHelper class for dealing with COM on Windows
Unifies our approach to calling CoInitializeEx and CoUninitialize,
removing a lot of boilerplate in the process, and also fixes a few
bugs where we would incorrectly balance our calls to CoInitializeEx
and CoUninitialize.

The optimistic approach of qfilesystemengine_win.cpp of calling
CoCreateInstance without initializing the COM library explicitly
has been removed, as calling CoInitializeEx should be a noop in
the situation where it's already been loaded.

Change-Id: I9e2ec101678c2ebb9946504b5e8034e58f1bb56a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-08-29 15:39:34 +02:00
Lucie Gérard
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Marc Mutz
4906b43b00 QCoreGlobalData: remove
Inline the data members into the only remaining user (qdir.cpp) and
remove the class.

As a drive-by, fix the non-idiomatic use of QT_BUILD_CORE_LIB to mean
!QT_BOOTSTRAPPED and apply the guard consistently to the declaration,
too.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-105747
Change-Id: If2c780dd96e2a2e331cabdc42fd920874e7737b0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-21 08:29:37 +02:00
Sona Kurazyan
b3fd4b8adf Extract header qassert.h from qglobal.h
For now qassert.h is included in the middle of qglobal.h, since some of
the code below needs it, but this will be cleaned up when that code is
moved in its own header.

Task-number: QTBUG-99313
Change-Id: I2cdfed44f5c8772c1dad4797cf8edc6cb4c964b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-08-05 15:54:06 +02:00
Lucie Gérard
fb1b20eab3 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-03 17:14:55 +02:00
Sona Kurazyan
908d048e4f Extract header qenvironmentvariables.h from qglobal.h
qcontainerfwd.h was relying on the forward declaration of QByteArray in
qglobal.h, so add the missing forward declaration there.

Additionally, had to move the implementations of qTzSet() and qMkTime()
to qenvironmentvariables.cpp along with environmentMutex.

Task-number: QTBUG-99313
Change-Id: I233aff305c2fedaf0a48362cc99ff2d6f6c0ee54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-29 23:04:21 +02:00
Robert Loehning
c0a5f17679 Fix building with "-sanitize fuzzer-no-link"
This partially reverts commit c25a5b4e1fc9e74f1f3ab1001db4fbae267d7831.

We need qtemporaryfile.cpp in the bootstrap library, because qfile.cpp
uses QTemporaryFileName - even if QTemporaryFile has been disabled.

Re-adding qtemporaryfile.cpp does not increase the bootstrap library's
size significantly, because since c25a5b4e1f we have
     #define QT_NO_TEMPORARYFILE
in qconfig-bootstrapped.h, and that disables compilation of
QTemporaryFile but leaves QTemporaryFileName intact.

Pick-to: 6.4
Fixes: QTBUG-103805
Change-Id: I6947ca303edb36fc359bd5d07c1cbd88098905fb
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-12 16:32:38 +00:00
Edward Welbourne
6d97cf0e57 Split qtLocalTime out into a new QLocalTime namespace
... in new qlocaltime* files, now that it's decoupled enough from the
internals of QDateTime for this to be possible. Part of the
consolidation of time_t code in one place.

Move assorted constants from qdatetime.cpp to a private namespace in
qdatetimeprivate_p.h to be shared between q*time.cpp hereafter (fixing
an out of date comment in the process - julianDayFromDate() is long
gone).

Task-number: QTBUG-95993
Change-Id: I03d97e959118041f9d86b8bb2e738599bc0b17e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-05-20 13:09:23 +02:00
Joerg Bornemann
fbdd076ae9 Revert introduction of QT_USE_BOOTSTRAP_SOURCE_COPY
This removes the hack that creates a copy of bootstraplib sources to
avoid rebuilding the world if a bootstraplib source file changed.

Said hack led to confusing behavior:
- when accidentally editing bootstraplib copies instead of the real
  sources
- when header files were changed in a way that were incompatible to the
  bootstraplib source copy

This reverts commit 80a8ead08d1fea926850d1da61f693dfe26ed5b0.
This reverts commit 743bb66744e762d10754426e43d42b24cc7bff0f.

The official way to avoid the QTBUG-92269 problem is now to set
QT_HOST_PATH=<host-Qt-installation> and QT_FORCE_FIND_TOOLS=ON.

If you want to build the tools as well, set QT_FORCE_BUILD_TOOLS=ON.

Fixes: QTBUG-92269
Change-Id: I226bf5792f9ca8e7e207dc53e01c2903018d82d3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-05-09 08:32:10 +02:00
Joerg Bornemann
80a8ead08d Fix unresolved include in bootstraplib when using source copies
When QT_USE_BOOTSTRAP_SOURCE_COPY is ON, there are situations where
includes like
    "../../3rdparty/sha1/sha1.cpp"
in qcryptographichash.cpp cannot be resolved.  For example,
out-of-source MSVC builds are affected.

In-source builds are working by accident, because we're adding the
include path "<qtbase-build-dir>/src/corelib/global", and
<qtbase-build-dir> is <qtbase-source-dir>.

Linux/macOS builds are working by accident, because we're adding the
include path "<qtbase-source-dir>/src/3rdparty/forkfd".

Fix this by explicitly adding the directory where qcryptographichash.cpp
resides to INCLUDE_DIRECTORIES.

This amends commit 743bb66744e762d10754426e43d42b24cc7bff0f.

Fixes: QTBUG-102720
Change-Id: I55fcc186ea4c81134c39023ced3f04458230109b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-21 20:35:24 +02:00
Joerg Bornemann
743bb66744 Avoid rebuilds when changing sources belonging to bootstraplib
Whenever a source file is touched that belongs to the bootstrap library,
all bootstrap tools are rebuilt.  This includes moc.  The moc binary
however, is a dependency whose invalidation results in a rebuilt of
quite some parts of Qt.

There's no easy way to turn off this dependency.  To mitigate the
rebuilds, the bootstrap lib now can use a copy of the corelib sources.
That means the bootstrap lib is not rebuilt if its sources are changed.
This is basically the situation we had in Qt5.

The sources are not updated on reconfiguration.  There's a new target
'update_bootstrap_sources' that can be built to update the copied source
tree of the bootstrap lib.

This new behavior can be controlled with the variable
QT_USE_BOOTSTRAP_SOURCE_COPY.  It's on by default for developer builds.

Fixes: QTBUG-92269
Change-Id: I50234df66590c39594d208424394c7a600dc5606
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-13 12:41:14 +02:00
Fabian Kosmale
a9cef86b8f Remove qipaddress from boostrap lib
Change-Id: I31a883404f34d0933fe8b316d05b0f28103e48ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-23 08:17:44 +01:00
Fabian Kosmale
c25a5b4e1f Remove QTemporary(file|dir) from boostrap lib
Change-Id: I851f0fd8150592784a7b38d3d30d69d8346de112
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-23 08:16:49 +01:00
Fabian Kosmale
aa29de37a7 Remove QUrl* from boostrap lib
Change-Id: I669ad12588adfd6fb409525616e145120e5a7c76
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-23 03:13:02 +01:00
Kai Köhne
dfe6601974 Bootstrap: Make compiler warnings fatal
Prevent compiler warnings from creeping into the bootstrap library.

Pick-to: 6.3
Change-Id: I8054416564c91fee256cad616911dd4ad231d0df
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-02 11:03:44 +01:00
Joerg Bornemann
d03385df9d Remove QXml* from bootstrap lib
Those classes are not used by any bootstrapped tool.

Also remove the QT_BOOTSTRAPPED code paths.

Change-Id: Ic5a9b153a578fedcba37cd81a62ccf0182a2d34f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-09 19:49:37 +01:00
Joerg Bornemann
4fb5923432 Remove QLine, QPoint, QRect, and QSize from bootstrap lib
Those classes are not used by any bootstrapped tool.

Change-Id: I82fc32e16d044b91ab3a79109ab98a3010df2e2d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-09 19:49:37 +01:00
Joerg Bornemann
b9cd52bef3 Remove QDom from bootstrap lib
It's not used by any bootstrapped tool.

Change-Id: Id6751e80bb34642aeaea1c2bb4f24b480280623d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-09 19:49:36 +01:00
Joerg Bornemann
c22b30f594 Remove QSystemSemaphore from bootstrap lib
This class is used by androidtestrunner, which is not bootstrapped.

Change-Id: Ie75b4dd039f773a8ccb58f243bf9f74a5121c3f3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-09 19:49:36 +01:00