From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: hans-peter.nilsson@axis.com (Hans-Peter Nilsson)
Cc: law@redhat.com, gcc-patches@gcc.gnu.org
Subject: Re: [RFA 1/2]: Don't ignore target_header_dir when deciding inhibit_libc
Date: Thu, 08 Oct 2015 16:52:00 -0000 [thread overview]
Message-ID: <20151008165222.F21F2DAD@oc7340732750.ibm.com> (raw)
In-Reply-To: <201510071718.t97HIWRq004273@ignucius.se.axis.com> from "Hans-Peter Nilsson" at Oct 07, 2015 07:18:32 PM
Hans-Peter Nilsson wrote:
> Let me ask you right back: after an installation, should
> installation of a newer gcc *not* automatically pick up the
> header files installed (copied to sys-include) by the previous
> installation when using the same prefix, *without* any
> --with-headers specified in the new configury?
I'm not using sys-include, so I don't really have a strong
opinion on this setup. However, I found this in the docs:
@item --with-headers
@itemx --with-headers=@var{dir}
Deprecated in favor of @option{--with-sysroot}.
Specifies that target headers are available when building a cross compiler.
The @var{dir} argument specifies a directory which has the target include
files. These include files will be copied into the @file{gcc} install
directory. @emph{This option with the @var{dir} argument is required} when
building a cross compiler, if @file{@var{prefix}/@var{target}/sys-include}
doesn't pre-exist. If @file{@var{prefix}/@var{target}/sys-include} does
pre-exist, the @var{dir} argument may be omitted. @command{fixincludes}
will be run on these files to make them compatible with GCC@.
@item --without-headers
Tells GCC not use any target headers from a libc when building a cross
compiler. When crossing to GNU/Linux, you need the headers so GCC
can build the exception handling for libgcc.
This seems to imply to me that --with-headers without any <dir> argument
is supposed to use the pre-existing sys-include directory.
The docs are somewhat silent on what exactly the complete absence of
both --with-headers and --without-headers means.
One potential interpretation might be:
--with-headers=<dir> Copy headers from <dir> to sys-include
--with-headers Use existing sys-include directory
<nothing> Use headers from prefix include directory
--without-headers Do not use any headers
which would at least make it clear that if you want sys-include,
you need to specify --with-headers ...
Another potential interpretation might be:
--with-headers=<dir> Copy headers from <dir> to sys-include
--with-headers Use existing sys-include directory
<nothing> Same as --with-headers
--without-headers Do not use any headers
which simplifies the option space, and makes --with/out-headers
match the behavior of other --with/out- options. It would basically
require use of sys-include for cross-compilers (which the docs could
be read to imply anyway, already).
> > So I wondering: what is your current setup? What headers do you have
> > in sys-include, and how did they get there?
>
> In the setup we're talking about, they're all in sys-include,
> copied "manually" before anything else (IIUC just like what
> would happen if I had the headers elsewhere and specified a
> --with-headers=<path>).
OK, I see.
> > I'm aware of the copying
> > done when using --with-headers=<dir>, but this case should still work,
> > since $target_header_dir is set directly to <dir> in this case anyway.
>
> Eh... I'm easily confused. Let me recap my understanding: now,
> with --with-headers=<path>, we copy from <dir> to sys-include
> and still look in (where "look in" means target_header_dir is
> set to and gcc configury inspects) <dir> at configury-time and
> the built gcc will look in include *and* sys-include. Without
> --with-headers (at all), configury looks in sys-include. With
> --with-headers (=yes) things are (currently as well as before,
> just not as exposed) broken; we try and look in "yes".
>
> The recentish (it's only been a year :) exposure being that
> inhibit_libc is *also* activated, as configury sanity-check
> can't find a basic header file. That sanity-check itself *is*
> sane; gcc header inspection should be able to find whatever
> headers are specified or the default; it's just that the value
> is broken. I think it's wrong to be ok that the current header
> tests don't matter for your target.
Agreed with everything here so far.
> So, ISTM we should change --with-headers (=yes) to either look
> in sys-include or in include. Setting it to sys-include
> wouldn't help you or anyone else as it's already the default...
On the other hand, the current docs appear to imply that the
intent was for --with-headers (=yes) to look into a pre-existing
sys-include directory for headers.
> > Is there some *other* case, where you do not use --with-headers=<dir>,
> > but still have a pre-existing sys-include directory in the prefix?
>
> (Eh, other than pre-existing?) Headers are pre-installed in
> sys-include. No --with-headers options. GCC looks in
> sys-include by default, both at configury-time and when built.
> Me happy.
>
> To wit, I think having with_headers=yes (i.e. not a path) have
> the effect of setting target_header_dir to include instead of
> sys-include would be the least evil, least unexpected change,
> that would work for most, including you.
>
> I wouldn't understand to instead change things around and make
> "include" be inspected by default. It's only the --with-headers
> option that's broken.
So this would be:
--with-headers=<dir> Copy headers from <dir> to sys-include
--with-headers Use headers from prefix include directory
<nothing> Use existing sys-include directory
--without-headers Do not use any headers
I agree that this is the smallest change to current behavior;
on the other hand, it seems quite odd overall (i.e. hardest to
explain to someone unfamiliar with current behavior). At the
very least, the docs would have to be adapted.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2015-10-08 16:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 21:40 Hans-Peter Nilsson
2014-09-12 17:50 ` Ping: " Hans-Peter Nilsson
2014-09-19 6:25 ` Jeff Law
2014-09-23 21:21 ` Thomas Schwinge
2014-09-23 22:30 ` Hans-Peter Nilsson
2015-10-06 14:04 ` Ulrich Weigand
2015-10-06 14:44 ` Hans-Peter Nilsson
2015-10-06 15:25 ` Ulrich Weigand
2015-10-06 16:31 ` Hans-Peter Nilsson
2015-10-06 16:56 ` Ulrich Weigand
2015-10-06 17:28 ` Hans-Peter Nilsson
2015-10-07 15:32 ` Ulrich Weigand
2015-10-07 17:18 ` Hans-Peter Nilsson
2015-10-08 16:52 ` Ulrich Weigand [this message]
2015-10-09 2:34 ` Hans-Peter Nilsson
2015-10-12 9:58 ` Ulrich Weigand
2015-10-12 10:58 ` Hans-Peter Nilsson
2015-10-23 11:54 ` Bernd Schmidt
2016-03-17 16:35 ` Andre Vieira (lists)
2016-03-30 16:14 ` [arm-embedded]: " Andre Vieira (lists)
2016-04-07 9:31 ` [RFA 1/2]: " Andre Vieira (lists)
2016-05-25 19:37 ` Andre Vieira (lists)
2016-05-27 16:31 ` Ulrich Weigand
2016-09-09 15:04 ` [GCC-6][RFA " Andre Vieira (lists)
2016-10-17 16:05 ` Andre Vieira (lists)
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=20151008165222.F21F2DAD@oc7340732750.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hans-peter.nilsson@axis.com \
--cc=law@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 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 read-only IMAP folder(s) and NNTP newsgroup(s).