summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorHongzhi.Song <hongzhi.song@windriver.com>2019-09-22 20:30:20 -0700
committerKhem Raj <raj.khem@gmail.com>2019-09-23 08:33:10 -0700
commit665235b74a871df54d044902b494f1caeb421ca7 (patch)
tree4f5609edcc1aed191e68017e8aaafa8856b52796 /meta-oe
parent2dde8de633bc82a3416809e09951a94089542bb9 (diff)
downloadmeta-openembedded-665235b74a871df54d044902b494f1caeb421ca7.tar.gz
numactl: fix a error about lib32-numactl
lib32-numactl has a error: root@intel-x86-64:~# numademo -t -e 1M Configured Nodes does not match available memory nodes That's because (long long int) is assigned to (long int). This will cause (long int) overflow on 32bit system. Unify variable types and fix it. Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-support/numactl/numactl/0001-numademo-fix-error-on-32bit-system.patch100
-rw-r--r--meta-oe/recipes-support/numactl/numactl_git.bb1
2 files changed, 101 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/numactl/numactl/0001-numademo-fix-error-on-32bit-system.patch b/meta-oe/recipes-support/numactl/numactl/0001-numademo-fix-error-on-32bit-system.patch
new file mode 100644
index 000000000..506101711
--- /dev/null
+++ b/meta-oe/recipes-support/numactl/numactl/0001-numademo-fix-error-on-32bit-system.patch
@@ -0,0 +1,100 @@
1From 68485f8516884377e54c623b0deff73f97321d96 Mon Sep 17 00:00:00 2001
2From: "Hongzhi.Song" <hongzhi.song@windriver.com>
3Date: Thu, 19 Sep 2019 04:32:31 -0400
4Subject: [PATCH] numademo: fix error on 32bit system
5
6Error Info on 32bit:
7root@intel-x86:~# numademo -t -e 1M
8Configured Nodes does not match available memory nodes
9
10That's because sizeof(long)=4Word, but sizeof(long long)=8Word
11on 32bit. So (long long) assigning to (long) maybe cause overflow.
12
13long numa_node_size(int node, long *freep)
14{
15 ...
16 long sz = numa_node_size64_int(node, &f2);
17 ~^^~
18 return sz;
19 ...
20}
21long long numa_node_size64(int node, long long *freep)
22~^^ ^^~
23{
24 ...
25}
26
27Unify the return type of above functions.
28
29Upstream-Status: Accepted [next version is after 2.0.13 or 2.0.14]
30[https://github.com/numactl/numactl/commit/a7c4bc790a191d3e42b63850b409c1a72b75a4e1]
31 Submitted [https://github.com/numactl/numactl/pull/79]
32[The first patch was merged but has a error, then the second fix it.]
33
34Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
35---
36 libnuma.c | 4 ++--
37 numa.h | 2 +-
38 numademo.c | 2 +-
39 test/move_pages.c | 2 +-
40 4 files changed, 5 insertions(+), 5 deletions(-)
41
42diff --git a/libnuma.c b/libnuma.c
43index cac8851..8b5c6aa 100644
44--- a/libnuma.c
45+++ b/libnuma.c
46@@ -791,10 +791,10 @@ long long numa_node_size64(int node, long long *freep)
47
48 make_internal_alias(numa_node_size64);
49
50-long numa_node_size(int node, long *freep)
51+long long numa_node_size(int node, long long *freep)
52 {
53 long long f2;
54- long sz = numa_node_size64_int(node, &f2);
55+ long long sz = numa_node_size64_int(node, &f2);
56 if (freep)
57 *freep = f2;
58 return sz;
59diff --git a/numa.h b/numa.h
60index 3a8c543..268fb1d 100644
61--- a/numa.h
62+++ b/numa.h
63@@ -143,7 +143,7 @@ int numa_preferred(void);
64
65 /* Return node size and free memory */
66 long long numa_node_size64(int node, long long *freep);
67-long numa_node_size(int node, long *freep);
68+long long numa_node_size(int node, long long *freep);
69
70 int numa_pagesize(void);
71
72diff --git a/numademo.c b/numademo.c
73index a720db0..8c56da8 100644
74--- a/numademo.c
75+++ b/numademo.c
76@@ -301,7 +301,7 @@ int max_node, numnodes;
77 int get_node_list(void)
78 {
79 int a, got_nodes = 0;
80- long free_node_sizes;
81+ long long free_node_sizes;
82
83 numnodes = numa_num_configured_nodes();
84 node_to_use = (int *)malloc(numnodes * sizeof(int));
85diff --git a/test/move_pages.c b/test/move_pages.c
86index d1d8436..f8ff25d 100644
87--- a/test/move_pages.c
88+++ b/test/move_pages.c
89@@ -26,7 +26,7 @@ int *node_to_use;
90 int get_node_list()
91 {
92 int a, got_nodes = 0, max_node, numnodes;
93- long free_node_sizes;
94+ long long free_node_sizes;
95
96 numnodes = numa_num_configured_nodes();
97 node_to_use = (int *)malloc(numnodes * sizeof(int));
98--
992.23.0
100
diff --git a/meta-oe/recipes-support/numactl/numactl_git.bb b/meta-oe/recipes-support/numactl/numactl_git.bb
index f13b1795f..20b7fed86 100644
--- a/meta-oe/recipes-support/numactl/numactl_git.bb
+++ b/meta-oe/recipes-support/numactl/numactl_git.bb
@@ -18,6 +18,7 @@ SRC_URI = "git://github.com/numactl/numactl \
18 file://Makefile \ 18 file://Makefile \
19 file://run-ptest \ 19 file://run-ptest \
20 file://0001-define-run-test-target.patch \ 20 file://0001-define-run-test-target.patch \
21 file://0001-numademo-fix-error-on-32bit-system.patch \
21" 22"
22 23
23S = "${WORKDIR}/git" 24S = "${WORKDIR}/git"