www.digitalmars.com         C & C++   DMDScript  

D.gnu - phobos and sysroots

reply Johannes Pfau <nospam example.com> writes:
I noticed that we do not have any sysroot handling in gdc yet.

If gcc is build with --with-sysroot=SYSROOT certain libraries &
headers are not installed in PREFIX/lib but in SYSROOT/lib. At runtime
it is then possible to use the --sysroot=NEWPATH switch and the compiler
will then look for includes & library files in NEWPATH/ instead of in
SYSROOT/. This is often used for cross compilers so you can have one
compiler targeting different systems (for example with different libc
versions) by using different sysroots.

The question here is mainly whether we want phobos & druntime to be
installed in the sysroot or whether we should treat them as belonging
to the compiler and always use the same, shipped libphobos, even if the
--sysroot switch is used.

Right now we have some weird hybrid form: The libraries are in the
sysroot (x86_64-gdcproject-linux-gnu/sysroot/lib) but the includes are
not
(x86_64-gdcproject-linux-gnu/lib/gcc/x86_64-gdcproject-linux-gnu/4.7.2/include/d2)
May 12 2013
next sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
--047d7bf0de888e5a4d04dc865b7b
Content-Type: text/plain; charset=ISO-8859-1

On 12 May 2013 14:23, Johannes Pfau <nospam example.com> wrote:

 I noticed that we do not have any sysroot handling in gdc yet.

 If gcc is build with --with-sysroot=SYSROOT certain libraries &
 headers are not installed in PREFIX/lib but in SYSROOT/lib. At runtime
 it is then possible to use the --sysroot=NEWPATH switch and the compiler
 will then look for includes & library files in NEWPATH/ instead of in
 SYSROOT/. This is often used for cross compilers so you can have one
 compiler targeting different systems (for example with different libc
 versions) by using different sysroots.

 The question here is mainly whether we want phobos & druntime to be
 installed in the sysroot or whether we should treat them as belonging
 to the compiler and always use the same, shipped libphobos, even if the
 --sysroot switch is used.

 Right now we have some weird hybrid form: The libraries are in the
 sysroot (x86_64-gdcproject-linux-gnu/sysroot/lib) but the includes are
 not

 (x86_64-gdcproject-linux-gnu/lib/gcc/x86_64-gdcproject-linux-gnu/4.7.2/include/d2)

I think there's nothing wrong with the rationale, they're shipped with the compiler, so they belong to the compiler. Another missing configure switch is: --with-gdc-include-dir Also need to remove the logic in Make-lang.in that decides on where phobos/druntime will be. It should all be configured. -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; --047d7bf0de888e5a4d04dc865b7b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 1= 2 May 2013 14:23, Johannes Pfau <span dir=3D"ltr">&lt;<a href=3D"mailto:nos= pam example.com" target=3D"_blank">nospam example.com</a>&gt;</span> wrote:= <br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor= der-left:1px solid rgb(204,204,204);padding-left:1ex"> I noticed that we do not have any sysroot handling in gdc yet.<br> <br> If gcc is build with --with-sysroot=3DSYSROOT certain libraries &amp;<br> headers are not installed in PREFIX/lib but in SYSROOT/lib. At runtime<br> it is then possible to use the --sysroot=3DNEWPATH switch and the compiler<= br> will then look for includes &amp; library files in NEWPATH/ instead of in<b= r> SYSROOT/. This is often used for cross compilers so you can have one<br> compiler targeting different systems (for example with different libc<br> versions) by using different sysroots.<br> <br> The question here is mainly whether we want phobos &amp; druntime to be<br> installed in the sysroot or whether we should treat them as belonging<br> to the compiler and always use the same, shipped libphobos, even if the<br> --sysroot switch is used.<br> <br> Right now we have some weird hybrid form: The libraries are in the<br> sysroot (x86_64-gdcproject-linux-gnu/sysroot/lib) but the includes are<br> not<br> (x86_64-gdcproject-linux-gnu/lib/gcc/x86_64-gdcproject-linux-gnu/4.7.2/incl= ude/d2)<br> </blockquote></div><br></div><div class=3D"gmail_extra">I think there&#39;s= nothing wrong with the rationale, they&#39;re shipped with the compiler, s= o they belong to the compiler.<br><br></div><div class=3D"gmail_extra">Anot= her missing configure switch is: --with-gdc-include-dir<br> <br></div><div class=3D"gmail_extra">Also need to remove the logic in Make-= lang.in that decides on where phobos/druntime will be.=A0 It should all be = configured.<br clear=3D"all"></div><div class=3D"gmail_extra"><br>-- <br>Ia= in Buclaw<br> <br>*(p &lt; e ? p++ : p) =3D (c &amp; 0x0f) + &#39;0&#39;; </div></div> --047d7bf0de888e5a4d04dc865b7b--
May 12 2013
prev sibling parent Johannes Pfau <nospam example.com> writes:
Am Sun, 12 May 2013 15:38:46 +0100
schrieb Iain Buclaw <ibuclaw ubuntu.com>:

 On 12 May 2013 14:23, Johannes Pfau <nospam example.com> wrote:
 
 I noticed that we do not have any sysroot handling in gdc yet.

 If gcc is build with --with-sysroot=SYSROOT certain libraries &
 headers are not installed in PREFIX/lib but in SYSROOT/lib. At
 runtime it is then possible to use the --sysroot=NEWPATH switch and
 the compiler will then look for includes & library files in
 NEWPATH/ instead of in SYSROOT/. This is often used for cross
 compilers so you can have one compiler targeting different systems
 (for example with different libc versions) by using different
 sysroots.

 The question here is mainly whether we want phobos & druntime to be
 installed in the sysroot or whether we should treat them as
 belonging to the compiler and always use the same, shipped
 libphobos, even if the --sysroot switch is used.

 Right now we have some weird hybrid form: The libraries are in the
 sysroot (x86_64-gdcproject-linux-gnu/sysroot/lib) but the includes
 are not

 (x86_64-gdcproject-linux-gnu/lib/gcc/x86_64-gdcproject-linux-gnu/4.7.2/include/d2)

I think there's nothing wrong with the rationale, they're shipped with the compiler, so they belong to the compiler. Another missing configure switch is: --with-gdc-include-dir Also need to remove the logic in Make-lang.in that decides on where phobos/druntime will be. It should all be configured.

OK, then we don't have to do anything special for sysroot support as long as we don't have default system includes (like gcc always looks for C headers in {SYSROOT}?/usr/include and {SYSROOT}?/usr/local/include).
May 12 2013