ljlinenoise: add hash file
[buildroot-gz.git] / package / rt-tests / 02-uclibc.patch
blob180bdf7c6e1e5a4b394ceb7613928a61245dbd8c
1 From 713224456f4a3242496af803413f670433f27c74 Mon Sep 17 00:00:00 2001
2 From: Alexey Brodkin <abrodkin@synopsys.com>
3 Date: Mon, 10 Nov 2014 11:55:27 +0300
4 Subject: [PATCH] [PATCH] fix build with uClibc
6 Fix two build issues with (modern) uClibc:
7 - uClibc has clock_nanosleep() if built with UCLIBC_HAS_ADVANCED_REALTIME,
8 conflicting with emulation function
9 - uClibc doesn't provide utmpx.h if not built with UCLIBC_HAS_UTMPX, which
10 is included in several files (but not needed).
12 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
13 ---
14 src/backfire/sendme.c | 1 -
15 src/cyclictest/cyclictest.c | 3 ++-
16 src/pmqtest/pmqtest.c | 1 -
17 src/ptsematest/ptsematest.c | 1 -
18 src/sigwaittest/sigwaittest.c | 2 --
19 src/svsematest/svsematest.c | 1 -
20 6 files changed, 2 insertions(+), 7 deletions(-)
22 diff --git a/src/backfire/sendme.c b/src/backfire/sendme.c
23 index 8c169dd..b959951 100644
24 --- a/src/backfire/sendme.c
25 +++ b/src/backfire/sendme.c
26 @@ -32,7 +32,6 @@
27 #include "rt-utils.h"
28 #include "rt-get_cpu.h"
30 -#include <utmpx.h>
31 #include <sys/types.h>
32 #include <sys/stat.h>
33 #include <sys/time.h>
34 diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
35 index 4547831..343e421 100644
36 --- a/src/cyclictest/cyclictest.c
37 +++ b/src/cyclictest/cyclictest.c
38 @@ -25,6 +25,7 @@
39 #include <string.h>
40 #include <time.h>
41 #include <errno.h>
42 +#include <features.h>
43 #include <limits.h>
44 #include <linux/unistd.h>
46 @@ -56,7 +57,7 @@
47 #define gettid() syscall(__NR_gettid)
48 #define sigev_notify_thread_id _sigev_un._tid
50 -#ifdef __UCLIBC__
51 +#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_ADVANCED_REALTIME__)
52 #define MAKE_PROCESS_CPUCLOCK(pid, clock) \
53 ((~(clockid_t) (pid) << 3) | (clockid_t) (clock))
54 #define CPUCLOCK_SCHED 2
55 diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c
56 index 336a8eb..2e34afe 100644
57 --- a/src/pmqtest/pmqtest.c
58 +++ b/src/pmqtest/pmqtest.c
59 @@ -33,7 +33,6 @@
60 #include <sys/time.h>
61 #include <sys/mman.h>
62 #include <linux/unistd.h>
63 -#include <utmpx.h>
64 #include <mqueue.h>
65 #include "rt-utils.h"
66 #include "rt-get_cpu.h"
67 diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c
68 index 7558a41..5358a65 100644
69 --- a/src/ptsematest/ptsematest.c
70 +++ b/src/ptsematest/ptsematest.c
71 @@ -33,7 +33,6 @@
72 #include <sys/time.h>
73 #include <sys/mman.h>
74 #include <linux/unistd.h>
75 -#include <utmpx.h>
76 #include "rt-utils.h"
77 #include "rt-get_cpu.h"
78 #include "error.h"
79 diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c
80 index 428f5ce..85c32a2 100644
81 --- a/src/sigwaittest/sigwaittest.c
82 +++ b/src/sigwaittest/sigwaittest.c
83 @@ -31,11 +31,9 @@
84 #include <signal.h>
85 #include <string.h>
86 #include <time.h>
87 -#include <utmpx.h>
88 #include <sys/types.h>
89 #include <sys/time.h>
90 #include <linux/unistd.h>
91 -#include <utmpx.h>
92 #include "rt-utils.h"
93 #include "rt-get_cpu.h"
95 diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c
96 index c1128cc..5d02550 100644
97 --- a/src/svsematest/svsematest.c
98 +++ b/src/svsematest/svsematest.c
99 @@ -31,7 +31,6 @@
100 #include <sched.h>
101 #include <string.h>
102 #include <time.h>
103 -#include <utmpx.h>
105 #include <linux/unistd.h>
108 1.9.3