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
Now that we have upgraded to a version of rustc that uses LLVM 16, it
can read profile data from LLVM 16, so we don't need to artificially
make the profile data look like LLVM 15's anymore.
Differential Revision: https://phabricator.services.mozilla.com/D184413
This is really just shuffling a bunch of things around. None of the
'load_*' member functions of the `Mach` class actually needed to be
member functions. They can all be static so that they can be used
anywhere. That combined with moving all the other 'mach_command' logic
to a different file, allows us to load the module for any command so
that we can successfully dispatch it.
Differential Revision: https://phabricator.services.mozilla.com/D184060
This makes loading almost all commands faster, since only one module
file is loaded rather than all of them. There is one main exception,
dealing with 'help'. Running `./mach help` (or -h or --help) requires
the description text for every command, so every module file is still
loaded.
We could expand this improvement here to consolidate all commands and
their parameters in this `MACH_COMMANDS` dict, but the only two benefits
are improving help, and not having two places where the commands are
specified (their file, and this dict).
There's a lot of extra work needed to do that, especially for handling
sub commands, and it did not seem worth the cost for the benefit at this
time.
Depends on D180499
Differential Revision: https://phabricator.services.mozilla.com/D180500
This activated virtualenv for a command is managed
`CommandSiteManager` and it is passed down to where it was activated
before to prevent a second, redundant, activation.
Differential Revision: https://phabricator.services.mozilla.com/D180499
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
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
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 adds a crate that override's the windows-targets crate to avoid
depending on the large import libraries in its dependencies.
Differential Revision: https://phabricator.services.mozilla.com/D183824
This makes loading almost all commands faster, since only one module
file is loaded rather than all of them. There is one main exception,
dealing with 'help'. Running `./mach help` (or -h or --help) requires
the description text for every command, so every module file is still
loaded.
We could expand this improvement here to consolidate all commands and
their parameters in this `MACH_COMMANDS` dict, but the only two benefits
are improving help, and not having two places where the commands are
specified (their file, and this dict).
There's a lot of extra work needed to do that, especially for handling
sub commands, and it did not seem worth the cost for the benefit at this
time.
Depends on D180499
Differential Revision: https://phabricator.services.mozilla.com/D180500
This activated virtualenv for a command is managed
`CommandSiteManager` and it is passed down to where it was activated
before to prevent a second, redundant, activation.
Differential Revision: https://phabricator.services.mozilla.com/D180499
We've had this restriction for a while (with a note of it in the docs,
but the note in the docs can easily be overlooked, leading to confusing
errors). Erroring out right on Mach startup and providing instructions
for the workaround immediately should help users get around this issue
faster.
Differential Revision: https://phabricator.services.mozilla.com/D183209
As of bug 1838763, Python virtualenvs are now located in a subdirectory
of `$MOZBUILD_STATE_PATH`. This, in turn, defaults to a subdirectory of
the home directory, which on Windows often contains spaces.
The Windows build instructions were updated to add a requirement that
`MOZBUILD_STATE_PATH` not contain spaces, under the assumption that this
was merely a clarification of an existing restriction; but this is
indeed a new requirement and breaks existing setups.
Instead, allow makefiles to safely invoke `$(PYTHON3)` without quoting
it everywhere (as they do) by ensuring that its value contains no
spaces, by using the DOS-style (8.3) short path to the Python
executable.
Additionally, clarify in the documentation exactly which paths are
required not to contain spaces.
Differential Revision: https://phabricator.services.mozilla.com/D183305
This makes loading almost all commands faster, since only one module
file is loaded rather than all of them. There is one main exception,
dealing with 'help'. Running `./mach help` (or -h or --help) requires
the description text for every command, so every module file is still
loaded.
We could expand this improvement here to consolidate all commands and
their parameters in this `MACH_COMMANDS` dict, but the only two benefits
are improving help, and not having two places where the commands are
specified (their file, and this dict).
There's a lot of extra work needed to do that, especially for handling
sub commands, and it did not seem worth the cost for the benefit at this
time.
Depends on D180499
Differential Revision: https://phabricator.services.mozilla.com/D180500
This activated virtualenv for a command is managed
`CommandSiteManager` and it is passed down to where it was activated
before to prevent a second, redundant, activation.
Differential Revision: https://phabricator.services.mozilla.com/D180499
Also add the associated virtualenv names to each command that has one in
preparation for loading the virtualenvs earlier (next patch).
Differential Revision: https://phabricator.services.mozilla.com/D181032
The ipcclientcerts-static and osclientcerts-static features are missing a
dependency upon syn (both pull syn via bindgen, so need the unified
dependency), which means all the features depend on syn, so make it
non-optional and remove the manual dependencies.
Differential Revision: https://phabricator.services.mozilla.com/D182512
This makes the types from mozbuild.configure.constants repr()-able, and
repr()-ed in config.status, which, when processing moz.build, translates
into value checking for comparison tests involving the variables.
To make them pickable, though, we replace the use of EnumString.subclass
with actual subclassing, which is a little less convenient, but avoids
having to figure out how to make the classes EnumString.subclass creates
pickable.
This caught some mismatches in media/libpng and third_party/libsrtp.
This also means we don't need to normalize the config before dumping it
in config.status, because the only types that this was actually useful
for are these (historically, we'd also turn byte strings into unicode
strings but that hasn't been a thing for 4 years ; the special treatment
of dicts and iterables was there to apply the normalization recursively,
not to normalize dicts and iterables themselves). We still normalization
before passing values to gyp, though.
Differential Revision: https://phabricator.services.mozilla.com/D182141
This has an important impact on compilation time, so we limit that to
shippable builds and under MOZ_AUTOMATION.
The benefit on speedometer time is not significant on macosx and android builds, so
we skip that platform.
Builds tend to stall on arm platforms, so we limit the target to
x86_64.
Differential Revision: https://phabricator.services.mozilla.com/D179912
This allows to fall back to the autodetection of the SDK from the host
on mac machines. While not ideal, it's better than the status quo where
when Apple removes the SDK from its servers, configure plain fails.
Differential Revision: https://phabricator.services.mozilla.com/D182685
This makes the types from mozbuild.configure.constants repr()-able, and
repr()-ed in config.status, which, when processing moz.build, translates
into value checking for comparison tests involving the variables.
To make them pickable, though, we replace the use of EnumString.subclass
with actual subclassing, which is a little less convenient, but avoids
having to figure out how to make the classes EnumString.subclass creates
pickable.
This caught a mismatch in media/libpng.
Differential Revision: https://phabricator.services.mozilla.com/D182141
and move it to util.configure.
The last use of set_for_old_configure was removed in bug 1804605, no new
project flag should require the argument.
Differential Revision: https://phabricator.services.mozilla.com/D182522
When cross-compiling on Windows, having LIB set can interfere with
lld-link being used for host binary linking, while not used for target
linking.
While here, do the same for HOST_LINKER_LIBPATHS* when doing Windows
cross-compiles on other OSes, although that doesn't interfere with
anything, but it's useless.
Differential Revision: https://phabricator.services.mozilla.com/D182283
I'm pretty sure there are other theoretical problems in the code,
notably when a single section is larger than 4GB, but by the time
we reach that limit, bug 1839740 will have been fixed.
Differential Revision: https://phabricator.services.mozilla.com/D182447
This makes the types from mozbuild.configure.constants repr()-able, and
repr()-ed in config.status, which, when processing moz.build, translates
into value checking for comparison tests involving the variables.
This caught a mismatch in media/libpng.
Differential Revision: https://phabricator.services.mozilla.com/D182141
Bug 1747782 changed the format to SHT_RELR, but what's produced is still
different from a real SHT_RELR section, because it uses a terminating
nul entry.
Differential Revision: https://phabricator.services.mozilla.com/D181689