commit:     d6abfc2b87604431291c7dd04a4a33b23a420366
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 17 23:26:12 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Mar 22 08:57:44 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6abfc2b

sys-libs/zlib-ng: disable unaligned access

We've discussed this in the past for sys-libs/zlib and we've avoided
enabling it there for now, although e.g. Debian did at the last time
I checked.

It's undefined behaviour and risky, even where it does (appear to) work
on e.g. amd64.

See: https://github.com/gentoo/gentoo/pull/17167
Signed-off-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild 
b/sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild
index bb16ca91c10..5fd01079542 100644
--- a/sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild
+++ b/sys-libs/zlib-ng/zlib-ng-2.0.1-r1.ebuild
@@ -28,6 +28,10 @@ src_configure() {
        local mycmakeargs=(
                -DZLIB_COMPAT="$(usex compat)"
                -DZLIB_ENABLE_TESTS="$(usex test)"
+               # Unaligned access is controversial and undefined behaviour
+               # Let's keep it off for now
+               # https://github.com/gentoo/gentoo/pull/17167
+               -DWITH_UNALIGNED="OFF"
        )
        cmake_src_configure
 }

Reply via email to