public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@wdc.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, libffi-discuss@sourceware.org,
	    golang-dev@googlegroups.com, zlib@gzip.org
Subject: Re: [PATCH v2] Add `--with-install-sysroot=' configuration option
Date: Thu, 28 Nov 2019 20:45:00 -0000	[thread overview]
Message-ID: <alpine.LFD.2.21.1911272204140.13542@redsun52.ssa.fujisawa.hgst.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1911222345550.28545@digraph.polyomino.org.uk>

On Fri, 22 Nov 2019, Joseph Myers wrote:

> >  As I recall the MIPS sysroot setup (please correct me if I got something 
> > wrong here) was like:
> 
> Yes, that's the sort of layout you get with sysroot suffixes.  See 
> gcc/config/mips/{st.h,t-st} for an example.

 Thanks for the pointer.

> >  Then the right-hand side of /path/to/somewhere (except for usr/) is what 
> > gets printed by `-print-multi-directory' or the left-hand side of output 
> > from `-print-multi-lib', e.g. `sof/el/lib64' for the example above.  
> 
> Rather, it's a suffix (as in SYSROOT_SUFFIX_SPEC, no command-line option 
> to print it),

 Do you mean that there's no option to print SYSROOT_SUFFIX_SPEC on its 
own or that no option prints it as a path component?  If the latter, then 
I think it's an awful shortcoming, because there's no reasonable way for 
a given GCC compilation to determine the layout expected.

> >  Well, I agree we need to have this stuff documented beyond what we 
> > currently have, but I think it applies equally to all the sysroot options 
> > we have, including both the `--sysroot=' GCC driver's option, and the 
> > `--with-sysroot=', `--with-build-sysroot=' and the newly-proposed 
> 
> All three of those refer to the top-level sysroot path, to which a sysroot 
> suffix is appended based on SYSROOT_SUFFIX_SPEC (unless 
> --no-sysroot-suffix is used).
> 
> > `--with-install-sysroot=' `configure' script's options as well.  All we 
> > currently have is this paragraph:
> 
> But this is a path relative to which SYSROOT_SUFFIX_SPEC isn't used at 
> all.

 Can you please show me the two directory layouts, one for `--sysroot=' 
and the other for `--with-install-sysroot=' aka $toolexeclibdir, say for 
the `mips64el-st-linux-gnu' target, and where exactly in GCC installation 
(if anywhere) the `--sysroot=' layout is used?

 Is it that with $toolexeclibdir we have say:

/usr/mips64el-st-linux-gnu/
                          +-> lib/
                          |      +-> 2e/
                          |      \-> 2f/
                          +-> lib32/
                          |        +-> 2e/
                          |        \-> 2f/
                          \-> lib64/
                                   +-> 2e/
                                   \-> 2f/

whereas `--sysroot=/path/to/sysroot' expects:

/path/to/sysroot/
                +-> 2e/
                |     +-> lib/
                |     +-> lib32/
                |     \-> lib64/
                \-> 2f/
                      +-> lib/
                      +-> lib32/
                      \-> lib64/

(and then GCC applies the former scheme to the directories pointed to by 
the `-B' and `-L' options and the latter scheme to the directory pointed 
to by the `--sysroot=' option)?

> >  And last but not least: do we want to hold my proposed change hostage to 
> > a sysroot handling documentation improvement?  It does not appear fair to 
> > me as the situation with said documentation is not a new problem nor one 
> > specific to this newly-added option, and the new option merely played the 
> 
> The proposed new option is, as far as I know, the first one introducing 
> this new kind of sysroot option (one for which the suffix from 
> SYSROOT_SUFFIX_SPEC is never added).

 Thank you for all your input.

 If my understanding as expressed above is correct, then I think the way 
to move forward with this change will be to rename the option to 
`--with-toolexeclibdir=' or suchlike (and adjust documentation 
accordingly) so that it avoids the ambiguity of "sysroot" and is in line 
with the usual `--bindir=', `--libdir=', etc. or less usual 
`--with-slibdir=' options where people can adjust the various installation 
directories according to their requirements or preferences.

 Then on top of this an option like `--enable-sysroot-for-toolexeclibdir' 
can be discussed in the future, that would switch $toolexeclibdir to the 
proper sysroot layout, whether `--with-toolexeclibdir=' has been used or 
not.  Such an option will necessarily have to rely on the presence of a 
GCC option to print SYSROOT_SUFFIX_SPEC/STARTFILE_PREFIX_SPEC for the 
multilib selected.

 If we agree on this plan, I'll post an update patch.

  Maciej

  reply	other threads:[~2019-11-28 20:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14  2:47 [PATCH] " Maciej W. Rozycki
2019-11-14  3:06 ` Joseph Myers
2019-11-18  2:04   ` [PATCH v2] " Maciej W. Rozycki
2019-11-19  0:11     ` Joseph Myers
2019-11-20  2:39       ` Maciej W. Rozycki
2019-11-20 17:46         ` Joseph Myers
2019-11-22 23:41           ` Maciej W. Rozycki
2019-11-22 23:54             ` Joseph Myers
2019-11-28 20:45               ` Maciej W. Rozycki [this message]
2019-11-28 21:06                 ` Joseph Myers

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=alpine.LFD.2.21.1911272204140.13542@redsun52.ssa.fujisawa.hgst.com \
    --to=macro@wdc.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=golang-dev@googlegroups.com \
    --cc=joseph@codesourcery.com \
    --cc=libffi-discuss@sourceware.org \
    --cc=zlib@gzip.org \
    /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).