[D-runtime] Supporting different C libraries and architectures

Johannes Pfau johannespfau at googlemail.com
Mon Feb 27 08:29:22 PST 2012


Am 27.02.2012 11:36, schrieb Iain Buclaw:
> I think that is fine for the structure of the build directories,
> however I feel strongly that they should not be installed in such a
> structure.
>
> To take your example:
>
> druntime
> |-core
> |---atomic.d (generic files)
> |---bitop.d
> |---[...]
> |-gc
> |-gcstub
> |-rt
>
> For the file structure below -  when building for glibc, the make file
> would have -I libdc/glibc in it's DFLAGS (or compile all relevant
> sources in one go) - so libdc/glibc/core/stdc/stdio.d would still be
> declared as  'module core.stdc.stdio;'
>
> When running 'make install' - the build gets the correct sources and
> puts them in their true locations.
>
> |-libdc
> |---glibc
> |-----core      // Installed in /usr/include/d2/core
> |-------sys     // Installed in /usr/include/d2/core/sys
> |-------stdc    // Installed in /usr/include/d2/core/stdc
> |---bionic
> |-----core      // Installed in /usr/include/d2/core
> |-------sys     // Installed in /usr/include/d2/core/sys
> |-------stdc    // Installed in /usr/include/d2/core/stdc
> |---newlib
> |-----core      // Installed in /usr/include/d2/core
> |-------sys     // Installed in /usr/include/d2/core/sys
> |-------stdc    // Installed in /usr/include/d2/core/stdc
>
>
> The idea being that bionic/newlib packages are not shipped with glibc releases.
>
>
> The complexity here would be a minor alternation to the way the
> current build process is done, and will require *no change* in either
> existing user code or how the druntime library is written.
>
>
> Regards
>
That's what I meant when I wrote "compile in the correct directory". 
Sorry, I should have explained that better.

I think this is the best way to do this. I'll create a pull request 
soon, although I'll probably wait till we migrated to git.

BTW: We can actually use submodules to easily merge changes between the 
different C libraries. I set up some test repositories to demonstrate this:
https://github.com/jpf91/test-gdc is the base directory of druntime. It 
has got the
|-libc
|---glibc
|---bionic

structure, but glibc and bionic are submodules. The actual code for 
those is in
https://github.com/jpf91/test-libc and 'bionic' and 'glibc' are linked 
to the matching branches in test-libc.

To checkout:
git clone git://github.com/jpf91/test-gdc.git
git submodule init
git submodule update

-- 
Johannes Pfau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d-runtime/attachments/20120227/1dc7f599/attachment.html>


More information about the D-runtime mailing list