trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] compat.h: add more macros
@ 2016-01-04 11:21 Jiri Slaby
  2016-01-04 11:21 ` [PATCH v2 2/2] Makefile: fix build with older glibc Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2016-01-04 11:21 UTC (permalink / raw)
  To: davej; +Cc: trinity, Jiri Slaby

Some more RTNLGRP macros are not defined on SLE11 yet.

[v2]: NVME_IOCTL_RESET is not defined on openSUSE 42.1. Include
compat.h in ioctls/nvme.c.

So define them in compat.h.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 include/compat.h | 17 +++++++++++++++++
 ioctls/nvme.c    |  1 +
 2 files changed, 18 insertions(+)

diff --git a/include/compat.h b/include/compat.h
index fda51b529b4d..65e5e3c3cc08 100644
--- a/include/compat.h
+++ b/include/compat.h
@@ -268,6 +268,18 @@ enum {
 #ifndef NETLINK_SOCK_DIAG
 #define NETLINK_SOCK_DIAG 4
 #endif
+#ifndef RTNLGRP_DCB
+#define RTNLGRP_DCB 23
+#endif
+#ifndef RTNLGRP_IPV4_NETCONF
+#define RTNLGRP_IPV4_NETCONF 24
+#endif
+#ifndef RTNLGRP_IPV6_NETCONF
+#define RTNLGRP_IPV6_NETCONF 25
+#endif
+#ifndef RTNLGRP_MDB
+#define RTNLGRP_MDB 26
+#endif
 #ifndef RTNLGRP_MPLS_ROUTE
 #define RTNLGRP_MPLS_ROUTE 27
 #endif
@@ -1055,3 +1067,8 @@ struct kvm_get_htab_fd {
 #ifndef POLL_BUSY_LOOP
 #define POLL_BUSY_LOOP 0x8000
 #endif
+
+/* linux/nvme_ioctl.h */
+#ifndef NVME_IOCTL_RESET
+#define NVME_IOCTL_RESET _IO('N', 0x44)
+#endif
diff --git a/ioctls/nvme.c b/ioctls/nvme.c
index 406ec6bc2254..2cc9f1f9d366 100644
--- a/ioctls/nvme.c
+++ b/ioctls/nvme.c
@@ -3,6 +3,7 @@
 #include <linux/ioctl.h>
 #include <linux/nvme.h>
 
+#include "compat.h"
 #include "utils.h"
 #include "ioctls.h"
 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2 2/2] Makefile: fix build with older glibc
  2016-01-04 11:21 [PATCH v2 1/2] compat.h: add more macros Jiri Slaby
@ 2016-01-04 11:21 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2016-01-04 11:21 UTC (permalink / raw)
  To: davej; +Cc: trinity, Jiri Slaby

man 2 clock_gettime says:
Link with -lrt (only for glibc versions before 2.17).

If we do not do that, we get:
post-mortem.c:61: undefined reference to `clock_gettime'
syscall.o: In function `__do_syscall':
syscall.c:121: undefined reference to `clock_gettime'
watchdog.o: In function `is_child_making_progress':
watchdog.c:317: undefined reference to `clock_gettime'

So introduce (standard) LDLIBS into Makefile and add -lrt there.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 0cdcf4be0ae0..a70c5bd958a5 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,9 @@ CFLAGS += -Wstrict-prototypes -Wmissing-prototypes
 # needed for show_backtrace() to work correctly.
 LDFLAGS += -rdynamic
 
+# glibc versions before 2.17 for clock_gettime
+LDLIBS += -lrt
+
 # gcc only.
 ifneq ($(shell $(CC) -v 2>&1 | grep -c "clang"), 1)
 CFLAGS += -Wlogical-op
@@ -96,7 +99,7 @@ DEPDIR= .deps
 -include $(SRCS:%.c=$(DEPDIR)/%.d)
 
 trinity: version test $(OBJS) $(HEADERS)
-	$(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o trinity $(OBJS)
+	$(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o trinity $(OBJS) $(LDLIBS)
 	@mkdir -p tmp
 
 df = $(DEPDIR)/$(*D)/$(*F)
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-04 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-04 11:21 [PATCH v2 1/2] compat.h: add more macros Jiri Slaby
2016-01-04 11:21 ` [PATCH v2 2/2] Makefile: fix build with older glibc Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).