summaryrefslogtreecommitdiffstats
path: root/package/lttng-libust/lttng-libust-uclibc-sched_getcpu.patch
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2012-04-26 11:04:56 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2012-04-26 11:04:56 +0200
commit04bd5067a2689e86a1928afac0aa3703114cd782 (patch)
treec0edc4d0f069d94fd8701538bf4a01259cd6e4c3 /package/lttng-libust/lttng-libust-uclibc-sched_getcpu.patch
parenteb19e8286115e33a2d2974d1fc55ad2eec4ae109 (diff)
downloadbuildroot-novena-04bd5067a2689e86a1928afac0aa3703114cd782.tar.gz
buildroot-novena-04bd5067a2689e86a1928afac0aa3703114cd782.zip
lttng-libust: fix build with modern uClibc versions
uClibc got sched_getcpu in 0.9.33, so the compat workaround should only be used for older uClibc versions. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/lttng-libust/lttng-libust-uclibc-sched_getcpu.patch')
-rw-r--r--package/lttng-libust/lttng-libust-uclibc-sched_getcpu.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/package/lttng-libust/lttng-libust-uclibc-sched_getcpu.patch b/package/lttng-libust/lttng-libust-uclibc-sched_getcpu.patch
new file mode 100644
index 000000000..65361858f
--- /dev/null
+++ b/package/lttng-libust/lttng-libust-uclibc-sched_getcpu.patch
@@ -0,0 +1,32 @@
+[PATCH] fix build with modern uClibc
+
+uClibc has sched_getcpu since 0.9.33, so the compat workaround should only
+be used for older uClibc versions.
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ liblttng-ust/compat.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+Index: lttng-ust-1.9.2/liblttng-ust/compat.h
+===================================================================
+--- lttng-ust-1.9.2.orig/liblttng-ust/compat.h
++++ lttng-ust-1.9.2/liblttng-ust/compat.h
+@@ -17,6 +17,10 @@
+ #include <sys/syscall.h>
+
+ #ifdef __UCLIBC__
++/* old uClibc versions didn't have sched_getcpu */
++#if __UCLIBC_MAJOR__ == 0 && \
++ (__UCLIBC_MINOR__ < 9 || \
++ (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ <= 32))
+ #define __getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache)
+ static inline
+ int sched_getcpu(void)
+@@ -26,5 +30,6 @@
+ s = __getcpu(&c, NULL, NULL);
+ return (s == -1) ? s : c;
+ }
++#endif /* <= 0.9.32 */
+ #endif /* __UCLIBC__ */
+ #endif /* _UST_COMPAT_H */