summaryrefslogtreecommitdiff
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-05-06 15:17:25 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-10 09:51:40 +0100
commit03f442250579a392b49b54648840fbeb7c0a0142 (patch)
tree37887c11bd67a13caee99b1430097b40271a95ac /meta/recipes-kernel
parentfdbcf8eea9d83a8040157d8a5bb6febae5eb9a14 (diff)
downloadopenembedded-core-03f442250579a392b49b54648840fbeb7c0a0142.tar.gz
openembedded-core-03f442250579a392b49b54648840fbeb7c0a0142.tar.bz2
openembedded-core-03f442250579a392b49b54648840fbeb7c0a0142.tar.xz
openembedded-core-03f442250579a392b49b54648840fbeb7c0a0142.zip
lttng-ust_0.12.bb: Fix compilation on uclibc
We provide alternative implementation of sched_getcpu() when compiling for uclibc Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust/uclibc-sched_getcpu.patch50
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust_0.12.bb4
2 files changed, 53 insertions, 1 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-ust/uclibc-sched_getcpu.patch b/meta/recipes-kernel/lttng/lttng-ust/uclibc-sched_getcpu.patch
new file mode 100644
index 000000000..7102a6918
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/uclibc-sched_getcpu.patch
@@ -0,0 +1,50 @@
+uClibc does not have sched_getcpu() implemented. So we create a wrapper
+to getcpu syscall when compiling for uclibc.
+
+So far execinfo.h does not exist on uclibc but it turns out to be that
+this header is not needed even in eglibc case so it can be removed
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-status: Pending
+
+Index: ust-0.12/libust/tracer.h
+===================================================================
+--- ust-0.12.orig/libust/tracer.h
++++ ust-0.12/libust/tracer.h
+@@ -342,14 +342,22 @@ static __inline__ void ltt_write_trace_h
+ header->start_freq = trace->start_freq;
+ header->freq_scale = trace->freq_scale;
+ }
+-
++#ifdef __UCLIBC__
++#define sched_getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache)
++#endif
+ #ifndef UST_VALGRIND
+
+ static __inline__ int ust_get_cpu(void)
+ {
+ int cpu;
+
++#ifdef __UCLIBC__
++ int c, s;
++ s = syscall(__NR_getcpu, &c, NULL, NULL);
++ cpu = (s == -1) ? s : c;
++#else
+ cpu = sched_getcpu();
++#endif
+ if (likely(cpu >= 0))
+ return cpu;
+ /*
+Index: ust-0.12/libustcomm/ustcomm.c
+===================================================================
+--- ust-0.12.orig/libustcomm/ustcomm.c
++++ ust-0.12/libustcomm/ustcomm.c
+@@ -31,7 +31,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <execinfo.h>
+
+ #include "ustcomm.h"
+ #include "usterr.h"
diff --git a/meta/recipes-kernel/lttng/lttng-ust_0.12.bb b/meta/recipes-kernel/lttng/lttng-ust_0.12.bb
index 7dadc0474..5fca949f3 100644
--- a/meta/recipes-kernel/lttng/lttng-ust_0.12.bb
+++ b/meta/recipes-kernel/lttng/lttng-ust_0.12.bb
@@ -12,7 +12,9 @@ DEPENDS = "liburcu"
PR = "r0"
-SRC_URI = "http://lttng.org/files/ust/releases/ust-${PV}.tar.gz"
+SRC_URI = "http://lttng.org/files/ust/releases/ust-${PV}.tar.gz \
+ file://uclibc-sched_getcpu.patch \
+ "
SRC_URI[md5sum] = "fae6e324a56016658c5b83ec14ba0043"
SRC_URI[sha256sum] = "215b05f47d0c9e3a2934926a7d14fa9c67025db917c3a1f641df40b08314ab0c"