This exchanges `winapi` functions/types for equivalent `windows-sys` ones. Some basic types (e.g.
`PBOOL`) don't exist in `windows-sys`, and I added `type` items for them (though those could be
removed and the types inlined; that's what `windows-sys` does itself).
The `psapi` library needed to be added for GetModuleFileNameExW; I guess previously `winapi` was
linking it?
Almost all manual definitions of types (`winapi::ENUM!` and `winapi::STRUCT!`) were no longer needed
because `windows-sys` has them. Only the version of `RTL_USER_PROCESS_PARAMETERS` with undocumented
fields was still needed.
Differential Revision: https://phabricator.services.mozilla.com/D199111
After bug 1876372, tokio is the last user of windows-sys 0.48, so we
don't really need to account for window-sys 0.48 in the workspace hack
anymore. We do however need to account for windows-sys 0.52.
Differential Revision: https://phabricator.services.mozilla.com/D199582
* the certificates were regenerated using `./mach generate-test-certs`
* the build/pgo/certs/ changes were made using
`./mach python build/pgo/genpgocert.py`
* the zip files in security/manager/ssl/tests/unit/test_signed_apps/ were
updated per the directions in the corresponding moz.build file
* security/manager/ssl/tests/unit/test_cert_override_read.js needed manual
updating
These certificates and other test artifacts will now expire in 2025.
Differential Revision: https://phabricator.services.mozilla.com/D198727
We only generate a single orderfile and use it for each linked object,
which results in some symbols being listed while not belonging to that
particular object.
Differential Revision: https://phabricator.services.mozilla.com/D197621
Ideally, we wouldn't rely on tooltool, but until we can have private
fetches that can actually be used forever without having to be
retriggered for CoT or other reasons, tooltool is the best we have.
Differential Revision: https://phabricator.services.mozilla.com/D197305
The first thing is that the target CPU may not be supported by Visual
C++, so using that, we don't find the path to a Visual C++ compiler.
By using the host CPU in that case, we can find it.
For ATL and MFC libraries, we may not be able to find them for similar
reasons, but we don't actually need them when cross-compiling, so just
return nothing for those when the target OS is not Windows.
Differential Revision: https://phabricator.services.mozilla.com/D197037
It's not like we publish the ReleaseNotes from the clang toolchain
artifact, and it's only going to be a recurrent source of patch conflict
when the upstream release notes change.
Differential Revision: https://phabricator.services.mozilla.com/D196529
We use UPLOAD_DIR rather than UPLOAD_PATH because UPLOAD_DIR is handled
by run-task to be set properly from a relative path.
As the snaps rightfully unset MOZ_AUTOMATION, we add another way to
enable the use of the symbols server.
Differential Revision: https://phabricator.services.mozilla.com/D196399
AC_SUBSTs with a lower-case key are not really supposed to be used,
although that has never been enforced, and at least one of them is
used in practice.
At least, that's the theory behind using files to store their value in
config.statusd (added in bug 1402012). Because obviously, on
case-insensitive file systems, a variable that is upper case will use
the same file as the lower case one. If their value is the same, then
fine, but if they aren't, thing go bad.
Until bug 1867457, that held true for TARGET_CPU and target_cpu: their
value was the same. But bug 1867457 changed that. But target_cpu is only
there because it's set by autoconf itself, and we don't care about it.
The result is that the value of target_cpu takes precedence because it's
set last, and overwrites the value of TARGET_CPU in config.statusd,
subsequently making the value read in GenerateAtomicOperations.py wrong.
Differential Revision: https://phabricator.services.mozilla.com/D195959
AC_SUBSTs with a lower-case key are not really supposed to be used,
although that has never been enforced, and at least one of them is
used in practice.
At least, that's the theory behind using files to store their value in
config.statusd (added in bug 1402012). Because obviously, on
case-insensitive file systems, a variable that is upper case will use
the same file as the lower case one. If their value is the same, then
fine, but if they aren't, thing go bad.
Until bug 1867457, that held true for TARGET_CPU and target_cpu: their
value was the same. But bug 1867457 changed that. But target_cpu is only
there because it's set by autoconf itself, and we don't care about it.
The result is that the value of target_cpu takes precedence because it's
set last, and overwrites the value of TARGET_CPU in config.statusd,
subsequently making the value read in GenerateAtomicOperations.py wrong.
Differential Revision: https://phabricator.services.mozilla.com/D195959
In many cases, using CONFIG["CPU_ARCH"] will silently do the unexpected
thing now that it doesn't exist anymore. In case there are in-flight
patches using it, it's better to avoid those causing subtle problems
after a rebase by making most uses of the variable throw an exception.
Differential Revision: https://phabricator.services.mozilla.com/D195158
This is 5% faster on my setup, mostly thanks to unrolling being
possible.
We also skip the early loop exit. Most of the bits of `bits` are generally set, so it's ok to do a
few more extra operations if we do them faster.
Differential Revision: https://phabricator.services.mozilla.com/D193366
This is 20% faster on my setup, and according to llvm-mca, the IPC for
the false branch (which is the hottest one) goes from 3 to 5.7, thanks
to unrolling and conditional moves.
Only activated on non-Android target though, as it breaks at runtime.
Basically, most of the bits of `bits` are generally set, so it's ok to do a
few more extra operations as we do them faster.
Differential Revision: https://phabricator.services.mozilla.com/D193366
Introduce functions which create and invoke the Windows file-picker in a
separate thread. This thread is created with a new single-threaded COM
apartment to avoid implicitly creating a nested modal loop on the main
STA thread.
Technically, no functional changes: these functions aren't actually
invoked yet. (That will occur in an upcoming commit.)
Differential Revision: https://phabricator.services.mozilla.com/D193735
The async file-picker creates a new thread, but the thread name was not
added to the permitted-thread-names list. Amended.
Differential Revision: https://phabricator.services.mozilla.com/D195170
This is done for both Android and regular builds, and it brings a nice
1% perf improvement on Windows, and 2% on Android.
Do not get rid of Speedometer2 yet, adding Speedometer3 already brings
an interesting performance boost.
To update to the latest version run
> ./mach vendor third_party/webkit/PerformanceTests/Speedometer3/moz.yaml
Differential Revision: https://phabricator.services.mozilla.com/D194040
Aliased commands have not loaded the virtualenv associated with a
command/subcommand since bug 1695312. It has been defaulting to the
`common` virtualenv, which worked most of the time since most commands
use `common` and it also contains a large share of our dependencies.
Differential Revision: https://phabricator.services.mozilla.com/D192376
This is 20% faster on my setup, and according to llvm-mca, the IPC for
the false branch (which is the hottest one) goes from 3 to 5.7, thanks
to unrolling and conditional moves.
Basically, most of the bits of `bits` are generally set, so it's ok to do a
few more extra operations as we do them faster.
Differential Revision: https://phabricator.services.mozilla.com/D193366
This is 20% faster on my setup, and according to llvm-mca, the IPC for
the false branch (which is the hottest one) goes from 3 to 5.7, thanks
to unrolling and conditional moves.
Basically, most of the bits of `bits` are generally set, so it's ok to do a
few more extra operations as we do them faster.
Differential Revision: https://phabricator.services.mozilla.com/D193366
This is 20% faster on my setup, and according to llvm-mca, the IPC for
the false branch (which is the hottest one) goes from 3 to 5.7, thanks
to unrolling and conditional moves.
Basically, most of the bits of `bits` are generally set, so it's ok to do a
few more extra operations as we do them faster.
Differential Revision: https://phabricator.services.mozilla.com/D193366
When the injected code is used by elfhack, the debug info is thrown away
because elfhack doesn't know what to do with it, but in the case of
relrhack, the normal linker can handle it, so there's no reason not to
include the debug info anymore.
Differential Revision: https://phabricator.services.mozilla.com/D192904
When .rel.plt and .relr.dyn are the same size, after the section header
for .relr.dyn has been updated, it matches the condition for .rel.plt,
and we ended up undoing the change.
Differential Revision: https://phabricator.services.mozilla.com/D192981
Aliased commands have not loaded the virtualenv associated with a
command/subcommand since bug 1695312. It has been defaulting to the
`common` virtualenv, which worked most of the time since most commands
use `common` and it also contains a large share of our dependencies.
Differential Revision: https://phabricator.services.mozilla.com/D192376
`--enable-phc` builds firefox with PHC support. It's not enabled unless the
`phc` pref is also set. So this change will cause PHC support to ride the
trains, but in a disabled state.
Differential Revision: https://phabricator.services.mozilla.com/D188821
Some more recent fixes upstream unbroke cross-compiling the windows
compiler-rt, so we don't need the reversal patch anymore. We also don't
need it on clang 14 either because we don't build the windows
compiler-rt there.
Differential Revision: https://phabricator.services.mozilla.com/D189881
On ARM, lld places the .ARM.exidx section between .rel.dyn/.relr.dyn and
.rel.plt. This means we can't swap .relr.dyn and .rel.plt (well, we
could, if we also moved and rewrote the .ARM.exidx section, but that's
more work than we ought to do).
But we only need to swap the sections when we want the binary to be
compatible with older versions of glibc, which we don't care about on
desktop ARM Linux (we don't ship such builds), and don't need at all
on ARM Android. Ultimately, this is a bug in lld
(https://github.com/llvm/llvm-project/issues/68178).
Differential Revision: https://phabricator.services.mozilla.com/D190006
Setting them before the first call to check_compiler can fail when the
compiler doesn't recognize the flag for its default target and actively
errors out.
Differential Revision: https://phabricator.services.mozilla.com/D189861
Sprinter::jsprintf is nowadays the same as GenericPrinter::printf which Sprinter
inherit from. This patch removes all calls to Sprinter::jsprintf and replaces
them by Sprinter::printf.
The advantage of using GenericPrinter::printf is that this reduce the dependency
on Sprinter-specific interface and moves us toward being able to move more
consumers over to the GenericPrinter.
Differential Revision: https://phabricator.services.mozilla.com/D181500
The patch it reverted was causing problems while running tests with
ASan, but, from a try push, it seems those are not happening anymore.
Presumably, the issue was either fixed on the workers (whatever that
might have been), or in newer versions of clang.
Either way, we're not using clang 14 for ASan builds either, so we can
remove the patch from clang 14 too.
Differential Revision: https://phabricator.services.mozilla.com/D189908
The patch it reverted was causing problems while running tests with
ASan, but, from a try push, it seems those are not happening anymore.
Presumably, the issue was either fixed on the workers (whatever that
might have been), or in newer versions of clang.
Either way, we're not using clang 14 for ASan builds either, so we can
remove the patch from clang 14 too.
Differential Revision: https://phabricator.services.mozilla.com/D189908
Some more recent fixes upstream unbroke cross-compiling the windows
compiler-rt, so we don't need the reversal patch anymore. We also don't
need it on clang 14 either because we don't build the windows
compiler-rt there.
Differential Revision: https://phabricator.services.mozilla.com/D189881
Sprinter::jsprintf is nowadays the same as GenericPrinter::printf which Sprinter
inherit from. This patch removes all calls to Sprinter::jsprintf and replaces
them by Sprinter::printf.
The advantage of using GenericPrinter::printf is that this reduce the dependency
on Sprinter-specific interface and moves us toward being able to move more
consumers over to the GenericPrinter.
Differential Revision: https://phabricator.services.mozilla.com/D181500
We currently are using a fake bitflags 2, derived from bitflags 1. More
and more crates are using it, and we're at a sweet spot where flipping
things around makes sense: using a fake bitflags 1, derived from
bitflags 2.
Differential Revision: https://phabricator.services.mozilla.com/D189316
Old versions of llvm-readelf didn't have parens in its output for `-d`.
So instead of looking for parens, look for word boundaries.
Differential Revision: https://phabricator.services.mozilla.com/D188897
- D146664 is not needed anymore (something equivalent now landed upstream)
- One patch needs a small context adjustment
- Other patches need to be reverted because we already revert things
they depend on.
- We also disable a new warning about unversioned android target
fallback because it currently causes problems we'll fix later.
Differential Revision: https://phabricator.services.mozilla.com/D188669
Sprinter::jsprintf is nowadays the same as GenericPrinter::printf which Sprinter
inherit from. This patch removes all calls to Sprinter::jsprintf and replaces
them by Sprinter::printf.
The advantage of using GenericPrinter::printf is that this reduce the dependency
on Sprinter-specific interface and moves us toward being able to move more
consumers over to the GenericPrinter.
Differential Revision: https://phabricator.services.mozilla.com/D181500
Except when bootstrap is explicitly disabled. This means that on
--enable-release builds, we would now prefer previously bootstrapped
toolchains (but wouldn't bootstrap by default if they aren't there)
Differential Revision: https://phabricator.services.mozilla.com/D188315
Actually, Fenix's minimum is 21 even if 32-bit and Google Play Service has
discontinued 4.4 support. We would like to increase Lite's minimum API to 21
even if 32-bit.
Differential Revision: https://phabricator.services.mozilla.com/D187861
By attaching the #[link] to the function instead of the extern block,
rustc avoids adding libs that aren't used to the linker command line.
Differential Revision: https://phabricator.services.mozilla.com/D188312
Elfhack is the main reason we're not using lld on Linux/Android
shippable builds, because the way it works doesn't go well with how lld
lays out ELF binaries. By leveraging the linker itself (BFD and lld both
having recently gained the ability to generate the compact relocation
info themselves), we can achieve a similar result to what elfhack is
doing, while allowing to use lld.
See more in-depth background on https://glandium.org/blog/?p=4297
Differential Revision: https://phabricator.services.mozilla.com/D187089
Elfhack acts as a linker, and it uses the `elf_header` symbol to point
at the ELF header in the injected code that applies relocations.
Both GNU ld and lld expose a `__ehdr_start` symbol with the same meaning,
so rename the `elf_header` symbol for compatibility. This will allow to
reuse the code in the upcoming replacement for elfhack.
Differential Revision: https://phabricator.services.mozilla.com/D187088
Sprinter::jsprintf is nowadays the same as GenericPrinter::printf which Sprinter
inherit from. This patch removes all calls to Sprinter::jsprintf and replaces
them by Sprinter::printf.
The advantage of using GenericPrinter::printf is that this reduce the dependency
on Sprinter-specific interface and moves us toward being able to move more
consumers over to the GenericPrinter.
Differential Revision: https://phabricator.services.mozilla.com/D181500
Sprinter::jsprintf is nowadays the same as GenericPrinter::printf which Sprinter
inherit from. This patch removes all calls to Sprinter::jsprintf and replaces
them by Sprinter::printf.
The advantage of using GenericPrinter::printf is that this reduce the dependency
on Sprinter-specific interface and moves us toward being able to move more
consumers over to the GenericPrinter.
Differential Revision: https://phabricator.services.mozilla.com/D181500
Targeting aarch64 for Android builds on aarch64 hosts to ensure that we build an arm64 artifact that will run on an arm64 emulator, which is the only one that is supported.
Differential Revision: https://phabricator.services.mozilla.com/D187075
Targeting aarch64 for Android builds on aarch64 hosts to ensure that we build an arm64 artifact that will run on an arm64 emulator, which is the only one that is supported.
Differential Revision: https://phabricator.services.mozilla.com/D187075
Because it bumps the alignment requirement on aarch64, we make the
elfhack test create more relocations to make the .rela.dyn section large
enough for the test to pass.
Differential Revision: https://phabricator.services.mozilla.com/D181684
Clang trunk started to warn about uses of snprintf that always lead to
truncation. The warning is hit in the test, but it's not really an
interesting part of the test, so prevent clang from warning by making
the format string smaller.
Differential Revision: https://phabricator.services.mozilla.com/D186990
It has been enabled by default on the relevant platforms essentially
forever, so it doesn't need to be explicitly enabled.
As such, since --enable-crashreporter is not really a useful thing to
point at to wrt build options, we remove its mention from the
configuring build options doc.
Differential Revision: https://phabricator.services.mozilla.com/D186513
We've apparently hit a threshold in non-unified builds where there are
too many files on the command line when creating the js_static library
on Windows. The way around that is to do something similar to shared
library linking, using a response file (shared library linking has more
possibilities, but it's a different story). Unfortunately, not all
static library creation tools are equal, and while llvm-lib, GNU ar and
llvm-ar support response files, BSD ar and probably others (e.g. the one
on Solaris?) don't, so we have to try and detect whether that works.
Differential Revision: https://phabricator.services.mozilla.com/D185419
Some third party code (cairo, pixman, some media libs) rely on this
define being set. When they are built standalone, they get it from
autoconf, but we don't run their configure scripts, so that's missed.
Differential Revision: https://phabricator.services.mozilla.com/D185351
In bug 1839743, we made the build system prefer packed relative
relocations to elfhack when both the system libc and linker support
them. Unfortunately, while that covers most of the benefits from
elfhack, it doesn't cover bug 651892.
To cover it, we make every C++ executable contain its own copy of
the symbol, so that all relocations related to it become relative.
And because this is actually (slightly) beneficial on macos, and because
it's also an advantage to have our own abort called rather than the
system's, we apply the same to all platforms.
Differential Revision: https://phabricator.services.mozilla.com/D184068
This changes the minimum macOS target from 10.12 to 10.15 in several build
scripts and in documentation that references the minimum version
requirement.
Differential Revision: https://phabricator.services.mozilla.com/D184432