Skip to content

Commit

Permalink
net-libs/mbedtls: fix tests with GCC 15
Browse files Browse the repository at this point in the history
GCC 15 makes a change to union initialisation and exposes a bug in
mbedtls. Build with the new -fzero-init-padding-bits=unions flag if
supported to fix the testsuite until the upstream bug is fixed.

Bug: Mbed-TLS/mbedtls#9814
Closes: https://bugs.gentoo.org/946544
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
thesamesam committed Dec 23, 2024
1 parent 1d27c5d commit 40ea681
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EAPI=8

PYTHON_COMPAT=( python3_{10..12} )

inherit cmake multilib-minimal python-any-r1
inherit cmake flag-o-matic multilib-minimal python-any-r1

DESCRIPTION="Cryptographic library for embedded systems"
HOMEPAGE="https://www.trustedfirmware.org/projects/mbed-tls/"
Expand Down Expand Up @@ -49,6 +49,13 @@ src_prepare() {
cmake_src_prepare
}

src_configure() {
# Workaround for https://github.com/Mbed-TLS/mbedtls/issues/9814 (bug #946544)
append-flags $(test-flags-CC -fzero-init-padding-bits=unions)

multilib-minimal_src_configure
}

multilib_src_configure() {
local mycmakeargs=(
-DENABLE_PROGRAMS=$(multilib_native_usex programs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EAPI=8

PYTHON_COMPAT=( python3_{10..13} )

inherit cmake multilib-minimal python-any-r1
inherit cmake flag-o-matic multilib-minimal python-any-r1

DESCRIPTION="Cryptographic library for embedded systems"
HOMEPAGE="https://www.trustedfirmware.org/projects/mbed-tls/"
Expand Down Expand Up @@ -48,6 +48,13 @@ src_prepare() {
cmake_src_prepare
}

src_configure() {
# Workaround for https://github.com/Mbed-TLS/mbedtls/issues/9814 (bug #946544)
append-flags $(test-flags-CC -fzero-init-padding-bits=unions)

multilib-minimal_src_configure
}

multilib_src_configure() {
local mycmakeargs=(
-DENABLE_PROGRAMS=$(multilib_native_usex programs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EAPI=8

PYTHON_COMPAT=( python3_{10..13} )

inherit cmake multilib-minimal python-any-r1
inherit cmake flag-o-matic multilib-minimal python-any-r1

DESCRIPTION="Cryptographic library for embedded systems"
HOMEPAGE="https://www.trustedfirmware.org/projects/mbed-tls/"
Expand Down Expand Up @@ -42,6 +42,13 @@ src_prepare() {
cmake_src_prepare
}

src_configure() {
# Workaround for https://github.com/Mbed-TLS/mbedtls/issues/9814 (bug #946544)
append-flags $(test-flags-CC -fzero-init-padding-bits=unions)

multilib-minimal_src_configure
}

multilib_src_configure() {
local mycmakeargs=(
-DENABLE_PROGRAMS=$(multilib_native_usex programs)
Expand Down

0 comments on commit 40ea681

Please sign in to comment.