This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: EXTRA_HOST_FLAGS


Nathanael Nerode <neroden@twcny.rr.com> writes:

> Mark Mitchell wrote:
> > Why doesn't EXTRA_GCC_FLAGS simply include EXTRA_HOST_FLAGS?
> > Instead, it seems to copy all of the EXTRA_HOST_FLAGS, except for LD.
> > Is there a reason not to include LD?
> The comments seemed to indicate that there was a reason.  I can't for
> the life of me figure out what it *was* though.

When I wrote EXTRA_GCC_FLAGS it was not the same as EXTRA_HOST_FLAGS.

EXTRA_HOST_FLAGS was for tools built using the host environment.
EXTRA_GCC_FLAGS was for gcc, which used a mixture of host tools and
target tools without clearly distinguishing them.  For example, when I
wrote the code, CC had to be passed as $(CC) (as in EXTRA_HOST_FLAGS)
while AR had to be passed as $(AR_FOR_TARGET) (as in
EXTRA_TARGET_FLAGS).

I probably didn't bother passing LD because the gcc Makefile didn't
use $(LD).  That is, I went through each tool the gcc Makefile
actually used, and passed it accordingly.

All that has changed now.  In particular, the gcc Makefile now uses
$(AR_FOR_TARGET) where it used to use $(AR) (I think this change is
correct).

So I expect that there is no special reason that LD was omitted from
EXTRA_GCC_FLAGS, and I expect that it is perfectly safe to have
EXTRA_GCC_FLAGS simply include EXTRA_HOST_FLAGS.

In fact, the comment for EXTRA_GCC_FLAGS explains this, and is in fact
no longer correct:

# Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
# unfortunately needs the native compiler and the target ar and
# ranlib.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]