From: David Aguilar <davvid@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Fredrik Kuivinen <frekui@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] Makefile: Improve compiler header dependency check
Date: Sat, 27 Aug 2011 14:19:59 -0700 [thread overview]
Message-ID: <20110827211958.GA45286@gmail.com> (raw)
In-Reply-To: <20110827162645.GA10476@elie.gateway.2wire.net>
On Sat, Aug 27, 2011 at 11:26:54AM -0500, Jonathan Nieder wrote:
> David Aguilar wrote:
>
> > I fired up git's next branch on a mac laptop where I
> > have a config.mak that builds universal git binaries:
> >
> > CFLAGS = -arch i386 -arch x86_64
> >
> > This configuration broke when 111ee18c31f9bac9436426399355facc79238566
> > was merged into next.
>
> Good catch; thanks. This information would be useful for the commit
> message.
>
> > gcc cannot generate header dependencies when
> > multiple -arch statements are used
>
> Sounds like a bug. Any idea why it behaves that way? What error message
> does it write?
>
> If it is a bug, it might be worth reporting this to the gcc devs while
> at it.
This has been the behavior for as long as I can remember.
I don't think it's a bug. I included the error message
in the commit message for [PATCH v2]:
gcc-4.2: -E, -S, -save-temps and -M options are
not allowed with multiple -arch flags
I don't think it's a gcc bug. This is just another one of
those annoying mac-isms. When building against multiple archs
gcc will include a different set of headers for each arch
which is likely why the gcc devs do not support it.
I sent a v2 version of the patch that uses $(SHELL_PATH)
and omits $(EXTRA_CPPFLAGS).
I think the ideal situation would be for the dependency
check to emit headers required across all architectures
but that's not how it works. Perhaps there are some
internal architectural limitations in gcc that prevent
it from being done that way.
My experience has been that most projects DTRT when CFLAGS
is configured this way. It's always one or two that require
intrusive Makefile or libtool hacks to make them build
universal and those are no fun ;-)
BTW after applying this patch I immediately ran into the
compat/obstack.[ch] portability problem that I responded
to in another thread. I was finally able to make git
build with the patch that I included inline there but
I think it still needs work. I'll keep an eye on that
thread so that we can get a final patch for it.
I also noticed that a few of our compat/ files have
gcc/autoconf-isms such as:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Should I clean these up? They seem unnecessary.
--
David
prev parent reply other threads:[~2011-08-27 21:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-27 8:41 [PATCH] Makefile: Improve compiler header dependency check David Aguilar
2011-08-27 16:26 ` Jonathan Nieder
2011-08-27 21:00 ` [PATCH v2] " David Aguilar
2011-08-28 11:47 ` Fredrik Kuivinen
2011-08-30 4:05 ` Jonathan Nieder
2011-08-30 8:27 ` [PATCH v3] " David Aguilar
2011-08-30 8:33 ` Jonathan Nieder
2011-08-30 17:17 ` Junio C Hamano
2011-08-27 21:19 ` David Aguilar [this message]
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=20110827211958.GA45286@gmail.com \
--to=davvid@gmail.com \
--cc=frekui@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).