From patchwork Tue May 22 15:57:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 10419017 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2BCA26053B for ; Tue, 22 May 2018 15:57:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CCE828D19 for ; Tue, 22 May 2018 15:57:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 112D628D55; Tue, 22 May 2018 15:57:31 +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 CFB0F28D19 for ; Tue, 22 May 2018 15:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbeEVP53 (ORCPT ); Tue, 22 May 2018 11:57:29 -0400 Received: from guitar.tcltek.co.il ([192.115.133.116]:33486 "EHLO mx.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbeEVP52 (ORCPT ); Tue, 22 May 2018 11:57:28 -0400 Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPSA id 4BCB34402B3; Tue, 22 May 2018 18:57:25 +0300 (IDT) From: Baruch Siach To: dash@vger.kernel.org Cc: Peter Korsgaard , Baruch Siach Subject: [PATCH] Don't include config.h for native helpers Date: Tue, 22 May 2018 18:57:07 +0300 Message-Id: <359646bbed23a3f01a5b726e8b1b5c83feaa27da.1527004627.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Sender: dash-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Korsgaard config.h contains settings for the cross compiler (most importantly 32/64bit versions of functions), so don't include it when calling the native compiler to build the helpers. Otherwise we get build errors like: /usr/bin/gcc -include ../config.h -DBSD=1 -DSHELL -DIFS_BROKEN -g -O2 -Wall -o mkinit mkinit.c In file included from /usr/include/sys/stat.h:107, from /usr/include/fcntl.h:38, from mkinit.c:50: /usr/include/bits/stat.h:117: error: redefinition of ‘struct stat’ In file included from /usr/include/fcntl.h:38, from mkinit.c:50: /usr/include/sys/stat.h:504: error: redefinition of ‘stat’ /usr/include/sys/stat.h:455: note: previous definition of ‘stat’ was here Signed-off-by: Peter Korsgaard [baruch: apply to Makefile.am; update Peter's email address] Signed-off-by: Baruch Siach --- src/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 139355e5b7e9..55780f4689da 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,12 +2,11 @@ AM_YFLAGS = -d COMMON_CFLAGS = -Wall COMMON_CPPFLAGS = \ - -include $(top_builddir)/config.h \ -DBSD=1 -DSHELL \ -DIFS_BROKEN AM_CFLAGS = $(COMMON_CFLAGS) -AM_CPPFLAGS = $(COMMON_CPPFLAGS) +AM_CPPFLAGS = -include $(top_builddir)/config.h $(COMMON_CPPFLAGS) AM_CFLAGS_FOR_BUILD = -g -O2 $(COMMON_CFLAGS) AM_CPPFLAGS_FOR_BUILD = $(COMMON_CPPFLAGS)