On Apple Silicon, when Hardened Runtime is in force and the
application lacks the "Allow Unsigned Executable Memory Entitlement",
mmap and mprotect return EACCES when an attempt is made to create or
modify memory so that it is simultaneously writable and executable.
This commit handles these cases by retrying the operation without the
PROT_EXEC flag, and setting global variables so that future operations
omit the flag.
This will allow us to reuse the scanning protocol with an arbitrary area
scanning function (replacing traceFormatScan) in order to implement
formatted object walking without an extra segment method.
Don't insist on scanning only grey segments: we want to be able to
reuse the scan protocol for walking, when the segments are black.
Git version 2.32 added the backwards-incompatible "feature" that
.gitignore files that are symbolic links are ignored. Since all our
.gitignore files are symbolic links to the .p4ignore file in the same
directory, for compatibility between the Perforce and Git mirrors of
the repository, this broke "git status" for us and all our users.
See https://github.com/git/git/blob/master/Documentation/RelNotes/2.32.0.txt
This change swaps the files so that .p4ignore is a symbolic link to
.gitignore in each case.
This is a patch for the problem outlined in issue https://github.com/Ravenbrook/mps/issues/61 - that the value in
GetLastError() is not automatically saved and restored when a vectored exception
handler is called. This is solved the same way as errno was handled on POSIX
systems.
This patch does *not* save and restore errno on Windows, since it seems like the
MPS does not call any functions that modify errno on the critical path on
Windows (generally only functions from POSIX do that).
1. Avoid looping over two expressions in parallel when one makes more
sense (compilers can do strength reduction optimization: we don't
need to do it ourselves).
2. Introduce macro ITER_PARALLEL for iterating over two expressions in
parallel, to clarify the intention and explain the need for the
cast to void in the implementation.
3. Add macros SAC_LARGE_ITER and SAC_SMALL_ITER to reduce the amount
of code duplication in sac.c.
The -Wcomma option appears to be turned on automatically by Xcode
12.3, so it's a good idea for the MPS to build with the option, to
avoid unpleasant surprises when people update their Xcode.
The simplest way to suppress the warning is to cast the left hand side
of the comma operator to void.
Clang 10 turns on -Wimplicit-int-float-conversion, and on 64-bit
platforms this issues a warning that implicit conversions to double
from Size and unsigned long "may lose precision".
This commit adds casts to (double) for all such conversions. The loss
of precision is either impossible in practice (because a double can
represent all integers up to 2**53, which is about 9 petabytes, well
beyond the addressing capabilities for current CPUs), or else
acceptable, because we are accumulating an approximate quantity like
"collection work" or "fill size" (that has to cope with loss of
precision due in any case), or computing a threshold like the spare
commit limit where it is acceptable for it to be somewhat approximate.
This ensures that if a mutator thread is blocked in a system call when
the MPS handles a signal, the system call will not fail with EINTR but
instead will be restarted.
Add a test case for the thread suspend and resume signals.
We no longer need the -Wno-extended-offsetof or -Wno-invalid-offsetof
compiler options, since the nonstandard uses of offsetof() were
fixed (see job003619), so they can just be removed.
Publish minor changes to readme and configure files in main directory.
Main directory and code directory licence texts are now fully updated.
Copied from Perforce
Change: 196994