libxcb 1.10 plus one. Updated ABIs: sync, xkb. New libs: dri3, present.

This commit is contained in:
Adam Jackson 2014-01-27 13:43:14 -05:00
parent 6c69624dd7
commit a2e3f99a9b
2 changed files with 122 additions and 118 deletions

View File

@ -0,0 +1,108 @@
From 3b72a2c9d1d656c74c691a45689e1d637f669e3a Mon Sep 17 00:00:00 2001
From: Kenneth Graunke <kenneth@whitecape.org>
Date: Fri, 3 Jan 2014 15:08:33 -0800
Subject: [PATCH] Force XCB event structures with 64-bit extended fields to be
packed.
With the advent of the Present extension, some events (such as
PresentCompleteNotify) now use native 64-bit types on the wire.
For XGE events, we insert an extra "uint32_t full_sequence" field
immediately after the first 32 bytes of data. Normally, this causes
the subsequent fields to be shifted over by 4 bytes, and the structure
to grow in size by 4 bytes. Everything works fine.
However, if event contains 64-bit extended fields, this may result in
the compiler adding an extra 4 bytes of padding so that those fields
remain aligned on 64-bit boundaries. This causes the structure to grow
by 8 bytes, not 4. Unfortunately, XCB doesn't realize this, and
always believes that the length only increased by 4. read_packet()
then fails to malloc enough memory to hold the event, and the event
processing code uses the wrong offsets.
To fix this, mark any event structures containing 64-bit extended
fields with __attribute__((__packed__)).
v2: Use any(...) instead of True in (...), as suggested by
Daniel Martin.
v3 (Alan Coopersmith): Fix build with Solaris Studio 12.3 by moving the
attribute to after the structure definition.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Keith Packard <keithp@keithp.com> [v1]
Reviewed-by: Josh Triplett <josh@joshtriplett.org> [v1]
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
---
src/c_client.py | 12 +++++++++---
src/xcb.h | 2 ++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/c_client.py b/src/c_client.py
index 99fd307..45de544 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -1762,7 +1762,7 @@ def c_simple(self, name):
# Iterator
_c_iterator(self, name)
-def _c_complex(self):
+def _c_complex(self, force_packed = False):
'''
Helper function for handling all structure types.
Called for all structs, requests, replies, events, errors.
@@ -1817,7 +1817,7 @@ def _c_complex(self):
if b.type.has_name:
_h(' } %s;', b.c_field_name)
- _h('} %s;', self.c_type)
+ _h('} %s%s;', 'XCB_PACKED ' if force_packed else '', self.c_type)
def c_struct(self, name):
'''
@@ -2902,6 +2902,7 @@ def c_event(self, name):
# events while generating the structure for them. Otherwise we would read
# garbage (the internal full_sequence) when accessing normal event fields
# there.
+ force_packed = False
if hasattr(self, 'is_ge_event') and self.is_ge_event and self.name == name:
event_size = 0
for field in self.fields:
@@ -2911,6 +2912,11 @@ def c_event(self, name):
full_sequence = Field(tcard32, tcard32.name, 'full_sequence', False, True, True)
idx = self.fields.index(field)
self.fields.insert(idx + 1, full_sequence)
+
+ # If the event contains any 64-bit extended fields, they need
+ # to remain aligned on a 64-bit boundary. Adding full_sequence
+ # would normally break that; force the struct to be packed.
+ force_packed = any(f.type.size == 8 and f.type.is_simple for f in self.fields[(idx+1):])
break
_c_type_setup(self, name, ('event',))
@@ -2920,7 +2926,7 @@ def c_event(self, name):
if self.name == name:
# Structure definition
- _c_complex(self)
+ _c_complex(self, force_packed)
else:
# Typedef
_h('')
diff --git a/src/xcb.h b/src/xcb.h
index e62c985..73c77a3 100644
--- a/src/xcb.h
+++ b/src/xcb.h
@@ -51,6 +51,8 @@ extern "C" {
* @file xcb.h
*/
+#define XCB_PACKED __attribute__((__packed__))
+
/**
* @defgroup XCB_Core_API XCB Core API
* @brief Core API of the XCB library.
--
1.8.4.2

View File

@ -1,8 +1,8 @@
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
Name: libxcb
Version: 1.9.1
Release: 3%{?dist}
Version: 1.10
Release: 1%{?dist}
Summary: A C binding to the X11 protocol
Group: System Environment/Libraries
@ -16,12 +16,15 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# the pkgconfig file so libs that link against libxcb know this...
Source1: pthread-stubs.pc.in
# http://cgit.freedesktop.org/xcb/libxcb/patch/?id=3b72a2c9d1d656c74c691a45689e1d637f669e3a
Patch0: 0001-Force-XCB-event-structures-with-64-bit-extended-fiel.patch
BuildRequires: autoconf automake libtool pkgconfig
BuildRequires: doxygen
BuildRequires: graphviz
BuildRequires: libXau-devel
BuildRequires: libxslt
BuildRequires: xcb-proto >= 1.7-3
BuildRequires: xcb-proto >= 1.10
BuildRequires: xorg-x11-proto-devel
BuildRequires: xorg-x11-util-macros
@ -50,6 +53,7 @@ The %{name}-doc package contains documentation for the %{name} library.
%prep
%setup -q
%patch0 -p1
%build
sed -i 's/pthread-stubs //' configure.ac
@ -78,7 +82,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libxcb-damage.so.0*
%{_libdir}/libxcb-dpms.so.0*
%{_libdir}/libxcb-dri2.so.0*
%{_libdir}/libxcb-dri3.so.0*
%{_libdir}/libxcb-glx.so.0*
%{_libdir}/libxcb-present.so.0*
%{_libdir}/libxcb-randr.so.0*
%{_libdir}/libxcb-record.so.0*
%{_libdir}/libxcb-render.so.0*
@ -86,12 +92,12 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libxcb-screensaver.so.0*
%{_libdir}/libxcb-shape.so.0*
%{_libdir}/libxcb-shm.so.0*
%{_libdir}/libxcb-sync.so.0*
%{_libdir}/libxcb-sync.so.1*
%{_libdir}/libxcb-xevie.so.0*
%{_libdir}/libxcb-xf86dri.so.0*
%{_libdir}/libxcb-xfixes.so.0*
%{_libdir}/libxcb-xinerama.so.0*
%{_libdir}/libxcb-xkb.so.0*
%{_libdir}/libxcb-xkb.so.1*
%{_libdir}/libxcb-xselinux.so.0*
%{_libdir}/libxcb-xtest.so.0*
%{_libdir}/libxcb-xv.so.0*
@ -110,6 +116,9 @@ rm -rf $RPM_BUILD_ROOT
%{_pkgdocdir}
%changelog
* Mon Jan 27 2014 Adam Jackson <ajax@redhat.com> 1.10-1
- libxcb 1.10 plus one. Updated ABIs: sync, xkb. New libs: dri3, present.
* Tue Aug 6 2013 Ville Skyttä <ville.skytta@iki.fi> - 1.9.1-3
- Install docs to %%{_pkgdocdir} where available.
@ -145,116 +154,3 @@ rm -rf $RPM_BUILD_ROOT
* Wed Jan 11 2012 Adam Jackson <ajax@redhat.com> 1.8-1
- libxcb 1.8
* Thu Jun 23 2011 Adam Jackson <ajax@redhat.com> 1.7-3
- libxcb-1.7-xts-fixes.patch: Backport some XTS5 fixes from git.
* Tue Feb 08 2011 Adam Jackson <ajax@redhat.com> 1.7-2
- Fix FTBFS.
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Thu Aug 26 2010 Adam Jackson <ajax@redhat.com> 1.7-2
- Drop python bindings, nothing's using them.
* Mon Aug 16 2010 Peter Hutterer <peter.hutterer@redhat.com> 1.7-1
- libxcb 1.7
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 1.5-3
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Thu Jul 08 2010 Adam Jackson <ajax@redhat.com> 1.5-2
- Include COPYING in base package too
* Wed Jan 13 2010 Dave Airlie <airlied@redhat.com> 1.5-1
- libxcb 1.5
* Wed Dec 02 2009 Adam Jackson <ajax@redhat.com> 1.4-2
- libxcb-1.4-keepalive.patch: setsockopt(SO_KEEPALIVE) for TCP (#476415)
* Thu Aug 27 2009 Adam Jackson <ajax@redhat.com> 1.4-1
- libxcb 1.4 (#518597)
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Tue Jul 14 2009 Adam Jackson <ajax@redhat.com> 1.3-1
- libxcb 1.3
- List DSO versions explicitly.
- Don't package any xprint bits. Seriously, no.
* Mon Jul 13 2009 Adam Jackson <ajax@redhat.com> 1.2-8
- Really fix xpyb build.
* Mon Jul 06 2009 Adam Jackson <ajax@redhat.com> 1.2-7
- Fix xpyb build
* Mon Jun 29 2009 Adam Jackson <ajax@redhat.com> 1.2-6
- BuildRequires: xcb-proto >= 1.5
* Wed Jun 24 2009 Adam Jackson <ajax@redhat.com> 1.2-5
- libxcb-1.2-no-nagle.patch: Disable Nagle's algorithm on TCP. (#442158)
* Tue May 19 2009 Adam Jackson <ajax@redhat.com> 1.2-4
- Add libxcb-python subpackage
* Tue Apr 07 2009 Adam Jackson <ajax@redhat.com> 1.2-3
- libxcb-1.2-to-git-6e2e87d.patch: Various updates from git, XID generation
being the most important.
* Tue Feb 24 2009 Matthias Clasen <mclasen@redhat.com> 1.2-2
- Make -doc noarch
* Wed Feb 18 2009 Adam Jackson <ajax@redhat.com> 1.2-1
- libxcb 1.2
* Tue Feb 10 2009 Adam Jackson <ajax@redhat.com> 1.1.93-4
- Fix selinux module build. (#474249)
* Sun Feb 08 2009 Adam Jackson <ajax@redhat.com> 1.1.93-3
- Remove aforementioned egregious hack. Now I can sleep easier.
* Thu Dec 18 2008 Adam Jackson <ajax@redhat.com> 1.1.93-2
- Egregious hack to make the next libX11 build work. Hands... won't come
clean...
* Wed Dec 17 2008 Adam Jackson <ajax@redhat.com> 1.1.93-1
- libxcb 1.1.93
* Sun Oct 19 2008 Adam Jackson <ajax@redhat.com> 1.1.91-5
- Add pthread-stubs.pc
* Mon Oct 13 2008 Adam Jackson <ajax@redhat.com> 1.1.91-4
- libxcb-1.1-abstract-socket.patch: Drop.
- libxcb-1.1.91-git.patch: Update to git master.
* Wed Sep 17 2008 Adam Jackson <ajax@redhat.com> 1.1.91-3
- libxcb-1.1-xreply-leak.patch: Plug a memory leak in _XReply when the
caller has a non-fatal error handler. (mclasen, fdo #17616)
* Thu Sep 11 2008 Adam Jackson <ajax@redhat.com> 1.1.91-2
- Enable x-selinux bindings.
* Wed Sep 10 2008 Adam Jackson <ajax@redhat.com> 1.1.91-1
- libxcb 1.1.91
* Tue Apr 22 2008 Adam Jackson <ajax@redhat.com> 1.1-4
- libxcb-1.1-sloppy-lock.patch: Turn sloppy locking on all the time. I'm
tired of fighting it. (#390261)
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.1-2
- Autorebuild for GCC 4.3
* Mon Nov 12 2007 Adam Jackson <ajax@redhat.com> 1.1-1
- libxcb 1.1
* Fri Aug 24 2007 Adam Jackson <ajax@redhat.com> 1.0-3
- libxcb-1.0-abstract-socket.patch: When connecting to the X server, prefer
abstract-namespace unix sockets to filesystem-bound sockets.
* Wed Aug 22 2007 Adam Jackson <ajax@redhat.com> - 1.0-2
- Rebuild for PPC toolchain bug
* Fri Jun 29 2007 Adam Jackson <ajax@redhat.com> 1.0-1
- Initial revision.