diff options
author | Mark Wielaard <mjw@redhat.com> | 2016-11-23 20:51:35 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2016-11-23 20:51:35 +0100 |
commit | ee225020a880e41cd4007af09ae488bc9cf1a536 (patch) | |
tree | fa6debf30bbcb9424bda0126d48d71eb9c9292d6 /libdwfl | |
parent | 507e7e28f0f58cb711a7b3e5bb320c5f30b0e6ea (diff) | |
download | elfutils-ee225020a880e41cd4007af09ae488bc9cf1a536.tar.gz |
Only workaround fts.h if we have a bad version that doesn't handle LFS.
Older versions of glibc included an fts implementation that didn't have
Large File System support. We worked around that in linux-kernel-modules.c
by including it early before config.h and then redefining some symbols
to get the 64-bit versions. This is somewhat fragile and not necessary
with newer glibc. If possible we want the 64bit fts version always.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libdwfl')
-rw-r--r-- | libdwfl/ChangeLog | 7 | ||||
-rw-r--r-- | libdwfl/linux-kernel-modules.c | 20 |
2 files changed, 19 insertions, 8 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 27c5d6ef..bc627fee 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,4 +1,9 @@ -2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> +2016-11-23 Mark Wielaard <mjw@redhat.com> + + * linux-kernel-modules.c: Only include fts.h early if BAD_FTS is + defined. + +2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> * core-file.c: Remove sys/param.h. * dwfl_segment_report_module.c: Likewise. Add system.h include. diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c index 54c0b908..9cd8ea93 100644 --- a/libdwfl/linux-kernel-modules.c +++ b/libdwfl/linux-kernel-modules.c @@ -26,10 +26,12 @@ the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* We include this before config.h because it can't handle _FILE_OFFSET_BITS. +/* In case we have a bad fts we include this before config.h because it + can't handle _FILE_OFFSET_BITS. Everything we need here is fine if its declarations just come first. */ - -#include <fts.h> +#ifdef BAD_FTS + #include <fts.h> +#endif #include <config.h> @@ -44,11 +46,15 @@ #include <fcntl.h> #include <unistd.h> -/* Since fts.h is included before config.h, its indirect inclusions may not +/* If fts.h is included before config.h, its indirect inclusions may not give us the right LFS aliases of these functions, so map them manually. */ -#ifdef _FILE_OFFSET_BITS -#define open open64 -#define fopen fopen64 +#ifdef BAD_FTS + #ifdef _FILE_OFFSET_BITS + #define open open64 + #define fopen fopen64 + #endif +#else + #include <fts.h> #endif |