diff options
author | Khem Raj <raj.khem@gmail.com> | 2018-09-26 18:18:35 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-09-26 18:19:14 -0700 |
commit | 148eba8c691efc68cbf9b305eb3873cbe222a214 (patch) | |
tree | aa4e99d43125390b4e244763168d7f8c99e332b2 /meta-networking/recipes-support | |
parent | d26bf9ae0c5802eccb8730339c4173ada05c13ea (diff) | |
download | meta-openembedded-148eba8c691efc68cbf9b305eb3873cbe222a214.tar.gz |
netperf: Fix build error on musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support')
-rw-r--r-- | meta-networking/recipes-support/netperf/files/0001-netlib.c-Move-including-sched.h-out-og-function.patch | 50 | ||||
-rw-r--r-- | meta-networking/recipes-support/netperf/netperf_git.bb | 10 |
2 files changed, 56 insertions, 4 deletions
diff --git a/meta-networking/recipes-support/netperf/files/0001-netlib.c-Move-including-sched.h-out-og-function.patch b/meta-networking/recipes-support/netperf/files/0001-netlib.c-Move-including-sched.h-out-og-function.patch new file mode 100644 index 000000000..515737c8e --- /dev/null +++ b/meta-networking/recipes-support/netperf/files/0001-netlib.c-Move-including-sched.h-out-og-function.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 51a092ebb36dcc6180ceb93a9777258e826d9990 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 26 Sep 2018 18:11:10 -0700 | ||
4 | Subject: [PATCH] netlib.c: Move including sched.h out og function | ||
5 | |||
6 | The shutdown_control() has this code where system headers are being | ||
7 | included inside function body and this results in compile errors on musl | ||
8 | especially when sched.h is included because sched.h defines a macro | ||
9 | which defines a static function. This means it ends up being a static | ||
10 | function inside another function and compiler calls it out | ||
11 | |||
12 | In function 'bind_to_specific_processor': | ||
13 | | | ||
14 | /mnt/a/yoe/build/tmp/work/i586-yoe-linux-musl/netperf/2.7.0+git999-r0/recipe-sysroot/usr/include/sched.h:102:1: | ||
15 | error: invalid storage class for function '__CPU_AND_S' | ||
16 | | __CPU_op_func_S(AND, &) | ||
17 | | ^~~~~~~~~~~~~~~ | ||
18 | |||
19 | Moving the definition out of function definition fixes the problem | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | |||
23 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
24 | --- | ||
25 | src/netlib.c | 5 ++++- | ||
26 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
27 | |||
28 | diff --git a/src/netlib.c b/src/netlib.c | ||
29 | index 9258424..60b032d 100644 | ||
30 | --- a/src/netlib.c | ||
31 | +++ b/src/netlib.c | ||
32 | @@ -2262,6 +2262,10 @@ shutdown_control() | ||
33 | |||
34 | } | ||
35 | |||
36 | +#if HAVE_SCHED_SETAFFINITY | ||
37 | +#include <sched.h> | ||
38 | +#endif | ||
39 | + | ||
40 | /* | ||
41 | bind_to_specific_processor will bind the calling process to the | ||
42 | processor in "processor" It has lots of ugly ifdefs to deal with | ||
43 | @@ -2308,7 +2312,6 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map) | ||
44 | value will not tell you if you are bound vs unbound. */ | ||
45 | bindprocessor(BINDPROCESS,getpid(),(cpu_t)mapped_affinity); | ||
46 | #elif HAVE_SCHED_SETAFFINITY | ||
47 | -#include <sched.h> | ||
48 | /* in theory this should cover systems with more CPUs than bits in a | ||
49 | long, without having to specify __USE_GNU. we "cheat" by taking | ||
50 | defines from /usr/include/bits/sched.h, which we ass-u-me is | ||
diff --git a/meta-networking/recipes-support/netperf/netperf_git.bb b/meta-networking/recipes-support/netperf/netperf_git.bb index f0e0f9cf1..8921ea746 100644 --- a/meta-networking/recipes-support/netperf/netperf_git.bb +++ b/meta-networking/recipes-support/netperf/netperf_git.bb | |||
@@ -8,10 +8,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a0ab17253e7a3f318da85382c7d5d5d6" | |||
8 | 8 | ||
9 | PV = "2.7.0+git${SRCPV}" | 9 | PV = "2.7.0+git${SRCPV}" |
10 | 10 | ||
11 | SRC_URI="git://github.com/HewlettPackard/netperf.git \ | 11 | SRC_URI = "git://github.com/HewlettPackard/netperf.git \ |
12 | file://cpu_set.patch \ | 12 | file://cpu_set.patch \ |
13 | file://vfork.patch \ | 13 | file://vfork.patch \ |
14 | file://init" | 14 | file://init \ |
15 | file://0001-netlib.c-Move-including-sched.h-out-og-function.patch \ | ||
16 | " | ||
15 | 17 | ||
16 | SRCREV = "f482bab49fcedee46fc5b755da127f608325cd13" | 18 | SRCREV = "f482bab49fcedee46fc5b755da127f608325cd13" |
17 | 19 | ||