compat: export symbol elfcorehdr_addr if it is not exported by the kernel
authorVladimir Sokolovsky <vlad@mellanox.com>
Tue, 28 Apr 2015 11:21:06 +0000 (14:21 +0300)
committerVladimir Sokolovsky <vlad@mellanox.com>
Tue, 28 Apr 2015 11:23:20 +0000 (14:23 +0300)
issue: http://bugs.openfabrics.org/bugzilla/show_bug.cgi?id=2536

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
compat/compat-3.18.c
config/rdma.m4

index 4dced45..824ba4c 100644 (file)
@@ -1,5 +1,12 @@
 #include <linux/kernel.h>
 #include <linux/kernel.h>
+#include <linux/export.h>
 #include <linux/crash_dump.h>
 
 #include <linux/crash_dump.h>
 
+#ifndef HAVE_ELFCOREHDR_ADDR_EXPORTED
+#ifndef ELFCORE_ADDR_MAX
+#define ELFCORE_ADDR_MAX        (-1ULL)
+#endif
+
 unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
 EXPORT_SYMBOL_GPL(elfcorehdr_addr);
 unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
 EXPORT_SYMBOL_GPL(elfcorehdr_addr);
+#endif /* HAVE_ELFCOREHDR_ADDR_EXPORTED */
index 847757c..0a2aaa3 100644 (file)
@@ -2110,6 +2110,12 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
        ],[
                AC_MSG_RESULT(no)
        ])
        ],[
                AC_MSG_RESULT(no)
        ])
+
+       LB_CHECK_SYMBOL_EXPORT([elfcorehdr_addr],
+               [kernel/crash_dump.c],
+               [AC_DEFINE(HAVE_ELFCOREHDR_ADDR_EXPORTED, 1,
+                       [elfcorehdr_addr is exported by the kernel])],
+       [])
 ])
 #
 # COMPAT_CONFIG_HEADERS
 ])
 #
 # COMPAT_CONFIG_HEADERS