Age | Commit message (Collapse) | Author |
|
This changes the automatic detection of -fstack-protector,
-D_FORTIFY_SOURCE, and -mbranch-protection to write to $hardenflags
instead of $XCFLAGS. The definition of $cflags is changed to
"$hardenflags $orig_cflags $optflags $debugflags $warnflags" to match.
Furthermore, these flags are _prepended_ to $hardenflags, rather than
appended.
The implications of doing this are as follows:
* If a CRuby builder specifies cflags="-mbranch-protection=foobar" at
the ./configure script, and the configure script detects that
-mbranch-protection=pac-ret is accepted, then GCC will be invoked as
"gcc -mbranch-protection=pac-ret -mbranch-protection=foobar". Since
the last flags take precedence, that means that user-supplied values
of these flags in $cflags will take priority.
* Likewise, if a CRuby builder explicitly specifies
"hardenflags=-mbranch-protection=foobar", because we _prepend_ to
$hardenflags in our autoconf script, we will still invoke GCC as
"gcc -mbranch-protection=pac-ret -mbranch-protection=foobar".
* If a CRuby builder specifies CFLAGS="..." at the configure line,
automatic detection of hardening flags is ignored as before.
* C extensions will _also_ be built with hardening flags now as well
(this was not the case by default before because the detected flags
went into $XCFLAGS).
Additionally, as part of this work, I changed how the detection of
PAC/BTI in Context.S works. Rather than appending the autodetected
option to ASFLAGS, we simply compile a set of test programs with the
actual CFLAGS in use to determine what PAC/BTI settings were actually
chosen by the builder. Context.S is made aware of these choices through
some custom macros.
The result of this work is that:
* Ruby will continue to choose some sensible defaults for hardening
options for the C compiler
* Distributors are able to specify CFLAGS that are consistent with their
distribution and override these defaults
* Context.S will react to whatever -mbranch-protection is actually in
use, not what was autodetected
* Extensions get built with hardening flags too.
[Bug #20154]
[Bug #20520]
|
|
Installs the last revision in the previous `RUBY_RELEASE_DATE`.
|
|
Since #10209 we've been noticing that on macos after running `make
clean` the `coroutine/arm64/Context.S` file is missing, causing
subsequent make calls to fail because `Context.S` is needed to build
`Context.o`.
The reason this is happening is because macos is case-insensitive so the
`.s` looks for `coroutine/arm64/Context.s` and finds
`coroutine/arm64/Context.s`. This does not happen on linux because the
filesystem is case sensitive.
I attempted to use `find` because it is case sensitive regardless of
filesystem, but it was a lot slower than `rm` since we can't pass
multiple file names the same way to `find`.
Reverting this small part of #10209 fixes the issue for macos and it
wasn't clear that those changes were strictly necessary for the rest of
the PR.
We changed the original code to use `rm` instead of `delete` because it
is not standarized on POSIX.
|
|
|
|
|
|
|
|
By replacing `ALLOBJS` suffix with intermediate file suffixes instead
of roughly removing by wildcards. Made `cleanlibs` append `.dSYM`
suffix for each word in `TARGET_SO`, not the end of the entire list.
|
|
|
|
|
|
The libruby.so linking extension libraries contain symbols exported
from extension libraries, and is not subject of test-leaked-globals.
|
|
The libruby.a linking extension libraries contain symbols exported
from extension libraries, and is not subject of test-leaked-globals.
|
|
|
|
This reverts commit 5bb946228550c7f171c27725860b153a675404f3.
Fixes https://bugs.ruby-lang.org/issues/20072
|
|
|
|
This reverts commit 1d5598fe0d3470e7cab06a756d40a9221fcd501b.
|
|
During the build, Ruby has special logic to serialize its own builtin
module to disk using the binary iseq format during the build (I assume
for speed so it doesn't have to parse builtin every time it starts
up).
However, since iseq format is architecture-specific, when building on
x86_64 for universal x86_64 + arm64, the serialized builtin module is
written with the x86_64 architecture of the build machine, which fails
this check whenever ruby imports the builtin module on arm64:
https://github.com/ruby/ruby/blob/1fdaa0666086529b3aae2d509a2e71c4247c3a12/compile.c#L13243
Thankfully, there's logic to disable this feature for cross-compiled builds:
https://github.com/ruby/ruby/blob/1fdaa0666086529b3aae2d509a2e71c4247c3a12/builtin.c#L6
This disables the iseq logic for universal builds as well.
Fixes [Bug #18286]
|
|
Not to affect other tools invoked as child processes.
|
|
On some platforms, such as FreeBSD and Oracle Linux, symbols defined
in the crt0 setup routine are exported from shared libraries. So
ignore the symbols that would be exported even in an empty shared
library.
|
|
It does not need to be an absolute path.
|
|
|
|
`$(MAINLIBS)` should be included in `$(LIBRUBYARG)` in cases it is
needed.
Notes:
Merged: https://github.com/ruby/ruby/pull/8233
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8224
|
|
|
|
|
|
`$(MAINLIBS)` should include `$(LIBS)` already.
|
|
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8040
|
|
Add yarp to common.mk and windows builds to enable us to run yarp
correctly with CI.
Notes:
Merged: https://github.com/ruby/ruby/pull/7964
|
|
https://bugs.ruby-lang.org/issues/19637
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/7798
Merged-By: yui-knk <spiketeika@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7643
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7462
|
|
|
|
|
|
|
|
|
|
RJIT doesn't need this.
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
This instructs make to delete target files if the recipe fails midway, like
when make itself is interrupted. This is mostly for development since it
protects against corrupt builds that need a `make clean` to repair. Release
builds normally don't fail mid-recipe.
GNU make and BSD make support this.
From GNU make's manual:
> This is almost always what you want make to do, but it is not historical
> practice; so for compatibility, you must explicitly request it.
See https://innolitics.com/articles/make-delete-on-error/
Notes:
Merged: https://github.com/ruby/ruby/pull/5745
Merged-By: XrXr
|
|
|
|
Rust 1.58.0 unfortunately doesn't provide facilities to control symbol
visibility/presence, but we care about controlling the list of
symbols exported from libruby-static.a and libruby.so.
This commit uses `ld -r` to make a single object out of rustc's
staticlib output, libyjit.a. This moves libyjit.a out of MAINLIBS and adds
libyjit.o into COMMONOBJS, which obviates the code for merging libyjit.a
into libruby-static.a. The odd appearance of libyjit.a in SOLIBS is also
gone.
To filter out symbols we do not want to export on ELF platforms, we use
objcopy after the partial link. On darwin, we supply a symbol list to
the linker which takes care of hiding unprefixed symbols.
[Bug #19255]
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/7115
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7137
|
|
Since `REVISION_H` is defined in common.mk which is appended or
included after Makefile.in, it was undefined yet at the point of the
dependency.
|
|
|
|
|
|
|
|
There's no mjit_compile.inc, so no need to use this prefix anymore.
|
|
|
|
>fgrep: warning: fgrep is obsolescent; using ggrep -F
Notes:
Merged: https://github.com/ruby/ruby/pull/6586
|
|
This make variable is very useful for daily build.
Notes:
Merged: https://github.com/ruby/ruby/pull/6433
Merged-By: nobu <nobu@ruby-lang.org>
|