]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix libdwfl compile issue in case none of the compression libraries are there.
authorMark Wielaard <mjw@redhat.com>
Mon, 11 Apr 2011 15:24:16 +0000 (17:24 +0200)
committerMark Wielaard <mjw@redhat.com>
Mon, 11 Apr 2011 15:24:16 +0000 (17:24 +0200)
    * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
    by check for zlib, bzlib or lzma defines to check it isn't empty.
    (try_kernel_name): Use same guard for use of vmlinux_suffixes.

libdwfl/ChangeLog
libdwfl/linux-kernel-modules.c

index 3edc11bea8cd6bfc7ecc104217b8c995fa5e3a97..abad77b56a168a731f0fb45452ead8925f0baced 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-11  Mark Wielaard  <mjw@redhat.com>
+
+       * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
+       by check for zlib, bzlib or lzma defines to check it isn't empty.
+       (try_kernel_name): Use same guard for use of vmlinux_suffixes.
+
 2011-03-08  Roland McGrath  <roland@redhat.com>
 
        * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
index f3d9af1080e49b6c13b7ff03220d79db8a4a95d8..ae74a4977c4b38ac0eb0a2fae37c7bab0bea8124 100644 (file)
@@ -78,6 +78,7 @@
 #define MODULE_SECT_NAME_LEN 32        /* Minimum any linux/module.h has had.  */
 
 
+#if defined (USE_ZLIB) || defined (USE_BZLIB) || defined (USE_LZMA)
 static const char *vmlinux_suffixes[] =
   {
 #ifdef USE_ZLIB
@@ -90,6 +91,7 @@ static const char *vmlinux_suffixes[] =
     ".xz",
 #endif
   };
+#endif
 
 /* Try to open the given file as it is or under the debuginfo directory.  */
 static int
@@ -127,6 +129,7 @@ try_kernel_name (Dwfl *dwfl, char **fname, bool try_debug)
        }
     }
 
+#if defined (USE_ZLIB) || defined (USE_BZLIB) || defined (USE_LZMA)
   if (fd < 0)
     for (size_t i = 0;
         i < sizeof vmlinux_suffixes / sizeof vmlinux_suffixes[0];
@@ -145,6 +148,7 @@ try_kernel_name (Dwfl *dwfl, char **fname, bool try_debug)
              }
          }
       }
+#endif
 
   if (fd < 0)
     {