File: baremetal-multilib.yaml

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (158 lines) | stat: -rw-r--r-- 7,757 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# REQUIRES: shell
# UNSUPPORTED: system-windows

# RUN: rm -rf %T/baremetal_multilib
# RUN: mkdir -p %T/baremetal_multilib/bin
# RUN: mkdir -p %T/baremetal_multilib/lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/lib
# RUN: touch %T/baremetal_multilib/lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/lib/libclang_rt.builtins.a
# RUN: ln -s %clang %T/baremetal_multilib/bin/clang
# RUN: ln -s %s %T/baremetal_multilib/lib/clang-runtimes/multilib.yaml

# RUN: %T/baremetal_multilib/bin/clang -no-canonical-prefixes -x c++ %s -### -o %t.out 2>&1 \
# RUN:     --target=thumbv8m.main-none-eabihf --sysroot= \
# RUN:   | FileCheck -DSYSROOT=%T/baremetal_multilib %s
# CHECK:      "-cc1" "-triple" "thumbv8m.main-none-unknown-eabihf"
# CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/include/c++/v1"
# CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/include"
# CHECK-SAME: "-x" "c++" "{{.*}}baremetal-multilib.yaml"
# CHECK-NEXT: ld{{(.exe)?}}" "{{.*}}.o" "-Bstatic"
# CHECK-SAME: "-L[[SYSROOT]]/bin/../lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/lib"
# CHECK-SAME: "-lc" "-lm" "-lclang_rt.builtins"
# CHECK-SAME: "-o" "{{.*}}.tmp.out"

# RUN: %T/baremetal_multilib/bin/clang -no-canonical-prefixes -x c++ %s -### -o %t.out 2>&1 \
# RUN:     --target=thumbv7em-none-eabi -mfpu=fpv4-sp-d16 --sysroot= \
# RUN:   | FileCheck --check-prefix=CHECK-NO-MATCH %s
# CHECK-NO-MATCH: warning: no multilib found matching flags:
# CHECK-NO-MATCH-SAME: --target=thumbv7em-none-unknown-eabi
# CHECK-NO-MATCH: note: available multilibs are:
# CHECK-NO-MATCH: --target=thumbv6m-none-unknown-eabi -mfpu=none
# CHECK-NO-MATCH: --target=thumbv7m-none-unknown-eabi -mfpu=none
# CHECK-NO-MATCH: --target=thumbv7em-none-unknown-eabi -mfpu=none

# RUN: %T/baremetal_multilib/bin/clang -no-canonical-prefixes -print-multi-directory 2>&1 \
# RUN:     --target=thumbv8m.main-none-eabihf --sysroot= \
# RUN:   | FileCheck --check-prefix=CHECK-PRINT-MULTI-DIRECTORY %s
# CHECK-PRINT-MULTI-DIRECTORY: arm-none-eabi/thumb/v8-m.main/fp

# RUN: %T/baremetal_multilib/bin/clang -no-canonical-prefixes -print-multi-lib 2>&1 \
# RUN:     --target=arm-none-eabi --sysroot= \
# RUN:   | FileCheck --check-prefix=CHECK-PRINT-MULTI-LIB %s
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v6-m/nofp;@-target=thumbv6m-none-unknown-eabi@mfpu=none
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v7-m/nofp;@-target=thumbv7m-none-unknown-eabi@mfpu=none
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v7e-m/nofp;@-target=thumbv7em-none-unknown-eabi@mfpu=none
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8-m.main/nofp;@-target=thumbv8m.main-none-unknown-eabi@mfpu=none
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8.1-m.main/nofp/nomve;@-target=thumbv8.1m.main-none-unknown-eabi@mfpu=none
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v7e-m/fpv4_sp_d16;@-target=thumbv7em-none-unknown-eabihf@mfpu=fpv4-sp-d16
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v7e-m/fpv5_d16;@-target=thumbv7em-none-unknown-eabihf@mfpu=fpv5-d16
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8-m.main/fp;@-target=thumbv8m.main-none-unknown-eabihf@mfpu=fpv5-d16
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8.1-m.main/fp;@-target=thumbv8.1m.main-none-unknown-eabihf@mfpu=fp-armv8-fullfp16-sp-d16
# CHECK-PRINT-MULTI-LIB: arm-none-eabi/thumb/v8.1-m.main/nofp/mve;@-target=thumbv8.1m.main-none-unknown-eabihf@march=thumbv8.1m.main+mve@mfpu=none

# RUN: %T/baremetal_multilib/bin/clang -no-canonical-prefixes -x assembler -mexecute-only \
# RUN:     --target=arm-none-eabi --sysroot= %s -c -### 2>&1 \
# RUN:    | FileCheck %s --check-prefix=CHECK-NO-EXECUTE-ONLY-ASM
# CHECK-NO-EXECUTE-ONLY-ASM: warning: argument unused during compilation: '-mexecute-only'

