From patchwork Wed May 23 06:20:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rink Springer X-Patchwork-Id: 10420265 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 984DA60327 for ; Wed, 23 May 2018 06:27:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85E2028E0C for ; Wed, 23 May 2018 06:27:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A85928E1A; Wed, 23 May 2018 06:27:27 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 54F4928E0C for ; Wed, 23 May 2018 06:27:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754043AbeEWG1Z (ORCPT ); Wed, 23 May 2018 02:27:25 -0400 Received: from mail.zhmu.nl ([37.247.37.64]:10230 "EHLO mail.zhmu.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753989AbeEWG1T (ORCPT ); Wed, 23 May 2018 02:27:19 -0400 X-Greylist: delayed 425 seconds by postgrey-1.27 at vger.kernel.org; Wed, 23 May 2018 02:27:19 EDT Received: from mail.zhmu.nl (mail.zhmu.nl [37.247.37.64]) by mail.zhmu.nl (Postfix) with ESMTP id 3DB5BB56E; Wed, 23 May 2018 08:20:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rink.nu; s=owl; t=1527056413; bh=HXYV43MyBwRjPX+h4nEqzbAemeFat3SZFmca8l2XGgs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=nbXDpT9Ugs09+WeMY0NwTklfUvsK5bR48hUAAP9hNsQJdfAX9I8B4KjDgL4fovtMd iJCkTzE3i/j7sHFKddc0g7pzRQuSn7DNNNcSrOs0EdckRr0Y13URZsMMD2wk56ccos FOHitK/EJ5lA6t4m1CD6++VBtdtYdp0s1Aj+yLGA= X-Virus-Scanned: amavisd-new at zhmu.nl Received: from mail.zhmu.nl ([37.247.37.64]) by mail.zhmu.nl (anathema.codehulu.net [37.247.37.64]) (amavisd-new, port 10024) with ESMTP id ovhkmVsQPwB8; Wed, 23 May 2018 08:20:03 +0200 (CEST) Received: from gloom.zhmu.nl (mail.zhmu.nl [37.247.37.64]) by mail.zhmu.nl (Postfix) with ESMTP id A9668B563; Wed, 23 May 2018 08:20:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rink.nu; s=owl; t=1527056403; bh=HXYV43MyBwRjPX+h4nEqzbAemeFat3SZFmca8l2XGgs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=cchsUrlGwRj27Pbgx6kuj38zf5tC1u5MpwBqrgqHGqGLykaP59mQIV2fWapVMRNu1 aC33TPqxZtJlHK9paIPzSmAWLIkIdRFdIrIxTsR9AsA6KQZ2qqACPcmvFFJAVjJGel gKhnbNQ0cjmc8AUIG30hi5KJJ2FD6yT3I8nrjKz4= Received: by gloom.zhmu.nl (Postfix, from userid 1000) id 940E71FD941; Wed, 23 May 2018 08:20:03 +0200 (CEST) Date: Wed, 23 May 2018 08:20:03 +0200 From: Rink Springer To: Baruch Siach Cc: dash@vger.kernel.org, Peter Korsgaard Subject: Re: [PATCH] Don't include config.h for native helpers Message-ID: <20180523062003.GH2816@rink.nu> References: <359646bbed23a3f01a5b726e8b1b5c83feaa27da.1527004627.git.baruch@tkos.co.il> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <359646bbed23a3f01a5b726e8b1b5c83feaa27da.1527004627.git.baruch@tkos.co.il> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: dash-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, May 22, 2018 at 06:57:07PM +0300, Baruch Siach wrote: > 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) I seem to recall that I encountered the same problem when cross-building dash; however, I fixed it in a different way: I am unsure what is the best solution here. Regards, Rink --- To unsubscribe from this list: send the line "unsubscribe dash" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/Makefile.am b/src/Makefile.am index 139355e..ed18844 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,7 +12,7 @@ AM_CFLAGS_FOR_BUILD = -g -O2 $(COMMON_CFLAGS) AM_CPPFLAGS_FOR_BUILD = $(COMMON_CPPFLAGS) COMPILE_FOR_BUILD = \ - $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS_FOR_BUILD) \ + $(CC_FOR_BUILD) $(DEFAULT_INCLUDES) \ $(CPPFLAGS_FOR_BUILD) \ $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)