[Bug 2016042] Re: Please add -D_GLIBCXX_ASSERTIONS to default build flags
Mark Esler
2016042 at bugs.launchpad.net
Wed Nov 20 20:47:29 UTC 2024
Interesting.
>From https://rfc.archlinux.page/0003-buildflags/ Arch uses
`-Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS` (so that both flags use
-Wp)
And:
> Move -D_FORTIFY_SOURCE=2 from CPPFLAGS to CFLAGS using -Wp
>
> Unfortunately, there are still build systems which use CFLAGS but not CPPFLAGS.
> Or configure tests that use CPPFLAGS and not CFLAGS which creates errors due to
> fortify source needing optimisation. Ultimately, we can cover more code with
> this workaround.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dpkg in Ubuntu.
https://bugs.launchpad.net/bugs/2016042
Title:
Please add -D_GLIBCXX_ASSERTIONS to default build flags
Status in dpkg package in Ubuntu:
New
Status in gcc-12 package in Ubuntu:
New
Status in gcc-13 package in Ubuntu:
New
Status in gcc-14 package in Ubuntu:
New
Bug description:
> The _GLIBCXX_ASSERTIONS macro defines a subset of the _GLIBCXX_DEBUG
> checks, with no impact on class layout and minimal impact on runtime
> (and no changes in algorithmic complexity). It is intended to be
> suitable for both debug builds and release builds. [0]
_GLIBCXX_ASSERTIONS was developed not to impact ABI or big-O
complexity.
Distros which use this flag include Fedora (2018), Arch Linux (2021)
Gentoo Hardened (2022), Alpine (2023), and OpenSUSE [1].
[0] https://bugs.launchpad.net/kicad/+bug/1838448/comments/40
[1] https://github.com/jvoisin/compiler-flags-distro
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/2016042/+subscriptions
More information about the foundations-bugs
mailing list