All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leif Lindholm <leif@nuviainc.com>
To: Daniel Kiper <daniel.kiper@oracle.com>
Cc: grub-devel@gnu.org, eschwartz@archlinux.org, floppym@gentoo.org,
	javierm@redhat.com, olaf@aepfle.de, phcoder@gmail.com,
	pjones@redhat.com
Subject: Re: [PATCH v2 3/4] INSTALL/configure: Update install doc and configure comment
Date: Thu, 30 Apr 2020 12:40:21 +0100	[thread overview]
Message-ID: <20200430114021.GR21486@vanye> (raw)
In-Reply-To: <20200421145525.d5pjzxewgiyxplgo@tomti.i.net-space.pl>

On Tue, Apr 21, 2020 at 16:55:25 +0200, Daniel Kiper wrote:
> > > > >  You need to use following options to specify tools and platforms. For minimum
> > > > >  version look at prerequisites. All tools not mentioned in this section under
> > > > > @@ -182,28 +182,31 @@ corresponding platform are not needed for the platform in question.
> > > > >
> > > > >    - For host
> > > > >      1. --host= to autoconf name of host.
> > > > > -    2. CC= for gcc able to compile for host
> > > > > -    3. HOST_CFLAGS= for C options for host.
> > > > > -    4. HOST_CPPFLAGS= for C preprocessor options for host.
> > > > > -    5. HOST_LDFLAGS= for linker options for host.
> > > > > -    6. PKG_CONFIG= for pkg-config for host (optional).
> > > > > -    7. Libdevmapper if any must be in standard linker folders (-ldevmapper) (optional).
> > > > > -    8. Libfuse if any must be in standard linker folders (-lfuse) (optional).
> > > > > -    9. Libzfs if any must be in standard linker folders (-lzfs) (optional).
> > > > > -    10. Liblzma if any must be in standard linker folders (-llzma) (optional).
> > > > > +    2. CC= for gcc able to compile for host and target.
> > > >
> > > > But this is incorrect? Apart from where HOST == TARGET? And goes
> > > > against the example updated above.
> > > > Am I missing something?
> > >
> > > It is correct, CC applies for host and target...
> >
> > So why do we have TARGET_CC and HOST_CC?
> >
> > My understanding is:
> > - CC sets the default compilet binary, used for BUILD, HOST and TARGET
> >   unless overridden for each of these.
> 
> Nope, just HOST_CC and TARGET_CC. You can override CC using TARGET_CC and
> HOST_CC respectively. Order in configure command line does not matter.

I wasn't suggesting command line order mattered.

> > - The value of BUILD_CC is used as default for HOST_CC unless
> >   HOST_CC is explicitly specified.
> 
> Nope, it is not.
> 
> > - The value of HOST_CC is used as the default for TARGET_CC, where *it*
> >   is not explicitly specified.
> 
> Nope, it is not.
> 
> > Either my understanding here is incorrect, or these changes make the
> > text more rather than less misleading.
> 
> Sorry but I am not sure what is unclear after my changes.

OK, I concede configure.ac completely ignores the value of CC for
setting BUILD_CC. It tests for a hard-wired set of commands (which
seems weird to me, but some googling suggests that is indeed default
behaviour - I guess overriding the BUILD_ toolchain is the *least*
common use case).

But let me rewind:

configure scripts support separate concepts of BUILD, HOST and TARGET
to permit things like cross-compiling a tool on an AMD64 box (BUILD) to
run on an armhf box (HOST) to generate images to run on SPARC
(TARGET).

CC is traditionally used to override just using the first "gcc"
command to find a (apparently HOST_) toolchain.

But if I set both HOST_ and TARGET_ options for my build, I expect the
target to be built using the TARGET_ toolchain. If I specify CC and
TARGET_CC, I expect the target to be built with TARGET_CC. Which is
thankfully also what happens in reality.

However, the proposed change now says that HOST_CC sets the host and
target compiler and that TARGET_CC sets the target compiler. This is
not even self-consistent.

I get what the change is trying to say, but I feel it is only adding
confusion. I think the same thing could be adequately conveyed by
adding something along the lines of:
"If no target options are given, these will default to be the same as
the host options."
immediately below the - "For target" line

I don't think adding description of CC/CFLAGS to target section
improves clarity. If CFLAGS should be separately speficied, I think
that makes more sense next to HOST_CFLAGS.

And I think if we're changing this, we should add an entry for HOST_CC
- or add that to the existing CC option.

Regards,

Leif


  reply	other threads:[~2020-04-30 11:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 12:44 [PATCH v2 0/4] Various build and doc fixes Daniel Kiper
2020-04-03 12:45 ` [PATCH v2 1/4] configure: Drop unneeded TARGET_CFLAGS expansion Daniel Kiper
2020-04-03 13:36   ` John Paul Adrian Glaubitz
2020-04-07  9:24   ` Javier Martinez Canillas
2020-04-03 12:45 ` [PATCH v2 2/4] configure: Enforce gnu99 C language standard Daniel Kiper
2020-04-07  9:38   ` Javier Martinez Canillas
2020-04-07 10:41     ` Daniel Kiper
2020-04-07 11:23       ` Leif Lindholm
2020-04-07 11:37       ` Javier Martinez Canillas
2020-04-07 10:52   ` Leif Lindholm
2020-04-03 12:45 ` [PATCH v2 3/4] INSTALL/configure: Update install doc and configure comment Daniel Kiper
2020-04-07  9:43   ` Javier Martinez Canillas
2020-04-07 11:16   ` Leif Lindholm
2020-04-10 12:05     ` Daniel Kiper
2020-04-20 13:04       ` Leif Lindholm
2020-04-21 14:55         ` Daniel Kiper
2020-04-30 11:40           ` Leif Lindholm [this message]
2020-04-03 12:45 ` [PATCH v2 4/4] autogen: Replace -iname with -ipath in find command Daniel Kiper
2020-04-07  9:44   ` Javier Martinez Canillas

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=20200430114021.GR21486@vanye \
    --to=leif@nuviainc.com \
    --cc=daniel.kiper@oracle.com \
    --cc=eschwartz@archlinux.org \
    --cc=floppym@gentoo.org \
    --cc=grub-devel@gnu.org \
    --cc=javierm@redhat.com \
    --cc=olaf@aepfle.de \
    --cc=phcoder@gmail.com \
    --cc=pjones@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.