Skip to contentSkip to conversation

libltpnuma: Fix compilation with libnuma v1

PATCH New Cyril Hrubis 3 participants 3 messages Mar 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libltpnuma: Fix compilation with libnuma v1

With libnuma v1 HAVE_NUMA_H is defined but $(NUMA_LIBS) is not, which leads to compilation failures on very very old distributions.

CC Petr Vorel <[email protected]>
CC Jan Stancek <[email protected]>
---
 libs/libltpnuma/tst_numa.c                                | 4 ++--
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 6 +++---
 5 files changed, 14 insertions(+), 14 deletions(-)
libs/libltpnuma/tst_numa.c +2 -2
index 6bd23e949..0ba6daf39 100644
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
@@ -43,7 +43,7 @@ void tst_nodemap_free(struct tst_nodemap *nodes)
 	free(nodes);
 }
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 const char *tst_numa_mode_name(int mode)
 {
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +3 -3
index d3c17bb9b..96a275411 100644
@@ -13,14 +13,14 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
 #include "tst_test.h"
 #include "tst_numa.h"
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -117,4 +117,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c +3 -3
index e257c1c2c..4cdec1785 100644
@@ -14,14 +14,14 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
 #include "tst_test.h"
 #include "tst_numa.h"
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -116,4 +116,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +3 -3
index eb3e046f2..24775de10 100644
@@ -11,7 +11,7 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numaif.h>
 # include <numa.h>
 #endif
@@ -21,7 +21,7 @@
 #define MNTPOINT "mntpoint"
 #define PAGES_ALLOCATED 16u
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -110,4 +110,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +3 -3
index 60601e7c1..8d8aa988d 100644
@@ -22,7 +22,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
@@ -32,7 +32,7 @@
 #define MNTPOINT "mntpoint"
 #define FILES 10
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -139,4 +139,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
Signature · 1 line
2.19.2
#1 lore raw

PATCH 1/1 libltpnuma: Fix compilation with libnuma v1

Hi Cyril,

Quoted 6 lines

With libnuma v1 HAVE_NUMA_H is defined but $(NUMA_LIBS) is not, which leads to compilation failures on very very old distributions.

CC Petr Vorel <[email protected]>
CC Jan Stancek <[email protected]>

FYI c9e5e75e1 ("numa: Drop NUMA API v1 support") There are other places, (testcases/kernel/mem/{lib,oom,vma}/), but these might be ok (not using our libnuma).

Kind regards,
Petr

Quoted 140 lines
---
 libs/libltpnuma/tst_numa.c                                | 4 ++--
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 6 +++---
 5 files changed, 14 insertions(+), 14 deletions(-)
libs/libltpnuma/tst_numa.c +2 -2
index 6bd23e949..0ba6daf39 100644
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
@@ -43,7 +43,7 @@ void tst_nodemap_free(struct tst_nodemap *nodes)
 	free(nodes);
 }
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 const char *tst_numa_mode_name(int mode)
 {
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +3 -3
index d3c17bb9b..96a275411 100644
@@ -13,14 +13,14 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
 #include "tst_test.h"
 #include "tst_numa.h"
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -117,4 +117,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c +3 -3
index e257c1c2c..4cdec1785 100644
@@ -14,14 +14,14 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
 #include "tst_test.h"
 #include "tst_numa.h"
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -116,4 +116,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +3 -3
index eb3e046f2..24775de10 100644
@@ -11,7 +11,7 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numaif.h>
 # include <numa.h>
 #endif
@@ -21,7 +21,7 @@
 #define MNTPOINT "mntpoint"
 #define PAGES_ALLOCATED 16u
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -110,4 +110,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +3 -3
index 60601e7c1..8d8aa988d 100644
@@ -22,7 +22,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
@@ -32,7 +32,7 @@
 #define MNTPOINT "mntpoint"
 #define FILES 10
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -139,4 +139,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
#2 lore raw

PATCH 1/1 libltpnuma: Fix compilation with libnuma v1

In reply to Cyril Hrubis

----- Original Message -----

Quoted 6 lines

With libnuma v1 HAVE_NUMA_H is defined but $(NUMA_LIBS) is not, which leads to compilation failures on very very old distributions.

CC Petr Vorel <[email protected]>
CC Jan Stancek <[email protected]>

ack

Quoted 148 lines
---
 libs/libltpnuma/tst_numa.c                                | 4 ++--
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c | 6 +++---
 testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c | 6 +++---
 5 files changed, 14 insertions(+), 14 deletions(-)
libs/libltpnuma/tst_numa.c +2 -2
index 6bd23e949..0ba6daf39 100644
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
@@ -43,7 +43,7 @@ void tst_nodemap_free(struct tst_nodemap *nodes)
 	free(nodes);
 }
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 const char *tst_numa_mode_name(int mode)
 {
testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c +3 -3
index d3c17bb9b..96a275411 100644
@@ -13,14 +13,14 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
 #include "tst_test.h"
 #include "tst_numa.h"
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -117,4 +117,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c +3 -3
index e257c1c2c..4cdec1785 100644
@@ -14,14 +14,14 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
 #include "tst_test.h"
 #include "tst_numa.h"
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -116,4 +116,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c +3 -3
index eb3e046f2..24775de10 100644
@@ -11,7 +11,7 @@
 
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numaif.h>
 # include <numa.h>
 #endif
@@ -21,7 +21,7 @@
 #define MNTPOINT "mntpoint"
 #define PAGES_ALLOCATED 16u
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -110,4 +110,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c +3 -4
index 60601e7c1..8d8aa988d 100644
@@ -22,7 +22,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include "config.h"
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 # include <numa.h>
 # include <numaif.h>
 #endif
@@ -32,7 +32,7 @@
 #define MNTPOINT "mntpoint"
 #define FILES 10
 
-#ifdef HAVE_NUMA_H
+#ifdef HAVE_NUMA_V2
 
 #include "set_mempolicy.h"
 
@@ -139,4 +139,4 @@ static struct tst_test test = {
 
 TST_TEST_TCONF(NUMA_ERROR_MSG);
 
-#endif /* HAVE_NUMA_H */
+#endif /* HAVE_NUMA_V2 */
--

2.19.2