From patchwork Wed Oct 10 20:55:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 10635267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B490415E2 for ; Wed, 10 Oct 2018 20:55:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A49FC2ACF0 for ; Wed, 10 Oct 2018 20:55:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98AE72ACFB; Wed, 10 Oct 2018 20:55:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E53422ACF0 for ; Wed, 10 Oct 2018 20:55:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725939AbeJKET1 (ORCPT ); Thu, 11 Oct 2018 00:19:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52230 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbeJKET1 (ORCPT ); Thu, 11 Oct 2018 00:19:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F5FE9091A; Wed, 10 Oct 2018 20:55:34 +0000 (UTC) Received: from Liberator-5.local (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06A3796B98; Wed, 10 Oct 2018 20:55:33 +0000 (UTC) To: linux-xfs Cc: Brian Norris From: Eric Sandeen Subject: [PATCH] xfsprogs: don't include all xfs headers just for crc32 Message-ID: Date: Wed, 10 Oct 2018 15:55:32 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 10 Oct 2018 20:55:34 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Brian Norris reported that "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: [failure to find fsmap.h]" It seems like the most straightforward thing to do here is include a specific set of system headers, instead of pulling in the whole xfs.h header chain which has multiple tests and definitions in place for headers that may or may not be there during the build. Reported-by: Brian Norris Signed-off-by: Eric Sandeen Tested-by: Brian Norris Reviewed-by: Darrick J. Wong --- Brian, here's try #3, does this also work for you? diff --git a/libfrog/crc32.c b/libfrog/crc32.c index 1d52f68..220b33b 100644 --- a/libfrog/crc32.c +++ b/libfrog/crc32.c @@ -29,8 +29,11 @@ * match the hardware acceleration available on Intel CPUs. */ +#include +#include +#include #include "platform_defs.h" -#include "xfs.h" +/* For endian conversion routines */ #include "xfs_arch.h" #include "crc32defs.h"