phobos and sysroots

Johannes Pfau nospam at example.com
Sun May 12 06:23:45 PDT 2013


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)


More information about the D.gnu mailing list