Repository navigation
Commit 7cd5fbe
committed
Do not sign return addresses in functions built for ARMv8.3 and later
A target of ARMv8.3 or later has `FEAT_PAuth`, so under `-mbranch-protection=pac-ret`
the compiler folds `autiasp; ret` into `retaa`. Unlike `paciasp` and `autiasp`, `retaa`
is not in the `NOP` space and raises SIGILL on cores without `FEAT_PAuth` (Graviton2,
Ampere Altra). One of these functions is the CPU probe `_simsimd_capabilities_arm`
(`arch=armv8.5-a+sve`), which runs on every core; the others are the bf16 kernels
(`arch=armv8.6-a+...`).
Add `branch-protection=none` to these targets only. The code for ARMv8.2 and older keeps
the signing: a callee whose branch protection differs from the caller's is not inlined,
and with ThinLTO that broke `vectorize(enable)` loops calling `simsimd_bf16_to_f32`.
See ClickHouse/ClickHouse#1317481 parent e81e1c2 commit 7cd5fbe
6 files changed
Lines changed: 17 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
505 | | - | |
| 504 | + | |
| 505 | + | |
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
529 | | - | |
| 528 | + | |
| 529 | + | |
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2053 | 2053 | | |
2054 | 2054 | | |
2055 | 2055 | | |
2056 | | - | |
2057 | | - | |
| 2056 | + | |
| 2057 | + | |
2058 | 2058 | | |
2059 | 2059 | | |
2060 | 2060 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
473 | 478 | | |
474 | 479 | | |
475 | | - | |
476 | | - | |
| 480 | + | |
| 481 | + | |
477 | 482 | | |
478 | 483 | | |
479 | 484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
1295 | | - | |
1296 | | - | |
| 1295 | + | |
| 1296 | + | |
1297 | 1297 | | |
1298 | 1298 | | |
1299 | 1299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
473 | | - | |
| 472 | + | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| |||
0 commit comments