* [PATCH] libsdl: add fix for new _XGetRequest symbol backported to libx11
@ 2012-02-15 17:40 Martin Jansa
2012-02-15 18:12 ` Otavio Salvador
0 siblings, 1 reply; 4+ messages in thread
From: Martin Jansa @ 2012-02-15 17:40 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
.../libsdl-1.2.14/add.XGetRequest.symbol.patch | 70 ++++++++++++++++++++
meta/recipes-graphics/libsdl/libsdl_1.2.14.bb | 3 +-
2 files changed, 72 insertions(+), 1 deletions(-)
create mode 100644 meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
diff --git a/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch b/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
new file mode 100644
index 0000000..a22ad65
--- /dev/null
+++ b/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
@@ -0,0 +1,70 @@
+_XGetRequest API was backported to libx11-1.4.4 in:
+http://git.openembedded.org/openembedded-core/commit/?id=e08604800fe1cb8f240f53c147ceb4ee08a29b91
+
+This breaks e.g. libsdl-image build with:
+| /OE/shr-core/tmp-eglibc/sysroots/qemux86-64/usr/lib/libSDL.so: undefined reference to `_XGetRequest'
+
+For details see: https://bugzilla.redhat.com/show_bug.cgi?id=782251
+
+Upstrea-Status: Accepted
+
+@@ -, +, @@
+ added.
+ src/video/x11/SDL_x11dyn.c | 24 ++++++++++++++++++++++++
+ src/video/x11/SDL_x11sym.h | 6 ++++++
+ 2 files changed, 30 insertions(+), 0 deletions(-)
+--- a/src/video/x11/SDL_x11dyn.c
++++ a/src/video/x11/SDL_x11dyn.c
+@@ -109,6 +109,21 @@ char *(*pXGetICValues)(XIC, ...) = NULL;
+ #undef SDL_X11_SYM
+
+
++static void *SDL_XGetRequest_workaround(Display* dpy, CARD8 type, size_t len)
++{
++ xReq *req;
++ WORD64ALIGN
++ if (dpy->bufptr + len > dpy->bufmax)
++ _XFlush(dpy);
++ dpy->last_req = dpy->bufptr;
++ req = (xReq*)dpy->bufptr;
++ req->reqType = type;
++ req->length = len / 4;
++ dpy->bufptr += len;
++ dpy->request++;
++ return req;
++}
++
+ static int x11_load_refcount = 0;
+
+ void SDL_X11_UnloadSymbols(void)
+@@ -168,6 +183,15 @@ int SDL_X11_LoadSymbols(void)
+ X11_GetSym("XGetICValues",&SDL_X11_HAVE_UTF8,(void **)&pXGetICValues);
+ #endif
+
++ /*
++ * In case we're built with newer Xlib headers, we need to make sure
++ * that _XGetRequest() is available, even on older systems.
++ * Otherwise, various Xlib macros we use will call a NULL pointer.
++ */
++ if (!SDL_X11_HAVE_XGETREQUEST) {
++ p_XGetRequest = SDL_XGetRequest_workaround;
++ }
++
+ if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */
+ SDL_ClearError();
+ } else {
+--- a/src/video/x11/SDL_x11sym.h
++++ a/src/video/x11/SDL_x11sym.h
+@@ -170,6 +170,12 @@ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,
+ #endif
+
+ /*
++ * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes.
++ */
++SDL_X11_MODULE(XGETREQUEST)
++SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return)
++
++/*
+ * These only show up on some variants of Unix.
+ */
+ #if defined(__osf__)
diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
index f587291..5b87f39 100644
--- a/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
+++ b/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
@@ -15,10 +15,11 @@ PROVIDES = "virtual/libsdl"
DEPENDS = "${@base_contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} virtual/libx11 libxext libxrandr libxrender tslib"
DEPENDS_virtclass-nativesdk = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk"
-PR = "r4"
+PR = "r5"
SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
file://configure_tweak.patch \
+ file://add.XGetRequest.symbol.patch \
"
S = "${WORKDIR}/SDL-${PV}"
--
1.7.8.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libsdl: add fix for new _XGetRequest symbol backported to libx11
2012-02-15 17:40 [PATCH] libsdl: add fix for new _XGetRequest symbol backported to libx11 Martin Jansa
@ 2012-02-15 18:12 ` Otavio Salvador
2012-02-15 18:45 ` [PATCHv2] " Martin Jansa
0 siblings, 1 reply; 4+ messages in thread
From: Otavio Salvador @ 2012-02-15 18:12 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 319 bytes --]
On Wed, Feb 15, 2012 at 15:40, Martin Jansa <martin.jansa@gmail.com> wrote:
> +Upstrea-Status: Accepted
>
Typo!
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
[-- Attachment #2: Type: text/html, Size: 767 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCHv2] libsdl: add fix for new _XGetRequest symbol backported to libx11
2012-02-15 18:12 ` Otavio Salvador
@ 2012-02-15 18:45 ` Martin Jansa
2012-02-21 18:49 ` Saul Wold
0 siblings, 1 reply; 4+ messages in thread
From: Martin Jansa @ 2012-02-15 18:45 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
.../libsdl-1.2.14/add.XGetRequest.symbol.patch | 70 ++++++++++++++++++++
meta/recipes-graphics/libsdl/libsdl_1.2.14.bb | 3 +-
2 files changed, 72 insertions(+), 1 deletions(-)
create mode 100644 meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
diff --git a/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch b/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
new file mode 100644
index 0000000..7bab177
--- /dev/null
+++ b/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
@@ -0,0 +1,70 @@
+_XGetRequest API was backported to libx11-1.4.4 in:
+http://git.openembedded.org/openembedded-core/commit/?id=e08604800fe1cb8f240f53c147ceb4ee08a29b91
+
+This breaks e.g. libsdl-image build with:
+| /OE/shr-core/tmp-eglibc/sysroots/qemux86-64/usr/lib/libSDL.so: undefined reference to `_XGetRequest'
+
+For details see: https://bugzilla.redhat.com/show_bug.cgi?id=782251
+
+Upstream-Status: Accepted
+
+@@ -, +, @@
+ added.
+ src/video/x11/SDL_x11dyn.c | 24 ++++++++++++++++++++++++
+ src/video/x11/SDL_x11sym.h | 6 ++++++
+ 2 files changed, 30 insertions(+), 0 deletions(-)
+--- a/src/video/x11/SDL_x11dyn.c
++++ a/src/video/x11/SDL_x11dyn.c
+@@ -109,6 +109,21 @@ char *(*pXGetICValues)(XIC, ...) = NULL;
+ #undef SDL_X11_SYM
+
+
++static void *SDL_XGetRequest_workaround(Display* dpy, CARD8 type, size_t len)
++{
++ xReq *req;
++ WORD64ALIGN
++ if (dpy->bufptr + len > dpy->bufmax)
++ _XFlush(dpy);
++ dpy->last_req = dpy->bufptr;
++ req = (xReq*)dpy->bufptr;
++ req->reqType = type;
++ req->length = len / 4;
++ dpy->bufptr += len;
++ dpy->request++;
++ return req;
++}
++
+ static int x11_load_refcount = 0;
+
+ void SDL_X11_UnloadSymbols(void)
+@@ -168,6 +183,15 @@ int SDL_X11_LoadSymbols(void)
+ X11_GetSym("XGetICValues",&SDL_X11_HAVE_UTF8,(void **)&pXGetICValues);
+ #endif
+
++ /*
++ * In case we're built with newer Xlib headers, we need to make sure
++ * that _XGetRequest() is available, even on older systems.
++ * Otherwise, various Xlib macros we use will call a NULL pointer.
++ */
++ if (!SDL_X11_HAVE_XGETREQUEST) {
++ p_XGetRequest = SDL_XGetRequest_workaround;
++ }
++
+ if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */
+ SDL_ClearError();
+ } else {
+--- a/src/video/x11/SDL_x11sym.h
++++ a/src/video/x11/SDL_x11sym.h
+@@ -170,6 +170,12 @@ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,
+ #endif
+
+ /*
++ * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes.
++ */
++SDL_X11_MODULE(XGETREQUEST)
++SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return)
++
++/*
+ * These only show up on some variants of Unix.
+ */
+ #if defined(__osf__)
diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
index f587291..5b87f39 100644
--- a/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
+++ b/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
@@ -15,10 +15,11 @@ PROVIDES = "virtual/libsdl"
DEPENDS = "${@base_contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} virtual/libx11 libxext libxrandr libxrender tslib"
DEPENDS_virtclass-nativesdk = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk"
-PR = "r4"
+PR = "r5"
SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
file://configure_tweak.patch \
+ file://add.XGetRequest.symbol.patch \
"
S = "${WORKDIR}/SDL-${PV}"
--
1.7.8.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2] libsdl: add fix for new _XGetRequest symbol backported to libx11
2012-02-15 18:45 ` [PATCHv2] " Martin Jansa
@ 2012-02-21 18:49 ` Saul Wold
0 siblings, 0 replies; 4+ messages in thread
From: Saul Wold @ 2012-02-21 18:49 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer; +Cc: Martin Jansa
On 02/15/2012 10:45 AM, Martin Jansa wrote:
> Signed-off-by: Martin Jansa<Martin.Jansa@gmail.com>
> ---
> .../libsdl-1.2.14/add.XGetRequest.symbol.patch | 70 ++++++++++++++++++++
> meta/recipes-graphics/libsdl/libsdl_1.2.14.bb | 3 +-
> 2 files changed, 72 insertions(+), 1 deletions(-)
> create mode 100644 meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
>
> diff --git a/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch b/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
> new file mode 100644
> index 0000000..7bab177
> --- /dev/null
> +++ b/meta/recipes-graphics/libsdl/libsdl-1.2.14/add.XGetRequest.symbol.patch
> @@ -0,0 +1,70 @@
> +_XGetRequest API was backported to libx11-1.4.4 in:
> +http://git.openembedded.org/openembedded-core/commit/?id=e08604800fe1cb8f240f53c147ceb4ee08a29b91
> +
> +This breaks e.g. libsdl-image build with:
> +| /OE/shr-core/tmp-eglibc/sysroots/qemux86-64/usr/lib/libSDL.so: undefined reference to `_XGetRequest'
> +
> +For details see: https://bugzilla.redhat.com/show_bug.cgi?id=782251
> +
> +Upstream-Status: Accepted
> +
> +@@ -, +, @@
> + added.
> + src/video/x11/SDL_x11dyn.c | 24 ++++++++++++++++++++++++
> + src/video/x11/SDL_x11sym.h | 6 ++++++
> + 2 files changed, 30 insertions(+), 0 deletions(-)
> +--- a/src/video/x11/SDL_x11dyn.c
> ++++ a/src/video/x11/SDL_x11dyn.c
> +@@ -109,6 +109,21 @@ char *(*pXGetICValues)(XIC, ...) = NULL;
> + #undef SDL_X11_SYM
> +
> +
> ++static void *SDL_XGetRequest_workaround(Display* dpy, CARD8 type, size_t len)
> ++{
> ++ xReq *req;
> ++ WORD64ALIGN
> ++ if (dpy->bufptr + len> dpy->bufmax)
> ++ _XFlush(dpy);
> ++ dpy->last_req = dpy->bufptr;
> ++ req = (xReq*)dpy->bufptr;
> ++ req->reqType = type;
> ++ req->length = len / 4;
> ++ dpy->bufptr += len;
> ++ dpy->request++;
> ++ return req;
> ++}
> ++
> + static int x11_load_refcount = 0;
> +
> + void SDL_X11_UnloadSymbols(void)
> +@@ -168,6 +183,15 @@ int SDL_X11_LoadSymbols(void)
> + X11_GetSym("XGetICValues",&SDL_X11_HAVE_UTF8,(void **)&pXGetICValues);
> + #endif
> +
> ++ /*
> ++ * In case we're built with newer Xlib headers, we need to make sure
> ++ * that _XGetRequest() is available, even on older systems.
> ++ * Otherwise, various Xlib macros we use will call a NULL pointer.
> ++ */
> ++ if (!SDL_X11_HAVE_XGETREQUEST) {
> ++ p_XGetRequest = SDL_XGetRequest_workaround;
> ++ }
> ++
> + if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */
> + SDL_ClearError();
> + } else {
> +--- a/src/video/x11/SDL_x11sym.h
> ++++ a/src/video/x11/SDL_x11sym.h
> +@@ -170,6 +170,12 @@ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,
> + #endif
> +
> + /*
> ++ * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes.
> ++ */
> ++SDL_X11_MODULE(XGETREQUEST)
> ++SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return)
> ++
> ++/*
> + * These only show up on some variants of Unix.
> + */
> + #if defined(__osf__)
> diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
> index f587291..5b87f39 100644
> --- a/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
> +++ b/meta/recipes-graphics/libsdl/libsdl_1.2.14.bb
> @@ -15,10 +15,11 @@ PROVIDES = "virtual/libsdl"
> DEPENDS = "${@base_contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)} virtual/libx11 libxext libxrandr libxrender tslib"
> DEPENDS_virtclass-nativesdk = "libx11-nativesdk libxrandr-nativesdk libxrender-nativesdk libxext-nativesdk"
>
> -PR = "r4"
> +PR = "r5"
>
> SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
> file://configure_tweak.patch \
> + file://add.XGetRequest.symbol.patch \
> "
>
> S = "${WORKDIR}/SDL-${PV}"
Merged into OE-core
Thanks
Sau!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-21 18:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-15 17:40 [PATCH] libsdl: add fix for new _XGetRequest symbol backported to libx11 Martin Jansa
2012-02-15 18:12 ` Otavio Salvador
2012-02-15 18:45 ` [PATCHv2] " Martin Jansa
2012-02-21 18:49 ` Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox