From: Gwendal Grignou <gwendal@chromium.org> To: hch@infradead.org, tytso@mit.edu Cc: fstests@vger.kernel.org, xfs@oss.sgi.com Subject: xfsprogs: Add BUILD_CFLAGS for cross compilation Date: Mon, 1 Feb 2016 13:25:09 -0800 [thread overview] Message-ID: <1454361909-36538-1-git-send-email-gwendal@chromium.org> (raw) In-Reply-To: <1437913255-7524-4-git-send-email-tytso@mit.edu> When cross compiling, CFLAGS may contains option for the cros-compiler the host compiler can not handle. Add BUILD_CFLAGS variable that does not include $OPTIMIZER options. Signed-off by: Gwendal Grignou <gwendal@chromium.org> --- a/include/builddefs.in 2016-02-01 09:44:14.636018753 -0800 +++ b/include/builddefs.in 2016-02-01 09:37:29.000000000 -0800 @@ -27,6 +27,7 @@ LOADERFLAGS = @LDFLAGS@ LTLDFLAGS = @LDFLAGS@ CFLAGS = @CFLAGS@ +BUILD_CFLAGS = @BUILD_CFLAGS@ LIBRT = @librt@ LIBUUID = @libuuid@ @@ -151,7 +151,7 @@ endif -GCFLAGS = $(OPTIMIZER) $(DEBUG) \ +GCFLAGS = $(DEBUG) \ -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include -I$(TOPDIR)/libxfs @@ -160,7 +160,8 @@ endif # First, Global, Platform, Local CFLAGS -CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) +BUILD_CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) +CFLAGS += $(FCFLAGS) $(OPTIMIZER) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) include $(TOPDIR)/include/buildmacros --- a/libxfs/Makefile 2016-02-01 09:44:14.644018849 -0800 +++ b/libxfs/Makefile 2016-02-01 09:37:55.000000000 -0800 @@ -111,7 +111,7 @@ crc32table.h: gen_crc32table.c @echo " [CC] gen_crc32table" - $(Q) $(BUILD_CC) $(CFLAGS) -o gen_crc32table $< + $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -o gen_crc32table $< @echo " [GENERATE] $@" $(Q) ./gen_crc32table > crc32table.h @@ -122,7 +122,7 @@ # disk. crc32selftest: gen_crc32table.c crc32table.h crc32.c @echo " [TEST] CRC32" - $(Q) $(BUILD_CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ + $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ $(Q) ./$@ # set up include/xfs header directory --- a/configure.ac 2016-02-01 09:56:42.873010767 -0800 +++ b/configure.ac 2016-02-01 09:56:45.885047014 -0800 @@ -11,9 +11,12 @@ AC_PROG_CC if test $cross_compiling = no; then BUILD_CC="$CC" + BUILD_CFLAGS="$CFLAGS" AC_SUBST(BUILD_CC) else AC_CHECK_PROGS(BUILD_CC, gcc cc) + BUILD_CFLAGS="-g" fi +AC_SUBST(BUILD_CFLAGS) AC_ARG_ENABLE(shared, [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
WARNING: multiple messages have this Message-ID (diff)
From: Gwendal Grignou <gwendal@chromium.org> To: hch@infradead.org, tytso@mit.edu Cc: fstests@vger.kernel.org, xfs@oss.sgi.com Subject: xfsprogs: Add BUILD_CFLAGS for cross compilation Date: Mon, 1 Feb 2016 13:25:09 -0800 [thread overview] Message-ID: <1454361909-36538-1-git-send-email-gwendal@chromium.org> (raw) In-Reply-To: <1437913255-7524-4-git-send-email-tytso@mit.edu> When cross compiling, CFLAGS may contains option for the cros-compiler the host compiler can not handle. Add BUILD_CFLAGS variable that does not include $OPTIMIZER options. Signed-off by: Gwendal Grignou <gwendal@chromium.org> --- a/include/builddefs.in 2016-02-01 09:44:14.636018753 -0800 +++ b/include/builddefs.in 2016-02-01 09:37:29.000000000 -0800 @@ -27,6 +27,7 @@ LOADERFLAGS = @LDFLAGS@ LTLDFLAGS = @LDFLAGS@ CFLAGS = @CFLAGS@ +BUILD_CFLAGS = @BUILD_CFLAGS@ LIBRT = @librt@ LIBUUID = @libuuid@ @@ -151,7 +151,7 @@ endif -GCFLAGS = $(OPTIMIZER) $(DEBUG) \ +GCFLAGS = $(DEBUG) \ -DVERSION=\"$(PKG_VERSION)\" -DLOCALEDIR=\"$(PKG_LOCALE_DIR)\" \ -DPACKAGE=\"$(PKG_NAME)\" -I$(TOPDIR)/include -I$(TOPDIR)/libxfs @@ -160,7 +160,8 @@ endif # First, Global, Platform, Local CFLAGS -CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) +BUILD_CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) +CFLAGS += $(FCFLAGS) $(OPTIMIZER) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS) include $(TOPDIR)/include/buildmacros --- a/libxfs/Makefile 2016-02-01 09:44:14.644018849 -0800 +++ b/libxfs/Makefile 2016-02-01 09:37:55.000000000 -0800 @@ -111,7 +111,7 @@ crc32table.h: gen_crc32table.c @echo " [CC] gen_crc32table" - $(Q) $(BUILD_CC) $(CFLAGS) -o gen_crc32table $< + $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -o gen_crc32table $< @echo " [GENERATE] $@" $(Q) ./gen_crc32table > crc32table.h @@ -122,7 +122,7 @@ # disk. crc32selftest: gen_crc32table.c crc32table.h crc32.c @echo " [TEST] CRC32" - $(Q) $(BUILD_CC) $(CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ + $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@ $(Q) ./$@ # set up include/xfs header directory --- a/configure.ac 2016-02-01 09:56:42.873010767 -0800 +++ b/configure.ac 2016-02-01 09:56:45.885047014 -0800 @@ -11,9 +11,12 @@ AC_PROG_CC if test $cross_compiling = no; then BUILD_CC="$CC" + BUILD_CFLAGS="$CFLAGS" AC_SUBST(BUILD_CC) else AC_CHECK_PROGS(BUILD_CC, gcc cc) + BUILD_CFLAGS="-g" fi +AC_SUBST(BUILD_CFLAGS) AC_ARG_ENABLE(shared, [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],, _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-02-01 21:25 UTC|newest] Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-07-26 12:20 [PATCH 0/6] Add cross-compilation support for android Theodore Ts'o 2015-07-26 12:20 ` Theodore Ts'o 2015-07-26 12:20 ` [PATCH 1/6] xfsprogs: define NBBY if not defined by the system header files Theodore Ts'o 2015-07-26 12:20 ` Theodore Ts'o 2015-07-30 17:07 ` Christoph Hellwig 2015-07-30 17:07 ` Christoph Hellwig 2015-07-26 12:20 ` [PATCH 2/6] xfsprogs: pull in libgen.h to get prototype for basename() Theodore Ts'o 2015-07-26 12:20 ` Theodore Ts'o 2015-07-30 17:11 ` Christoph Hellwig 2015-07-30 17:11 ` Christoph Hellwig 2015-07-26 12:20 ` [PATCH 3/6] xfsprogs: define and use BUILD_CC in configure.ac for cross compilation Theodore Ts'o 2015-07-26 12:20 ` Theodore Ts'o 2015-07-30 17:10 ` Christoph Hellwig 2015-07-30 17:10 ` Christoph Hellwig 2016-01-30 0:58 ` Gwendal Grignou 2016-02-01 21:25 ` Gwendal Grignou [this message] 2016-02-01 21:25 ` xfsprogs: Add BUILD_CFLAGS " Gwendal Grignou 2016-02-02 18:08 ` Christoph Hellwig 2016-02-02 18:08 ` Christoph Hellwig 2016-05-27 16:34 ` Gwendal Grignou 2016-05-31 12:51 ` Christoph Hellwig 2016-05-31 12:51 ` Christoph Hellwig 2016-05-31 16:19 ` Gwendal Grignou 2016-05-31 16:19 ` Gwendal Grignou 2015-07-26 12:20 ` [PATCH 4/6] xfsprogs: avoid use of si_tid in struct xlog_split_item Theodore Ts'o 2015-07-26 12:20 ` Theodore Ts'o 2015-07-30 17:11 ` Christoph Hellwig 2015-07-30 17:11 ` Christoph Hellwig 2015-07-26 12:20 ` [PATCH 5/6] xfsprogs: use "unsigned short" instead of ushort Theodore Ts'o 2015-07-26 12:20 ` Theodore Ts'o 2015-07-30 17:09 ` Christoph Hellwig 2015-07-30 17:09 ` Christoph Hellwig 2015-07-26 12:20 ` [PATCH 6/6] xfsprogs: add missing include of <stat.h> Theodore Ts'o 2015-07-26 12:20 ` Theodore Ts'o 2015-07-30 17:10 ` Christoph Hellwig 2015-07-30 17:10 ` Christoph Hellwig
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1454361909-36538-1-git-send-email-gwendal@chromium.org \ --to=gwendal@chromium.org \ --cc=fstests@vger.kernel.org \ --cc=hch@infradead.org \ --cc=tytso@mit.edu \ --cc=xfs@oss.sgi.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.