Re: [PATCH v3] kbuild: rust: add PROCMACROLDFLAGS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 12, 2024 at 7:45 PM Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:
>
>   - Removed "additional" from the documentation and commit message,
>     since this actually replaces the other flags, unlike other cases.

Some news regarding this: we asked upstream Rust about supporting
overriding all flags (including e.g. `--edition`, `--target` and
`--sysroot`) and apparently this was already accepted via an MCP
(thanks Oli Scherer for the pointer!):

    https://github.com/rust-lang/compiler-team/issues/731

So, in the future, `rustc` will likely get support for this. Thus it
may be best to go with an "additional" approach (rather than
"replace"), so that this environment variable works the same way as
the rest.

We can do that by simply waiting until `rustc` implements it and we
upgrade the minimum, or by implementing a workaround on our side
meanwhile. For instance, something simple like:

    $(filter-out --target=%,$(s)) $(lastword $(filter --target=%,$(s)))

would be probably enough to cover Android's use case since we use the
syntax with `=` elsewhere rather than with a space -- the equal sign
plays well with Make's string functions. We can also add other flags
if needed.

I will send a v4 unless someone thinks it is a bad idea.

Cheers,
Miguel





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux