[all-commits] [llvm/llvm-project] 2a551a: [Multilib] Add -fmultilib-flag command-line option...

Victor Campos via All-commits all-commits at lists.llvm.org
Mon Jan 13 05:54:14 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a551ab3002897ba52a27961b766f3741695c816
      https://github.com/llvm/llvm-project/commit/2a551ab3002897ba52a27961b766f3741695c816
  Author: Victor Campos <victor.campos at arm.com>
  Date:   2025-01-13 (Mon, 13 Jan 2025)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChain.cpp
    M clang/test/Driver/print-multi-selection-flags.c

  Log Message:
  -----------
  [Multilib] Add -fmultilib-flag command-line option (#110658)

This patch is the second step to extend the current multilib system to
support the selection of library variants which do not correspond to
existing command-line options.

Proposal can be found in
https://discourse.llvm.org/t/rfc-multilib-custom-flags/81058

The multilib mechanism supports libraries that target code generation or
language options such as --target, -mcpu, -mfpu, -mbranch-protection.
However, some library variants are particular to features that do not
correspond to any command-line options. Examples include variants for
multithreading and semihosting.

This work introduces a way to instruct the multilib system to consider
these features in library selection.

The driver must be informed about the multilib custom flags with a new
command-line option.
```
-fmultilib-flag=C
```
Where the grammar for C is:
```
C -> option
option -> multithreaded | no-multithreaded | io-none | io-semihosting | io-linux-syscalls | ...
```
There must be one option instance for each flag specified:
```
-fmultilib-flag=multithreaded -fmultilib-flag=io-semihosting
```
Contradictory options are untied by *last one wins*.

These options are to be used exclusively by the multilib mechanism in
the Clang driver. Hence they are not forwarded to the compiler frontend.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list