From patchwork Mon Feb 1 21:25:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gwendal Grignou X-Patchwork-Id: 8183721 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2A19A9F4DD for ; Mon, 1 Feb 2016 21:25:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF1AA20263 for ; Mon, 1 Feb 2016 21:25:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D9D5201ED for ; Mon, 1 Feb 2016 21:25:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932295AbcBAVZj (ORCPT ); Mon, 1 Feb 2016 16:25:39 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33167 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932443AbcBAVZe (ORCPT ); Mon, 1 Feb 2016 16:25:34 -0500 Received: by mail-pf0-f176.google.com with SMTP id x125so90619761pfb.0 for ; Mon, 01 Feb 2016 13:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bW1nwh6c7l8u/rtJEIWHN41iv5PY+i5/XPyLMDOI/8g=; b=LFvHi/cRK4Jt8R1TuI/ib8Ku7nI1+J5X3DLpPaWGSbzZksSvFIIDKexuUQEpTza7iW 4hZ+wyB5ZvdrnM6UA7y0Lq8Z0dtubl//5eRT9Wc2ryadV1BQZU978hnTICu3Ge2Sm+c7 vzeE7+bT59hkvEznAvlBOC97fuA9fW99PAqsKopspGQn6ChVbjMI2vcbJte75klzCyI/ I0XaMVwQx/thEb7Cjtnr0462nNAAgVcKyzgyHOsJiqAt80tres2HmwtUibv/F7uw94g5 BDTVsq2ZvEHv4MfCgxxXIHgqB96fVBl2LQ5+ydCD0vdP5VeFOXEasIMecWkygR12uWRW YawQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bW1nwh6c7l8u/rtJEIWHN41iv5PY+i5/XPyLMDOI/8g=; b=B7o4ORxfkX85or3jYWfN4LnKSbxxs+qsetIGtls0eOj4yqctlyiAGQbjYj4cZo+aci 5q7ehC6pTZtazKmDk5W7BEoUNDTPfMRK0XxlmCBXeEyrf9xamOMTRu40Pdx6HHa2if+o vDF6OE6ehj4MnG9g3C4QhWTma11UrH8xVmdf53Y+cJAgc8x5U3K5vP+WW1ly7mNtF4NV NfakTS6vPlM3CU5qz7pyv5MMEh+7FeZxGQRnnOwGKOtJwHj7UUjmo1wNJRrhDgFhVLSW yJA024s+KMSBSprC6XQ9Nx1GMs+4tkyxofMNNRu2n8xmbv3Nw2xjooeOynS2fl8dP64+ IRKw== X-Gm-Message-State: AG10YOTjwNXfrI460K0UyUMSfK9DBZk2y2Vur2WnyTVpRQwnyqsxIstC8tuXtu3Ev46nAe0G X-Received: by 10.98.72.135 with SMTP id q7mr41335031pfi.151.1454361934189; Mon, 01 Feb 2016 13:25:34 -0800 (PST) Received: from gwendal.mtv.corp.google.com ([172.22.64.242]) by smtp.gmail.com with ESMTPSA id mk3sm10935757pab.20.2016.02.01.13.25.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 13:25:30 -0800 (PST) From: Gwendal Grignou 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 Message-Id: <1454361909-36538-1-git-send-email-gwendal@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1437913255-7524-4-git-send-email-tytso@mit.edu> References: <1437913255-7524-4-git-send-email-tytso@mit.edu> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],, Reviewed-by: Christoph Hellwig --- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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,