Commit dd09e8f
committed
BUG: Allow '.' and '+' in -march/-mtune strip regex (issue #6133)
Backport of the main-branch fix to release-5.4 for inclusion in 5.4.7.
The aggressive optimization flag stripping in
generate_castxml_commandline_flags() must remove -march=/-mtune=
arguments before feeding the compiler line to castxml, because
castxml's bundled clang preprocessor does not accept all backend
target features. The previous regex character class
[a-zA-Z0-9\-]* stopped at the first non-alphanumeric, non-hyphen
character, so extended target descriptors silently lost their tail:
-march=armv8.2-a+fp16+rcpc+dotprod+crypto
^^^^^^^^^ <-- only this much matched
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <-- this remained verbatim
The leftover fragment ".2-a+fp16+rcpc+dotprod+crypto" was then
passed to clang as a positional argument, producing:
clang++: error: no such file or directory: '.2-a+fp16+rcpc+dotprod+crypto'
Reported on Arch Linux aarch64 against ITK 5.4.6. The same class
of breakage applies to extended x86 names like -march=znver3 or
-march=skylake-avx512.
Extend the character class to [A-Za-z0-9._+\-]* so the entire token
is matched and stripped.1 parent ccb17dc commit dd09e8f
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
0 commit comments