From: "vo.x (Vit Ondruch) via ruby-core" Date: 2024-07-03T15:39:17+00:00 Subject: [ruby-core:118430] [Ruby master Bug#20601] Configuration flags are not properly propagated to assembler Issue #20601 has been updated by vo.x (Vit Ondruch). kjtsanaktsidis (KJ Tsanaktsidis) wrote in #note-4: > and in fact I would go a step furthre and delete `$ASFLAGS` in `configure.ac` and `Makefile.in` entirely. It's late now but I'll try and put up a PR for this tomorrow or Friday. I totally support removal of `$ASFLAGS`. I mulled over the idea, but I was not sure. But your analysis makes sense and provides the justification. > but then I realised that the header being included already does this! Correct. That is also my understanding. > If we do what you propose and invoke gcc as an assembler with $CFLAGS, this whole thing sorts itself out (and we can drastically simplify how we handle arm64 pac-ret too!) ���� ---------------------------------------- Bug #20601: Configuration flags are not properly propagated to assembler https://bugs.ruby-lang.org/issues/20601#change-108943 * Author: vo.x (Vit Ondruch) * Status: Open * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- Looking into #18061, one of the issues is that the `.S` files are not processed with the correct flags. For example to have the CET enabled, the `-fcf-protection` should be used to preprocess the `coroutine/amd64/Context.S`. First I thought there is something wrong on Fedora side, therefore I have proposed to export the `ASFLAGS` [1]. However, as it turns out, `$(ASFLAGS)` are used by GNU make default rule and passed to `$(AS)`. And indeed, Ruby had historically override of this rule, but it does not do this anymore since: https://github.com/ruby/ruby/commit/091422388e943de1e67ace6faac3d71ed08c14d2 https://github.com/ruby/ruby/commit/42575570a908aac979a80b89266804c4c688dd7c As can be seen, while previously `$(AS)` was used to process the `.s` file, it was replaced by the compiler. This however means that the `.S` files are not preprocessed with the `$(CFLAGS)`, which contains `-fcf-protection`. [1]: https://bugzilla.redhat.com/show_bug.cgi?id=2293107 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/