Skip to contentSkip to conversation

directfb: fix compile for m68k

PATCH New Waldemar Brodkorb 2 participants 2 messages Jul 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 directfb: fix compile for m68k

Fixes following autobuild failure:
http://autobuild.buildroot.net/results/162db0d62075a16c7abae1229676e2cdb29fe953/

---
- Idea from
http://lists.busybox.net/pipermail/buildroot/2015-February/120281.html
- Will only work for uClibc-ng >= 1.0.15 -> rebuild of external toolchain required, because of Linuxthreads renaming

---
 ...sable-pthread_getattr_np-for-Linuxthreads.patch | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 package/directfb/0006-disable-pthread_getattr_np-for-Linuxthreads.patch
package/directfb/0006-disable-pthread_getattr_np-for-Linuxthreads.patch new file +23 -0
new file mode 100644
index 0000000..88d56f7
@@ -0,0 +1,23 @@
+Fix compile for uClibc-ng and Linuxthreads
+
+Signed-off-by: Waldemar Brodkorb <[email protected]>
+
+diff -Nur DirectFB-1.7.7.orig/lib/direct/os/linux/glibc/thread.c DirectFB-1.7.7/lib/direct/os/linux/glibc/thread.c
+--- DirectFB-1.7.7.orig/lib/direct/os/linux/glibc/thread.c	2014-07-15 08:54:58.000000000 +0200
++++ DirectFB-1.7.7/lib/direct/os/linux/glibc/thread.c	2016-07-07 18:26:18.085793056 +0200
+@@ -152,12 +152,15 @@
+ 
+      pthread_attr_destroy( &attr );
+ 
++/* uClibc-ng does not implement pthread_getattr_np for Linuxthreads */
++#if !defined(__UCLIBC_HAS_LINUXTHREADS__)
+      /* Read (back) value. */
+      pthread_getattr_np( thread->handle.thread, &attr );
+      pthread_attr_getstacksize( &attr, &thread->stack_size );
+      pthread_attr_getschedparam( &attr, &param );
+      thread->priority = param.sched_priority;
+      pthread_attr_destroy( &attr );
++#endif
+ 
+      return DR_OK;
+ }
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 directfb: fix compile for m68k

Hello,

package/directfb/0006-disable-pthread_getattr_np-for-Linuxthreads.patch line 20

Quoted 9 lines · Waldemar Brodkorb

++/* uClibc-ng does not implement pthread_getattr_np for Linuxthreads */ ++#if !defined(__UCLIBC_HAS_LINUXTHREADS__)

package/directfb/0006-disable-pthread_getattr_np-for-Linuxthreads.patch new file +7 -0
+      /* Read (back) value. */
+      pthread_getattr_np( thread->handle.thread, &attr );
+      pthread_attr_getstacksize( &attr, &thread->stack_size );
+      pthread_attr_getschedparam( &attr, &param );
+      thread->priority = param.sched_priority;
+      pthread_attr_destroy( &attr );
++#endif

Are you sure it is correct to remove this code? It means that the thread->priority and thread->stack_size field will not be initialized to what they are supposed to.

Also, please add a configure.ac check for pthread_getattr_np() rather than relying on __UCLIBC_HAS_LINUXTHREADS__.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com