Commit 665444c
committed
[Downstream change][Multilib] Extend the Multilib system to support an IncludeDirs field. (arm#447)
Downstream issue:arm#446.
This patch extends the Multilib yaml format to allow specifying an
IncludeDirs for the header path/s per multilib variant. The goal is to
enable fine-grained control over header search paths for each multilib
variant. This feature is especially useful in setups where header paths
deviate from the default bare-metal assumptions. For example, when
headers are shared across target triples, it becomes necessary to
organise them under target-triple-specific directories to ensure correct
resolution.
This is already in upstream review
llvm/llvm-project#146651.
Since the review is pending, a downstream patch is made to enable
IncludeDirs support in multilib.yaml
[ATFE] Package common multilib headers into target triple directory. (arm#423)
The current ATFE package redundantly duplicates identical C and C++
headers across more than 100 ibrary variants, despite the fact that
these headers do not vary within a given target triple aside from few.
As a result, each variant currently maintains its own include/ and
include/c++/v1/ directories, leading to unnecessary duplication.
This patch is to refactor the multilib layout to use a single shared
header directory per target triple, eliminating redundant copies of
identical headers across library variants, while keeping
variant-specific headers within each variant’s own include/ directory.
Changing the layout of the package structure will require corresponding
updates to the ATFE build system, as it currently assumes a variant
specific directory hierarchy for headers and libraries during
installation and packaging.
A new Python script has been introduced that runs after the runtime
subproject has been executed for each variant and the non-optimised
multilib directories have been generated. This script identifies and
extracts common headers from the non-optimised multilibs and creates an
optimized multilib directory. In this optimised directory, only the
common headers are centralised, while the remaining contents are
preserved as-is from the non-optimised layout.
A CMake flag called ENABLE_MULTILIB_HEADER_OPTIMISATION has been added
to disable this multilib optimisation phase. When this flag is not set,
the optimised multilib directory will not be generated. Additionally,
the optimisation step is skipped automatically if there are fewer than
two multilib variants to build.
To support this new layout with a centralised include directory, a new
field called IncludeDirs has been added to multilib.yaml. This field
specifies a base directory for locating header files which gets added to
the header search path sequence by clang.
Corresponding changes in Clang:
llvm/llvm-project#146651
[ATFE] Prioritize multilib-specific headers over target-level headers. (arm#451)
Adjust the header search order so that variant-specific directories (e.g
armv6m_soft_nofp_size/include/) are searched before the common
target-level directories (e.g include/) in the -internal-isystem list.
This ensures that headers tailored for a specific multilib variant take
precedence over the generic headers, allowing correct header resolution
in the presence of overrides.
Previously, the common target-level directory could shadow
multilib-specific headers if the same file existed in both paths.1 parent f276873 commit 665444c
File tree
8 files changed
+342
-15
lines changed- arm-software/embedded
- arm-multilib
- clang
- include/clang/Driver
- lib/Driver
- ToolChains
- test/Driver
8 files changed
+342
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
| |||
646 | 651 | | |
647 | 652 | | |
648 | 653 | | |
| 654 | + | |
649 | 655 | | |
650 | 656 | | |
651 | 657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
| |||
251 | 254 | | |
252 | 255 | | |
253 | 256 | | |
| 257 | + | |
| 258 | + | |
254 | 259 | | |
255 | 260 | | |
256 | 261 | | |
| |||
337 | 342 | | |
338 | 343 | | |
339 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
340 | 350 | | |
341 | 351 | | |
342 | 352 | | |
| |||
386 | 396 | | |
387 | 397 | | |
388 | 398 | | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
Lines changed: 168 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
| |||
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
| |||
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
84 | 99 | | |
85 | 100 | | |
86 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| |||
299 | 305 | | |
300 | 306 | | |
301 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
302 | 311 | | |
303 | 312 | | |
304 | 313 | | |
| |||
350 | 359 | | |
351 | 360 | | |
352 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
353 | 365 | | |
354 | 366 | | |
355 | 367 | | |
| |||
359 | 371 | | |
360 | 372 | | |
361 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
362 | 380 | | |
363 | 381 | | |
364 | 382 | | |
| |||
489 | 507 | | |
490 | 508 | | |
491 | 509 | | |
492 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
493 | 514 | | |
494 | 515 | | |
495 | 516 | | |
| |||
498 | 519 | | |
499 | 520 | | |
500 | 521 | | |
501 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
502 | 525 | | |
503 | 526 | | |
504 | 527 | | |
| |||
0 commit comments