linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH xfsprogs] build: don't assume $BUILD_CC has fsmap.h just because $CC does
@ 2018-09-06 18:35 Brian Norris
  2018-09-06 22:33 ` Eric Sandeen
  0 siblings, 1 reply; 7+ messages in thread
From: Brian Norris @ 2018-09-06 18:35 UTC (permalink / raw)
  To: linux-xfs; +Cc: Brian Norris

The $BUILD_CC toolchain might have an older set of Linux headers than
the $CC toolchain. It's generally unsafe to try to build both with the
same definitions, but in particular, this one can cause compilation
failures in the local crc32selftest build:

 In file included from crc32.c:37:
 In file included from ../include/xfs.h:37:
 ../include/xfs/linux.h:226:11: fatal error: 'linux/fsmap.h' file not found
 # include <linux/fsmap.h>
           ^~~~~~~~~~~~~~~

It's safe to always assume that the headers don't have getfsmap, since
the alternative just includes our local definitions anyway.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This isn't exactly a pretty solution, but it fixes cross-compilation
problems I'm seeing.

 include/builddefs.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/builddefs.in b/include/builddefs.in
index f7d39a4e4094..209abe1d84dd 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -156,8 +156,9 @@ endif
 ifeq ($(NEED_INTERNAL_FSXATTR),yes)
 PCFLAGS+= -DOVERRIDE_SYSTEM_FSXATTR
 endif
+# Don't assume $BUILD_CC has getfsmap just because $CC does.
 ifeq ($(HAVE_GETFSMAP),yes)
-PCFLAGS+= -DHAVE_GETFSMAP
+CFLAGS+= -DHAVE_GETFSMAP
 endif
 
 LIBICU_LIBS = @libicu_LIBS@
-- 
2.19.0.rc2.392.g5ba43deb5a-goog

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-22  2:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-06 18:35 [PATCH xfsprogs] build: don't assume $BUILD_CC has fsmap.h just because $CC does Brian Norris
2018-09-06 22:33 ` Eric Sandeen
2018-09-06 22:55   ` Brian Norris
2018-09-21 18:37     ` Brian Norris
2018-09-21 19:12       ` Eric Sandeen
2018-09-21 19:34         ` Brian Norris
2018-09-21 20:53           ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).