* [LTP] [PATCH] Fix build with libnuma-dev on some distributions
@ 2019-03-07 14:34 Cyril Hrubis
2019-03-07 15:40 ` Jan Stancek
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2019-03-07 14:34 UTC (permalink / raw)
To: ltp
On some distributions when libnuma-dev is installed the tst_numa.o,
which was added to libltp.a pulls in symbols from numa library to random
unrealted tests which breaks the build.
This commit hence moves the tst_numa to a separate libltpnuma.a library
that is used for linking only for tests that actually use it and link
with -lnuma.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
CC: Jan Stancek <jstancek@redhat.com>
---
This should fix the build failures, beware not build tested yet.
Makefile | 6 +++---
libnuma/Makefile | 10 ++++++++++
{lib => libnuma}/tst_numa.c | 0
testcases/kernel/syscalls/set_mempolicy/Makefile | 3 ++-
4 files changed, 15 insertions(+), 4 deletions(-)
create mode 100644 libnuma/Makefile
rename {lib => libnuma}/tst_numa.c (100%)
diff --git a/Makefile b/Makefile
index bcadd21b2..3d3c70339 100644
--- a/Makefile
+++ b/Makefile
@@ -77,7 +77,7 @@ INSTALL_TARGETS += runtest scenario_groups testscripts
CLEAN_TARGETS += include runtest scenario_groups testscripts
endif
INSTALL_TARGETS += $(COMMON_TARGETS)
-CLEAN_TARGETS += $(COMMON_TARGETS) lib
+CLEAN_TARGETS += $(COMMON_TARGETS) lib libnuma
BOOTSTRAP_TARGETS := $(sort $(COMMON_TARGETS) $(CLEAN_TARGETS) $(INSTALL_TARGETS))
CLEAN_TARGETS := $(addsuffix -clean,$(CLEAN_TARGETS))
@@ -89,7 +89,7 @@ MAKE_TARGETS := $(addsuffix -all,$(filter-out lib,$(COMMON_TARGETS)))
# overtaxed one, or one where -j => 1 was specified.
all: $(addsuffix -all,$(COMMON_TARGETS)) Version
-$(MAKE_TARGETS): lib-all
+$(MAKE_TARGETS): lib-all libnuma-all
.PHONY: include-all include-install
include-install: $(top_builddir)/include/config.h include/mk/config.mk include-all
@@ -110,7 +110,7 @@ $(sort $(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR) $(D
## Pattern based subtarget rules.
lib-install: lib-all
-$(MAKE_TARGETS) include-all lib-all:
+$(MAKE_TARGETS) include-all lib-all libnuma-all:
$(MAKE) -C "$(subst -all,,$@)" \
-f "$(abs_top_srcdir)/$(subst -all,,$@)/Makefile" all
diff --git a/libnuma/Makefile b/libnuma/Makefile
new file mode 100644
index 000000000..e41fc9c72
--- /dev/null
+++ b/libnuma/Makefile
@@ -0,0 +1,10 @@
+#
+
+top_srcdir ?= ..
+
+include $(top_srcdir)/include/mk/env_pre.mk
+
+LIB := libltpnuma.a
+
+include $(top_srcdir)/include/mk/lib.mk
+include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/lib/tst_numa.c b/libnuma/tst_numa.c
similarity index 100%
rename from lib/tst_numa.c
rename to libnuma/tst_numa.c
diff --git a/testcases/kernel/syscalls/set_mempolicy/Makefile b/testcases/kernel/syscalls/set_mempolicy/Makefile
index d273b432b..b21fdd004 100644
--- a/testcases/kernel/syscalls/set_mempolicy/Makefile
+++ b/testcases/kernel/syscalls/set_mempolicy/Makefile
@@ -2,6 +2,7 @@ top_srcdir ?= ../../../..
include $(top_srcdir)/include/mk/testcases.mk
-LDLIBS += $(NUMA_LIBS)
+LDFLAGS += -L$(top_builddir)/libnuma
+LDLIBS += $(NUMA_LIBS) -lltpnuma
include $(top_srcdir)/include/mk/generic_leaf_target.mk
--
2.19.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH] Fix build with libnuma-dev on some distributions
2019-03-07 14:34 [LTP] [PATCH] Fix build with libnuma-dev on some distributions Cyril Hrubis
@ 2019-03-07 15:40 ` Jan Stancek
2019-03-08 10:43 ` Petr Vorel
0 siblings, 1 reply; 5+ messages in thread
From: Jan Stancek @ 2019-03-07 15:40 UTC (permalink / raw)
To: ltp
----- Original Message -----
> On some distributions when libnuma-dev is installed the tst_numa.o,
> which was added to libltp.a pulls in symbols from numa library to random
> unrealted tests which breaks the build.
>
> This commit hence moves the tst_numa to a separate libltpnuma.a library
> that is used for linking only for tests that actually use it and link
> with -lnuma.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> CC: Jan Stancek <jstancek@redhat.com>
> ---
>
> This should fix the build failures, beware not build tested yet.
I'm fine with approach. I'd suggest different directory name, but
it's hard to come up with something nice. Maybe:
libnumafn, libnumautils (maybe taken), libtstnuma
Might be less confusing if it doesn't share same name as existing
library.
>
> Makefile | 6 +++---
> libnuma/Makefile | 10 ++++++++++
> {lib => libnuma}/tst_numa.c | 0
> testcases/kernel/syscalls/set_mempolicy/Makefile | 3 ++-
> 4 files changed, 15 insertions(+), 4 deletions(-)
> create mode 100644 libnuma/Makefile
> rename {lib => libnuma}/tst_numa.c (100%)
>
> diff --git a/Makefile b/Makefile
> index bcadd21b2..3d3c70339 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -77,7 +77,7 @@ INSTALL_TARGETS += runtest scenario_groups testscripts
> CLEAN_TARGETS += include runtest scenario_groups testscripts
> endif
> INSTALL_TARGETS += $(COMMON_TARGETS)
> -CLEAN_TARGETS += $(COMMON_TARGETS) lib
> +CLEAN_TARGETS += $(COMMON_TARGETS) lib libnuma
> BOOTSTRAP_TARGETS := $(sort $(COMMON_TARGETS) $(CLEAN_TARGETS)
> $(INSTALL_TARGETS))
>
> CLEAN_TARGETS := $(addsuffix -clean,$(CLEAN_TARGETS))
> @@ -89,7 +89,7 @@ MAKE_TARGETS := $(addsuffix -all,$(filter-out
> lib,$(COMMON_TARGETS)))
> # overtaxed one, or one where -j => 1 was specified.
> all: $(addsuffix -all,$(COMMON_TARGETS)) Version
>
> -$(MAKE_TARGETS): lib-all
> +$(MAKE_TARGETS): lib-all libnuma-all
>
> .PHONY: include-all include-install
> include-install: $(top_builddir)/include/config.h include/mk/config.mk
> include-all
> @@ -110,7 +110,7 @@ $(sort $(addprefix
> $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR) $(D
> ## Pattern based subtarget rules.
> lib-install: lib-all
>
> -$(MAKE_TARGETS) include-all lib-all:
> +$(MAKE_TARGETS) include-all lib-all libnuma-all:
> $(MAKE) -C "$(subst -all,,$@)" \
> -f "$(abs_top_srcdir)/$(subst -all,,$@)/Makefile" all
>
> diff --git a/libnuma/Makefile b/libnuma/Makefile
> new file mode 100644
> index 000000000..e41fc9c72
> --- /dev/null
> +++ b/libnuma/Makefile
> @@ -0,0 +1,10 @@
> +#
> +
> +top_srcdir ?= ..
> +
> +include $(top_srcdir)/include/mk/env_pre.mk
> +
> +LIB := libltpnuma.a
> +
> +include $(top_srcdir)/include/mk/lib.mk
> +include $(top_srcdir)/include/mk/generic_trunk_target.mk
> diff --git a/lib/tst_numa.c b/libnuma/tst_numa.c
> similarity index 100%
> rename from lib/tst_numa.c
> rename to libnuma/tst_numa.c
> diff --git a/testcases/kernel/syscalls/set_mempolicy/Makefile
> b/testcases/kernel/syscalls/set_mempolicy/Makefile
> index d273b432b..b21fdd004 100644
> --- a/testcases/kernel/syscalls/set_mempolicy/Makefile
> +++ b/testcases/kernel/syscalls/set_mempolicy/Makefile
> @@ -2,6 +2,7 @@ top_srcdir ?= ../../../..
>
> include $(top_srcdir)/include/mk/testcases.mk
>
> -LDLIBS += $(NUMA_LIBS)
> +LDFLAGS += -L$(top_builddir)/libnuma
> +LDLIBS += $(NUMA_LIBS) -lltpnuma
>
> include $(top_srcdir)/include/mk/generic_leaf_target.mk
> --
> 2.19.2
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH] Fix build with libnuma-dev on some distributions
2019-03-07 15:40 ` Jan Stancek
@ 2019-03-08 10:43 ` Petr Vorel
2019-03-08 11:34 ` Cyril Hrubis
0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2019-03-08 10:43 UTC (permalink / raw)
To: ltp
Hi,
> ----- Original Message -----
> > On some distributions when libnuma-dev is installed the tst_numa.o,
> > which was added to libltp.a pulls in symbols from numa library to random
> > unrealted tests which breaks the build.
> > This commit hence moves the tst_numa to a separate libltpnuma.a library
> > that is used for linking only for tests that actually use it and link
> > with -lnuma.
> > Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> > CC: Jan Stancek <jstancek@redhat.com>
> > ---
> > This should fix the build failures, beware not build tested yet.
The problem persists [1] [2]:
/usr/src/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c:105: undefined reference to `numa_allocate_nodemask'
/usr/src/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c:110: undefined reference to `numa_bitmask_setbit'
/usr/src/ltp/testcases/kernel/syscalls/set_mempolicy/set_mempolicy04.c:112: undefined reference to `set_mempolicy'
> I'm fine with approach. I'd suggest different directory name, but
> it's hard to come up with something nice. Maybe:
> libnumafn, libnumautils (maybe taken), libtstnuma
> Might be less confusing if it doesn't share same name as existing
> library.
Agree.
+ other LTP libraries are hidden in some subdirectories (which might be
confusing), but I like there is not lib/ and lib<foo>/ in root directory.
Kind regards,
Petr
[1] https://api.travis-ci.org/v3/job/503536791/log.txt
[2] https://travis-ci.org/pevik/ltp/jobs/503536791
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH] Fix build with libnuma-dev on some distributions
2019-03-08 10:43 ` Petr Vorel
@ 2019-03-08 11:34 ` Cyril Hrubis
2019-03-08 11:47 ` Petr Vorel
0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2019-03-08 11:34 UTC (permalink / raw)
To: ltp
Hi!
> + other LTP libraries are hidden in some subdirectories (which might be
> confusing), but I like there is not lib/ and lib<foo>/ in root directory.
We can add a libs/ directory to the top level directory and put all libs
shared between significant number of tests in different places there.
How does this sound?
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH] Fix build with libnuma-dev on some distributions
2019-03-08 11:34 ` Cyril Hrubis
@ 2019-03-08 11:47 ` Petr Vorel
0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2019-03-08 11:47 UTC (permalink / raw)
To: ltp
Hi,
> > + other LTP libraries are hidden in some subdirectories (which might be
> > confusing), but I like there is not lib/ and lib<foo>/ in root directory.
> We can add a libs/ directory to the top level directory and put all libs
> shared between significant number of tests in different places there.
> How does this sound?
Thanks, make sense to me.
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-03-08 11:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 14:34 [LTP] [PATCH] Fix build with libnuma-dev on some distributions Cyril Hrubis
2019-03-07 15:40 ` Jan Stancek
2019-03-08 10:43 ` Petr Vorel
2019-03-08 11:34 ` Cyril Hrubis
2019-03-08 11:47 ` Petr Vorel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.