---
# This file is in two parts:
# 1. A list of library variants.
# 2. A mapping from flags generated from command line arguments to further
#    flags.

# How does clang use this file?
# 1. If the ToolChain class for the architecture supports this form of
#    multilib it then it loads the file if present in sysroot.
# 2. Generate flags from the user provided arguments.
#    (Use `clang -print-multi-flags-experimental` to see which flags are
#    generated).
# 3. Compare the arguments against each regular expression and store
#    associated flags if there's a match.
# 4. Find the last library variant whose flags are a subset of the
#    flags derived from the user provided arguments.
# 5. Use the directory for the library variant as the sysroot.

# Clang will emit an error if this number is greater than its current multilib
# version or if its major version differs, but will accept lesser minor
# versions.
MultilibVersion: 1.0

# The first section of the file is the list of library variants.
# A library is considered compatible if the are a subset of the flags derived
# from the arguments provided by the user.
# If multiple libraries are deemed compatible then the one that appears
# last in the list wins. A ToolChain may instead opt to use more than one
# multilib, layered on top of each other.

Variants:
- Dir: arm-none-eabi/arm/v4t
  Flags: [--target=armv4t-none-unknown-eabi]

- Dir: arm-none-eabi/thumb/v6-m/nofp
  Flags: [--target=thumbv6m-none-unknown-eabi, -mfpu=none]

- Dir: arm-none-eabi/thumb/v7-m/nofp
  Flags: [--target=thumbv7m-none-unknown-eabi, -mfpu=none]

- Dir: arm-none-eabi/thumb/v7e-m/nofp
  Flags: [--target=thumbv7em-none-unknown-eabi, -mfpu=none]

- Dir: arm-none-eabi/thumb/v8-m.main/nofp
  Flags: [--target=thumbv8m.main-none-unknown-eabi, -mfpu=none]

- Dir: arm-none-eabi/thumb/v8.1-m.main/nofp/nomve
  Flags: [--target=thumbv8.1m.main-none-unknown-eabi, -mfpu=none]

- Dir: arm-none-eabi/thumb/v7e-m/fpv4_sp_d16
  Flags: [--target=thumbv7em-none-unknown-eabihf, -mfpu=fpv4-sp-d16]

- Dir: arm-none-eabi/thumb/v7e-m/fpv5_d16
  Flags: [--target=thumbv7em-none-unknown-eabihf, -mfpu=fpv5-d16]

- Dir: arm-none-eabi/thumb/v8-m.main/fp
  Flags: [--target=thumbv8m.main-none-unknown-eabihf, -mfpu=fpv5-d16]

- Dir: arm-none-eabi/thumb/v8.1-m.main/fp
  Flags: [--target=thumbv8.1m.main-none-unknown-eabihf, -mfpu=fp-armv8-fullfp16-sp-d16]

- Dir: arm-none-eabi/thumb/v8.1-m.main/nofp/mve
  Flags: [--target=thumbv8.1m.main-none-unknown-eabihf, -march=thumbv8.1m.main+mve, -mfpu=none]


# The second section of the file is a map from auto-detected flags
# to custom flags. The auto-detected flags can be printed out
# by running clang with `-print-multi-flags-experimental`.
# The regex must match a whole flag string.
# All flags in the "Flags" list will be added if an argument matches.
Mappings:
# For v8m.base (and potential later v8m baseline versions) use v6m
- Match: --target=thumbv8(\.[0-9]+)?m\.base-none-unknown-eabi
  Flags: [--target=thumbv6m-none-unknown-eabi]
# Match versions after v8.1m.main. We assume that v8.2m (if/when it exists) will
# be backwards compatible with v8.1m.
# The alternative is to not recognise later versions, and require that
# this multilib spec is updated before it can be used with newer
# architecture versions.
- Match: --target=thumbv8\.[1-9]m\.main-none-unknown-eabi
  Flags: [--target=thumbv8.1m.main-none-unknown-eabi]
- Match: --target=thumbv8\.[1-9]m\.main-none-unknown-eabihf
  Flags: [--target=thumbv8.1m.main-none-unknown-eabihf]

- Match: -march=thumbv8\.[1-9]m\.main.*\+mve($|\+).*
  Flags: [-march=thumbv8.1m.main+mve]

# Hierarchy among FPUs: fpvN-d16 is a superset of fpvN-sp-d16, and
# fpvN-d16 is a superset of fpv[N-1]-d16, for all N.
- Match: -mfpu=fpv5-d16
  Flags:
  - -mfpu=fpv4-d16
  - -mfpu=fpv5-sp-d16
  - -mfpu=fpv4-sp-d16
- Match: -mfpu=fpv5-sp-d16
  Flags:
  - -mfpu=fpv4-sp-d16
- Match: -mfpu=fpv4-d16
  Flags:
  - -mfpu=fpv4-sp-d16

...