From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B64DB158013 for ; Sun, 3 Dec 2023 09:02:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F06052BC01B; Sun, 3 Dec 2023 09:02:57 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CF4B82BC01B for ; Sun, 3 Dec 2023 09:02:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 72EC0335C31 for ; Sun, 3 Dec 2023 09:02:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 94D0DACA for ; Sun, 3 Dec 2023 09:02:54 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1701594124.345f98126f9d9d6abbd7fa89868f2c4edfed6001.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/dbus-broker/, sys-apps/dbus-broker/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/dbus-broker/dbus-broker-33-r2.ebuild sys-apps/dbus-broker/dbus-broker-9999.ebuild sys-apps/dbus-broker/files/dbus-broker-33-strict-aliasing.patch X-VCS-Directories: sys-apps/dbus-broker/files/ sys-apps/dbus-broker/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 345f98126f9d9d6abbd7fa89868f2c4edfed6001 X-VCS-Branch: master Date: Sun, 3 Dec 2023 09:02:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1142d359-ed9b-4b3a-bf5a-4022f27417ed X-Archives-Hash: 234368da2e80bce58e9a4e24840de71c commit: 345f98126f9d9d6abbd7fa89868f2c4edfed6001 Author: Sam James gentoo org> AuthorDate: Sun Dec 3 09:00:42 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sun Dec 3 09:02:04 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=345f9812 sys-apps/dbus-broker: backport strict aliasing fix Closes: https://bugs.gentoo.org/919100 Signed-off-by: Sam James gentoo.org> ...broker-9999.ebuild => dbus-broker-33-r2.ebuild} | 10 +- sys-apps/dbus-broker/dbus-broker-9999.ebuild | 10 +- .../files/dbus-broker-33-strict-aliasing.patch | 207 +++++++++++++++++++++ 3 files changed, 217 insertions(+), 10 deletions(-) diff --git a/sys-apps/dbus-broker/dbus-broker-9999.ebuild b/sys-apps/dbus-broker/dbus-broker-33-r2.ebuild similarity index 88% copy from sys-apps/dbus-broker/dbus-broker-9999.ebuild copy to sys-apps/dbus-broker/dbus-broker-33-r2.ebuild index 22288e01ccf3..e1bb5c68ca07 100644 --- a/sys-apps/dbus-broker/dbus-broker-9999.ebuild +++ b/sys-apps/dbus-broker/dbus-broker-33-r2.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit flag-o-matic meson +inherit meson if [[ ${PV} == 9999 ]]; then inherit git-r3 @@ -41,6 +41,10 @@ BDEPEND=" virtual/pkgconfig " +PATCHES=( + "${FILESDIR}"/${PN}-33-strict-aliasing.patch +) + if [[ ${PV} == 9999 ]]; then src_unpack() { git-r3_src_unpack @@ -50,10 +54,6 @@ src_unpack() { fi src_configure() { - # Causes test failures with -fno-semantic-interposition (bug #919100) - append-flags -fno-strict-aliasing - filter-lto - local emesonargs=( $(meson_use apparmor) $(meson_use audit) diff --git a/sys-apps/dbus-broker/dbus-broker-9999.ebuild b/sys-apps/dbus-broker/dbus-broker-9999.ebuild index 22288e01ccf3..e1bb5c68ca07 100644 --- a/sys-apps/dbus-broker/dbus-broker-9999.ebuild +++ b/sys-apps/dbus-broker/dbus-broker-9999.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit flag-o-matic meson +inherit meson if [[ ${PV} == 9999 ]]; then inherit git-r3 @@ -41,6 +41,10 @@ BDEPEND=" virtual/pkgconfig " +PATCHES=( + "${FILESDIR}"/${PN}-33-strict-aliasing.patch +) + if [[ ${PV} == 9999 ]]; then src_unpack() { git-r3_src_unpack @@ -50,10 +54,6 @@ src_unpack() { fi src_configure() { - # Causes test failures with -fno-semantic-interposition (bug #919100) - append-flags -fno-strict-aliasing - filter-lto - local emesonargs=( $(meson_use apparmor) $(meson_use audit) diff --git a/sys-apps/dbus-broker/files/dbus-broker-33-strict-aliasing.patch b/sys-apps/dbus-broker/files/dbus-broker-33-strict-aliasing.patch new file mode 100644 index 000000000000..cb21fb08ae5e --- /dev/null +++ b/sys-apps/dbus-broker/files/dbus-broker-33-strict-aliasing.patch @@ -0,0 +1,207 @@ +https://bugs.gentoo.org/919100 +https://github.com/c-util/c-utf8/issues/4 +https://github.com/c-util/c-utf8/commit/4b7cb9f940e45d3c68bf427cdeeaf5da47b03b41 + +From 4b7cb9f940e45d3c68bf427cdeeaf5da47b03b41 Mon Sep 17 00:00:00 2001 +From: David Rheinsberg +Date: Wed, 4 Jan 2023 14:14:56 +0100 +Subject: [PATCH] c-utf8: avoid violating strict-aliasing rules + +Use the c_load*() helpers of c-stdaux to avoid the strict aliasing rules +of the C language. + +Signed-off-by: David Rheinsberg +--- a/subprojects/libcutf8-1/src/c-utf8.c ++++ b/subprojects/libcutf8-1/src/c-utf8.c +@@ -17,9 +17,9 @@ + #define C_UTF8_ASCII_MASK ((size_t)UINT64_C(0x8080808080808080)) + #define C_UTF8_ASCII_SUB ((size_t)UINT64_C(0x0101010101010101)) + +-static inline int c_utf8_word_is_ascii(const size_t *word) { ++static inline int c_utf8_word_is_ascii(size_t word) { + /* True unless any byte is NULL or has the MSB set. */ +- return ((((*word - C_UTF8_ASCII_SUB) | *word) & C_UTF8_ASCII_MASK) == 0); ++ return ((((word - C_UTF8_ASCII_SUB) | word) & C_UTF8_ASCII_MASK) == 0); + } + + /** +@@ -37,10 +37,10 @@ static inline int c_utf8_word_is_ascii(const size_t *word) { + * byte, without any upper bound on its length. + */ + _c_public_ void c_utf8_verify_ascii(const char **strp, size_t *lenp) { +- unsigned char *str = (unsigned char *)*strp; ++ const char *str = *strp; + size_t len = lenp ? *lenp : (size_t)-1; + +- while (len > 0 && *str < 128) { ++ while (len > 0 && c_load_8(str, 0) < 128) { + if ((void*)c_align_to((unsigned long)str, sizeof(size_t)) == str) { + /* + * If the string is aligned to a word boundary, scan two +@@ -51,8 +51,8 @@ _c_public_ void c_utf8_verify_ascii(const char **strp, size_t *lenp) { + * available. + */ + while (len >= 2 * sizeof(size_t)) { +- if (!c_utf8_word_is_ascii((size_t*)str) || +- !c_utf8_word_is_ascii(((size_t*)str) + 1)) ++ if (!c_utf8_word_is_ascii(c_load(size_t, le, aligned, str, 0)) || ++ !c_utf8_word_is_ascii(c_load(size_t, le, aligned, str, sizeof(size_t)))) + break; + + str += 2 * sizeof(size_t); +@@ -63,8 +63,8 @@ _c_public_ void c_utf8_verify_ascii(const char **strp, size_t *lenp) { + /* + * Find the actual end of the ASCII-portion of the string. + */ +- while (len > 0 && *str < 128) { +- if (_c_unlikely_(*str == 0x00)) ++ while (len > 0 && c_load_8(str, 0) < 128) { ++ if (_c_unlikely_(c_load_8(str, 0) == 0x00)) + goto out; + ++str; + --len; +@@ -74,7 +74,7 @@ _c_public_ void c_utf8_verify_ascii(const char **strp, size_t *lenp) { + * The string was not aligned, scan one character at a time until + * it is. + */ +- if (_c_unlikely_(*str == 0x00)) ++ if (_c_unlikely_(c_load_8(str, 0) == 0x00)) + goto out; + ++str; + --len; +@@ -82,7 +82,7 @@ _c_public_ void c_utf8_verify_ascii(const char **strp, size_t *lenp) { + } + + out: +- *strp = (char *)str; ++ *strp = str; + if (lenp) + *lenp = len; + } +@@ -104,13 +104,13 @@ _c_public_ void c_utf8_verify_ascii(const char **strp, size_t *lenp) { + * byte, without any upper bound on its length. + */ + _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { +- unsigned char *str = (unsigned char *)*strp; ++ const char *str = *strp; + size_t len = lenp ? *lenp : (size_t)-1; + + /* See Unicode 10.0.0, Chapter 3, Section D92 */ + + while (len > 0) { +- switch (*str) { ++ switch (c_load_8(str, 0)) { + case 0x00: + goto out; + case 0x01 ... 0x7F: +@@ -123,7 +123,7 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + case 0xC2 ... 0xDF: + if (_c_unlikely_(len < 2)) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 1)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 1)))) + goto out; + + str += 2; +@@ -133,9 +133,9 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + case 0xE0: + if (_c_unlikely_(len < 3)) + goto out; +- if (_c_unlikely_(*(str + 1) < 0xA0 || *(str + 1) > 0xBF)) ++ if (_c_unlikely_(c_load_8(str, 1) < 0xA0 || c_load_8(str, 1) > 0xBF)) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 2)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 2)))) + goto out; + + str += 3; +@@ -145,9 +145,9 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + case 0xE1 ... 0xEC: + if (_c_unlikely_(len < 3)) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 1)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 1)))) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 2)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 2)))) + goto out; + + str += 3; +@@ -157,9 +157,9 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + case 0xED: + if (_c_unlikely_(len < 3)) + goto out; +- if (_c_unlikely_(*(str + 1) < 0x80 || *(str + 1) > 0x9F)) ++ if (_c_unlikely_(c_load_8(str, 1) < 0x80 || c_load_8(str, 1) > 0x9F)) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 2)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 2)))) + goto out; + + str += 3; +@@ -169,9 +169,9 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + case 0xEE ... 0xEF: + if (_c_unlikely_(len < 3)) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 1)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 1)))) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 2)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 2)))) + goto out; + + str += 3; +@@ -181,11 +181,11 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + case 0xF0: + if (_c_unlikely_(len < 4)) + goto out; +- if (_c_unlikely_(*(str + 1) < 0x90 || *(str + 1) > 0xBF)) ++ if (_c_unlikely_(c_load_8(str, 1) < 0x90 || c_load_8(str, 1) > 0xBF)) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 2)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 2)))) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 3)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 3)))) + goto out; + + str += 4; +@@ -195,11 +195,11 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + case 0xF1 ... 0xF3: + if (_c_unlikely_(len < 4)) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 1)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 1)))) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 2)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 2)))) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 3)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 3)))) + goto out; + + str += 4; +@@ -209,11 +209,11 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + case 0xF4: + if (_c_unlikely_(len < 4)) + goto out; +- if (_c_unlikely_(*(str + 1) < 0x80 || *(str + 1) > 0x8F)) ++ if (_c_unlikely_(c_load_8(str, 1) < 0x80 || c_load_8(str, 1) > 0x8F)) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 2)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 2)))) + goto out; +- if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(*(str + 3)))) ++ if (_c_unlikely_(!C_UTF8_CHAR_IS_TAIL(c_load_8(str, 3)))) + goto out; + + str += 4; +@@ -226,7 +226,7 @@ _c_public_ void c_utf8_verify(const char **strp, size_t *lenp) { + } + + out: +- *strp = (char *)str; ++ *strp = str; + if (lenp) + *lenp = len; + }