diff options
Diffstat (limited to 'meta/recipes-graphics/xorg-lib/libxcb')
-rw-r--r-- | meta/recipes-graphics/xorg-lib/libxcb/0001-use-_Alignof-to-avoid-UB-in-ALIGNOF.patch | 42 | ||||
-rw-r--r-- | meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch | 25 |
2 files changed, 42 insertions, 25 deletions
diff --git a/meta/recipes-graphics/xorg-lib/libxcb/0001-use-_Alignof-to-avoid-UB-in-ALIGNOF.patch b/meta/recipes-graphics/xorg-lib/libxcb/0001-use-_Alignof-to-avoid-UB-in-ALIGNOF.patch new file mode 100644 index 0000000000..604e987551 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxcb/0001-use-_Alignof-to-avoid-UB-in-ALIGNOF.patch @@ -0,0 +1,42 @@ +From b529f25a3dcd1547f49d341a0a34fbc1379ed58d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 14 Jan 2023 10:11:35 -0800 +Subject: [PATCH] use _Alignof to avoid UB in ALIGNOF + +WG14 N2350 clearly says that it is an UB having type definitions +within "offsetof" [1]. Clang 16+ has started diagnosing it [2]. +This patch changes the implementation of macro +"ALIGNOF" to builtin "_Alignof" to avoid undefined behavior. + +_Alignof() return the ABI required minimum alignment. + +[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm +[2] https://reviews.llvm.org/D133574 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/42] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/c_client.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/c_client.py b/src/c_client.py +index b7db543..ec81758 100644 +--- a/src/c_client.py ++++ b/src/c_client.py +@@ -288,7 +288,6 @@ def c_open(self): + _c('#include "%s.h"', _ns.header) + + _c('') +- _c('#define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)') + + if _ns.is_ext: + for (n, h) in self.direct_imports: +@@ -1266,7 +1265,7 @@ def _c_serialize_helper_fields(context, self, + count += 1 + + code_lines.append( +- '%s xcb_align_to = ALIGNOF(%s);' ++ '%s xcb_align_to = _Alignof(%s);' + % (space, + 'char' + if field.c_field_type == 'void' or field.type.is_switch diff --git a/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch b/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch deleted file mode 100644 index c0efbdc213..0000000000 --- a/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch +++ /dev/null @@ -1,25 +0,0 @@ -The "check" package is checked for without an explicit enable/disable option, -which can lead to non-deterministic build issues with both check and libxslt. - -As the unit test suite is minimal at present, simply disable the test suite. In -the future if the test suite is expanded this can be made conditional on the -ptest DISTRO_FEATURE. - -Upstream-Status: Inappropriate -Signed-off-by: Ross Burton <ross.burton@intel.com> - - -Index: libxcb-1.12/configure.ac -=================================================================== ---- libxcb-1.12.orig/configure.ac -+++ libxcb-1.12/configure.ac -@@ -36,7 +36,8 @@ if test x"$HAVE_DOT" = xno; then - AC_MSG_WARN([dot not found - doxygen targets will be skipped]) - fi - --PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no]) -+dnl PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no]) -+HAVE_CHECK=no - AM_CONDITIONAL(HAVE_CHECK, test x$HAVE_CHECK = xyes) - - XSLTPROC=no |