This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] Add `--with-install-sysroot=' configuration option
- From: "Maciej W. Rozycki" <macro at wdc dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libffi-discuss at sourceware dot org, golang-dev at googlegroups dot com, zlib at gzip dot org
- Date: Wed, 20 Nov 2019 02:39:10 +0000 (GMT)
- Subject: Re: [PATCH v2] Add `--with-install-sysroot=' configuration option
- Ironport-sdr: y1JePSNxcLsi/L6Ma3CTp4tgcz3q8ZdaOS4IvGgdwFnmBGdFPuZAYS+cagoHCeM2XMx5cbWewK dZLn0aRVCooa5NYMB6PF027v5y9ZibZgmqB4s29uEnH8kD7caFcwAfxsyqnV7n/l/4M3kMrVf8 YuOGcP1E7tZ5huOaqTni7DZa3WUA9pdWrI6m1fmU9MmYGzqJKrvhcDpkLrZwsCYB1EvoaY5StR TyUHh9fynQvvR04n27E0OO7pxrnhJIoP+0Nbv7EBJdWKtnUHuDfbL5Q/0KT//ZqqnoMNgadmnL n2Q=
- Ironport-sdr: uW/wtDbtTbnVIX2N4ZzaWVXSb0eHahstK9I/9keX2MMgKQNOtvWEPaEMY1fnHZd+WKpYWDwkuB qJ3l45mcZrSmUbQpDOyn47gT9n955Tj28+/ChGA7wmMX6s5yL3VJIQMNR8nMp5mQfhpx/dPhnU tIpqdegB52Is7loaXAzLmR/4P1GwMj0lrTIJoxkrYv7fNK+dvkIQuncb40RMl4CV/4p6E0vl01 jR6m+FUat//as5S2OKVCS2YbT2CkeCZPrBxyfZkGC80ou+0yFo2XV2AqIGqzQwc+KbeK9FiEmP vU7+IvyrbIEVKj2bpo+kMs5r
- Ironport-sdr: soB0KTrKPGzl2XS9rPYISb6S3U7aDYVo7u11iAlGq9erxRvu410UYV5DAopNZuWRKKHjpHe4hs R0Yg3EsZ6e7u9fHeLTqdr58x1u8jDLhT3J1wEoIkn2hsAK6xbHcCk1lS61B/TtDsiQsVCRGR59 2E5oTnNR71DAGJLsjQFTRKhF2fzN3yO4tMKSDYCH+g47f9N4HIoHnElQyo10yT4+jibQwMv8+q 6PXotr7JkNguPhv4IwqhVo8cyBAKkYb+VsTvmKYLsnKSs5RSElds9Q9lLa9tjjULkNPGjD4Wb2 LfE=
- References: <alpine.LFD.2.21.1911140024080.13542@redsun52.ssa.fujisawa.hgst.com> <alpine.DEB.2.21.1911140257160.24245@digraph.polyomino.org.uk> <alpine.LFD.2.21.1911152209190.13542@redsun52.ssa.fujisawa.hgst.com> <alpine.DEB.2.21.1911190003210.23687@digraph.polyomino.org.uk>
- Wdcironportexception: Internal
On Tue, 19 Nov 2019, Joseph Myers wrote:
> > > 4. How does this interact with sysroot suffixes (again, this should be
> > > made clear in the documentation)?
> >
> > There is no interaction, the patch merely changes where the libraries are
> > installed. If the installation sysroot directory chosen is not one known
> > by the GCC driver, then the newly-installed target libraries won't be
> > automatically used (that of course can be changed with the appropriate use
> > of the `-B', `-L' and `--sysroot=' driver options).
>
> Perhaps the "sysroot" phrasing of the option name is confusing.
>
> The documentation in install.texi says "@var{dir} rather than
> @option{$@{gcc_tooldir@}/lib}". If that means, for example, that when
> "-print-multi-os-directory" prints "../lib64" the libraries are installed
> in $dir/../lib64 (so you'd pass --with-install-sysroot=/some/where/lib
> rather than --with-install-sysroot=/some/where), it's definitely not a
> sysroot. If in fact $dir/lib/../lib64 would be used, the documentation
> should say so.
Documentation thinko here, thanks for your meticulousness! Indeed that
has to read "@option{$@{gcc_tooldir@}}" as per example code:
case ${with_install_sysroot} in
no)
toolexeclibdir='$(toolexecdir)/lib'
;;
*)
toolexeclibdir=${with_install_sysroot}/lib
;;
esac
where "@var{dir}" does get interpreted as a sysroot (as was also
previously shown by my use example).
> But even then, if you configure GCC using "--with-sysroot" or
> "--with-build-sysroot", both of those paths are the top-level sysroot, to
> which the sysroot suffix gets appended before GCC uses it for any purpose,
> unless you explicitly build using --no-sysroot-suffix. So I still think
> it's natural for a user of GCC's configure scripts to expect the new
> option, like the other sysroot-related configure options, also to be one
> to which the per-multilib sysroot suffix gets appended before GCC uses it.
> And if it's not like that, the documentation needs to say so explicitly.
Thanks for your concern, however again, AFAICT this change is tangential
to any sysroot suffix, which necessarily has to be already included in the
multilib OS directory as given by `-print-multi-os-directory', so that it
gets embedded within $toolexeclibdir for the purpose of target library
installation across the relevant subdirs, as per this excerpt from
`configure' code right after the assignments quoted in the example above:
multi_os_directory=`$CC -print-multi-os-directory`
case $multi_os_directory in
.) ;; # Avoid trailing /.
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
esac
or otherwise the existing arrangement where
toolexeclibdir='$(toolexecdir)/lib' wouldn't have worked either (and
neither would in the native case where toolexeclibdir='$(libdir)').
Does this answer clear your concern? OK to apply with the documentation
thinko fixed?
Maciej