···1688sorry, unimplemented: __builtin_clear_padding not supported for variable length aggregates
1689```
16900000001691#### `pacret` {#pacret}
16921693This flag adds the `-mbranch-protection=pac-ret` compiler option on aarch64-linux targets. This uses ARM v8.3's Pointer Authentication feature to sign function return pointers before adding them to the stack. The pointer's authenticity is then validated before returning to its destination. This dramatically increases the difficulty of ROP exploitation techniques.
···1688sorry, unimplemented: __builtin_clear_padding not supported for variable length aggregates
1689```
16901691+#### `glibcxxassertions` {#glibcxxassertions}
1692+1693+Adds the `-D_GLIBCXX_ASSERTIONS` compiler flag. This flag only has an effect on libstdc++ targets, and when defined, enables extra error checking in the form of precondition assertions, such as bounds checking in c++ strings and null pointer checks when dereferencing c++ smart pointers.
1694+1695+These checks may have an impact on performance in some cases.
1696+1697#### `pacret` {#pacret}
16981699This flag adds the `-mbranch-protection=pac-ret` compiler option on aarch64-linux targets. This uses ARM v8.3's Pointer Authentication feature to sign function return pointers before adding them to the stack. The pointer's authenticity is then validated before returning to its destination. This dramatically increases the difficulty of ROP exploitation techniques.
+5-1
pkgs/build-support/cc-wrapper/add-hardening.sh
···525354if (( "${NIX_DEBUG:-0}" >= 1 )); then
55- declare -a allHardeningFlags=(fortify fortify3 shadowstack stackprotector stackclashprotection nostrictaliasing pacret strictflexarrays1 strictflexarrays3 pie pic strictoverflow format trivialautovarinit zerocallusedregs)
56 declare -A hardeningDisableMap=()
5758 # Determine which flags were effectively disabled so we can report below.
···110 pacret)
111 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling pacret >&2; fi
112 hardeningCFlagsBefore+=('-mbranch-protection=pac-ret')
0000113 ;;
114 stackprotector)
115 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling stackprotector >&2; fi
···525354if (( "${NIX_DEBUG:-0}" >= 1 )); then
55+ declare -a allHardeningFlags=(fortify fortify3 shadowstack stackprotector stackclashprotection nostrictaliasing pacret strictflexarrays1 strictflexarrays3 pie pic strictoverflow glibcxxassertions format trivialautovarinit zerocallusedregs)
56 declare -A hardeningDisableMap=()
5758 # Determine which flags were effectively disabled so we can report below.
···110 pacret)
111 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling pacret >&2; fi
112 hardeningCFlagsBefore+=('-mbranch-protection=pac-ret')
113+ ;;
114+ glibcxxassertions)
115+ if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling glibcxxassertions >&2; fi
116+ hardeningCFlagsBefore+=('-D_GLIBCXX_ASSERTIONS')
117 ;;
118 stackprotector)
119 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling stackprotector >&2; fi