0002-kerncompat.h-define-BTRFS_DISABLE_BACKTRACE-when-bui.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 1fc5444f5620670bb9d293be4f92df59661e1810 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Mon, 20 Feb 2017 23:31:24 +0100
  4. Subject: [PATCH] kerncompat.h: define BTRFS_DISABLE_BACKTRACE when building
  5. with uClibc
  6. uClibc does not provide backtrace() nor <execinfo.h>. When building
  7. btrfs-progs, passing --disable-backtrace is enough to make it build with
  8. uClibc. But once btrfs-progs is installed and another program/library
  9. includes kerncompat.h, it fails to build with uClibc, because
  10. BTRFS_DISABLE_BACKTRACE is not defined.
  11. The most correct fix for this would be to have kerncompat.h generated
  12. from kerncompat.h.in during the btrfs-progs build process, and tuned
  13. depending on autoconf/automake variables. But as a quick fix that
  14. follows the current strategy, we simply tweak the existing __GLIBC__
  15. conditional. Indeed, uClibc pretends to be glibc and defines __GLIBC__,
  16. but it does not replace it completely, hence the need to define
  17. BTRFS_DISABLE_BACKTRACE when __GLIBC__ is not defined *or* when
  18. __UCLIBC__ is defined.
  19. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  20. ---
  21. kerncompat.h | 2 +-
  22. 1 file changed, 1 insertion(+), 1 deletion(-)
  23. diff --git a/kerncompat.h b/kerncompat.h
  24. index 0f207b7..e47d164 100644
  25. --- a/kerncompat.h
  26. +++ b/kerncompat.h
  27. @@ -32,7 +32,7 @@
  28. #include <features.h>
  29. -#ifndef __GLIBC__
  30. +#if !defined(__GLIBC__) || defined(__UCLIBC__)
  31. #ifndef BTRFS_DISABLE_BACKTRACE
  32. #define BTRFS_DISABLE_BACKTRACE
  33. #endif
  34. --
  35. 2.7.4