summaryrefslogtreecommitdiff
path: root/template/Makefile.in
AgeCommit message (Collapse)Author
4 daysExtract hardening CFLAGS to a special $hardenflags variableKJ Tsanaktsidis
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]
13 daysAdd `nightly` recipeNobuyoshi Nakada
Installs the last revision in the previous `RUBY_RELEASE_DATE`.
2024-05-26Fix macos bug deleting too many fileseileencodes
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.
2024-05-09test-syntax-suggest is not working with mswin environmentHiroshi SHIBATA
2024-04-11Realclean extracted bundled gems and lock filesNobuyoshi Nakada
2024-04-11Cleanings of .bundle do not need cleanings of extNobuyoshi Nakada
2024-03-10Clean intermediate files and debug info for each targetNobuyoshi Nakada
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.
2024-03-07Clean up files made by runnable in clean-runnable [ci skip]Nobuyoshi Nakada
2024-03-07Ingore errors when removing intermediate files recursively [ci skip]Nobuyoshi Nakada
2024-01-17Skip checking for symbol leaks in libruby.so linking extensionsNobuyoshi Nakada
The libruby.so linking extension libraries contain symbols exported from extension libraries, and is not subject of test-leaked-globals.
2024-01-14Skip checking for symbol leaks in libruby.a linking extensionsNobuyoshi Nakada
The libruby.a linking extension libraries contain symbols exported from extension libraries, and is not subject of test-leaked-globals.
2024-01-13[DOC] Documentize known_errorsNobuyoshi Nakada
2023-12-20Revert "[Bug #19831] Remove duplicate library options"Mikhail Doronin
This reverts commit 5bb946228550c7f171c27725860b153a675404f3. Fixes https://bugs.ruby-lang.org/issues/20072
2023-11-09[Bug #18286] Make builtin binary if sharable in universal binariesNobuyoshi Nakada
2023-11-09Revert "Disable iseq-dumped builtin module for universal x86_64/arm64 binaries"Nobuyoshi Nakada
This reverts commit 1d5598fe0d3470e7cab06a756d40a9221fcd501b.
2023-11-09Disable iseq-dumped builtin module for universal x86_64/arm64 binariesBen Hamilton
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]
2023-10-21[Bug #19967] Reset `LIBPATHENV` env after startedNobuyoshi Nakada
Not to affect other tools invoked as child processes.
2023-10-14Ignore symbols even in empty shared libraryNobuyoshi Nakada
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.
2023-09-21Move YARP_BUILD_DIR to common.mkNobuyoshi Nakada
It does not need to be an absolute path.
2023-09-17[Bug #19778] Pass additional include options to INCFLAGS in common.mkNobuyoshi Nakada
2023-08-17[Bug #19831] Remove duplicate library optionsNobuyoshi Nakada
`$(MAINLIBS)` should be included in `$(LIBRUBYARG)` in cases it is needed. Notes: Merged: https://github.com/ruby/ruby/pull/8233
2023-08-17RJIT: Remove macros inherited from MJIT but no longer usedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8224
2023-08-14Fix test and precheck order for old GNU MakeNobuyoshi Nakada
2023-08-11Group test-syntax-suggest and leaked-globals [ci skip]Nobuyoshi Nakada
2023-08-11[Bug #19831] Remove duplicate library optionsNobuyoshi Nakada
`$(MAINLIBS)` should include `$(LIBS)` already.
2023-07-27Clean up OPT_STACK_CACHING (#8132)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-07-08leaked-globals: check leaked symbols in libruby.so if enable-sharedNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/8040
2023-06-21[Feature #19741] Add yarp to buildsJemma Issroff
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
2023-05-12Use Lrama LALR parser generator instead of Bisonv3_3_0_preview1Yuichiro Kaneko
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>
2023-04-03Check leaked global symbols by defaultNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7643
2023-03-06s/MJIT/RJIT/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462
2023-03-06Remove obsoleted mjit_sp_inc.inc.erbTakashi Kokubun
2023-03-06Remove obsoleted tool/mjit_tabs.rbTakashi Kokubun
2023-03-06Remove obsoleted mjit_config.hTakashi Kokubun
2023-03-06Stop building mjit_build_dir.soTakashi Kokubun
2023-03-06Drop obsoleted MJIT header (#7458)Takashi Kokubun
RJIT doesn't need this. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-02-06Add .DELETE_ON_ERROR to MakefileAlan Wu
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
2023-01-31Silence dozens of useless warnings from `nm` on macOSNobuyoshi Nakada
2023-01-27YJIT: Fix shared/static library symbol leaksAlan Wu
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
2023-01-23Silence dozens of useless warnings from `ranlib` on macOS [ci skip]Nobuyoshi Nakada
2023-01-21tool/leaked-globals: ignore function typedef [ci skip]Nobuyoshi Nakada
2023-01-18Switch to use gem version of simplecov, not git cloneHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7137
2023-01-14Move the dependency of makefiles on revision header [ci skip]Nobuyoshi Nakada
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.
2022-12-20MSVS lacks `touch` [ci skip]Nobuyoshi Nakada
2022-12-20Fix missing parentheses [ci skip]Nobuyoshi Nakada
2022-12-05Handle depend files on nmakeNobuyoshi Nakada
2022-11-29MJIT: Rename mjit_compile_attr to mjit_sp_incTakashi Kokubun
There's no mjit_compile.inc, so no need to use this prefix anymore.
2022-11-02Fix infinite loop when out-of-place buildNobuyoshi Nakada
2022-10-19Suppress warning for fgrepHiroshi SHIBATA
>fgrep: warning: fgrep is obsolescent; using ggrep -F Notes: Merged: https://github.com/ruby/ruby/pull/6586
2022-09-25Extract `RUBY_RELEASE_DATE` from also revision.hNobuyoshi Nakada
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>