Please add -D_GLIBCXX_ASSERTIONS to default build flags

Bug #2016042 reported by Mark Esler
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
New
Wishlist
Unassigned
gcc-12 (Ubuntu)
New
Wishlist
Unassigned
gcc-13 (Ubuntu)
New
Medium
Unassigned

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

Tags: sec-1935
Revision history for this message
Matthias Klose (doko) wrote :

this is added to Fedora's and Gentoo's build systems. No, this definitely not a GCC default setting

Changed in gcc-12 (Ubuntu):
status: New → Invalid
Revision history for this message
Mark Esler (eslerm) wrote (last edit ):

Security's request to add gcc hardening flags is valid as discussed in https://bugs.launchpad.net/ubuntu/+source/gcc-12/+bug/1972043.

> As Kees says, adding it to gcc means not only does this benefit Ubuntu archive packages, but also any software which is built on a Ubuntu machine using gcc (ie snaps built by launchpad, packages built on Github using Ubuntu as the CI backend etc) - which is a great benefit IMO.

Changed in gcc-12 (Ubuntu):
status: Invalid → New
Mark Esler (eslerm)
Changed in dpkg (Ubuntu):
importance: Undecided → Wishlist
Changed in gcc-12 (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Matthias Klose (doko) wrote :

seriously, referencing a bug from 2008 in bluez-utils?

Changed in gcc-12 (Ubuntu):
status: New → Won't Fix
Revision history for this message
Mark Esler (eslerm) wrote :

Apologize, I linked the wrong LP. Edited comment to https://bugs.launchpad.net/ubuntu/+source/gcc-12/+bug/1972043

Changed in gcc-12 (Ubuntu):
status: Won't Fix → New
Mark Esler (eslerm)
tags: added: sec-1935
Mark Esler (eslerm)
description: updated
Changed in gcc-13 (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-24.04
Mark Esler (eslerm)
description: updated
Revision history for this message
Mark Esler (eslerm) wrote :

This is being pushed to 24.10

Changed in gcc-13 (Ubuntu):
milestone: ubuntu-24.04 → none
importance: High → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.