diff options
author | Mark Wielaard <mjw@redhat.com> | 2011-04-11 17:24:16 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2011-04-11 17:24:16 +0200 |
commit | dbb490fad0fb4924e7cd0ae3991dec1cda0de644 (patch) | |
tree | f4fe973fdad8149ae1acb3a4a7c273bdb4b05ead | |
parent | 494275c0f41dea71d8ec5b97d01581c95fdfbbdb (diff) | |
download | elfutils-dbb490fad0fb4924e7cd0ae3991dec1cda0de644.tar.gz |
Fix libdwfl compile issue in case none of the compression libraries are there.
* 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.
-rw-r--r-- | libdwfl/ChangeLog | 6 | ||||
-rw-r--r-- | libdwfl/linux-kernel-modules.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 3edc11be..abad77b5 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -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. diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c index f3d9af10..ae74a497 100644 --- a/libdwfl/linux-kernel-modules.c +++ b/libdwfl/linux-kernel-modules.c @@ -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) { |