* [LTP] [PATCH] libltpnuma: Fix compilation with libnuma v1
@ 2019-03-08 13:51 Cyril Hrubis
2019-03-08 14:49 ` Petr Vorel
2019-03-08 14:53 ` Jan Stancek
0 siblings, 2 replies; 3+ messages in thread
From: Cyril Hrubis @ 2019-03-08 13:51 UTC (permalink / raw)
To: ltp
With libnuma v1 HAVE_NUMA_H is defined but $(NUMA_LIBS) is not, which
leads to compilation failures on very very old distributions.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
CC: Petr Vorel <pvorel@suse.cz>
CC: Jan Stancek <jstancek@redhat.com>
---
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(-)
diff --git a/libs/libltpnuma/tst_numa.c b/libs/libltpnuma/tst_numa.c
index 6bd23e949..0ba6daf39 100644
--- a/libs/libltpnuma/tst_numa.c
+++ b/libs/libltpnuma/tst_numa.c
@@ -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)
{
diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
index d3c17bb9b..96a275411 100644
--- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
+++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
@@ -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 */
diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
index e257c1c2c..4cdec1785 100644
--- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
+++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
@@ -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 */
diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
index eb3e046f2..24775de10 100644
--- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
+++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
@@ -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 */
diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
index 60601e7c1..8d8aa988d 100644
--- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
+++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread* [LTP] [PATCH] libltpnuma: Fix compilation with libnuma v1
2019-03-08 13:51 [LTP] [PATCH] libltpnuma: Fix compilation with libnuma v1 Cyril Hrubis
@ 2019-03-08 14:49 ` Petr Vorel
2019-03-08 14:53 ` Jan Stancek
1 sibling, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2019-03-08 14:49 UTC (permalink / raw)
To: ltp
Hi Cyril,
> With libnuma v1 HAVE_NUMA_H is defined but $(NUMA_LIBS) is not, which
> leads to compilation failures on very very old distributions.
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> CC: Petr Vorel <pvorel@suse.cz>
> CC: Jan Stancek <jstancek@redhat.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
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
> ---
> 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(-)
> diff --git a/libs/libltpnuma/tst_numa.c b/libs/libltpnuma/tst_numa.c
> index 6bd23e949..0ba6daf39 100644
> --- a/libs/libltpnuma/tst_numa.c
> +++ b/libs/libltpnuma/tst_numa.c
> @@ -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)
> {
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
> index d3c17bb9b..96a275411 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
> @@ -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 */
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
> index e257c1c2c..4cdec1785 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
> @@ -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 */
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
> index eb3e046f2..24775de10 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
> @@ -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 */
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> index 60601e7c1..8d8aa988d 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> @@ -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 */
^ permalink raw reply [flat|nested] 3+ messages in thread* [LTP] [PATCH] libltpnuma: Fix compilation with libnuma v1
2019-03-08 13:51 [LTP] [PATCH] libltpnuma: Fix compilation with libnuma v1 Cyril Hrubis
2019-03-08 14:49 ` Petr Vorel
@ 2019-03-08 14:53 ` Jan Stancek
1 sibling, 0 replies; 3+ messages in thread
From: Jan Stancek @ 2019-03-08 14:53 UTC (permalink / raw)
To: ltp
----- Original Message -----
> With libnuma v1 HAVE_NUMA_H is defined but $(NUMA_LIBS) is not, which
> leads to compilation failures on very very old distributions.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> CC: Petr Vorel <pvorel@suse.cz>
> CC: Jan Stancek <jstancek@redhat.com>
ack
> ---
> 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(-)
>
> diff --git a/libs/libltpnuma/tst_numa.c b/libs/libltpnuma/tst_numa.c
> index 6bd23e949..0ba6daf39 100644
> --- a/libs/libltpnuma/tst_numa.c
> +++ b/libs/libltpnuma/tst_numa.c
> @@ -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)
> {
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
> b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
> index d3c17bb9b..96a275411 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy01.c
> @@ -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 */
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
> b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
> index e257c1c2c..4cdec1785 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy02.c
> @@ -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 */
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
> b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
> index eb3e046f2..24775de10 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy03.c
> @@ -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 */
> diff --git a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> index 60601e7c1..8d8aa988d 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> +++ b/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c
> @@ -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
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-08 14:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-08 13:51 [LTP] [PATCH] libltpnuma: Fix compilation with libnuma v1 Cyril Hrubis
2019-03-08 14:49 ` Petr Vorel
2019-03-08 14:53 ` Jan Stancek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox