According to changelog since 2.052 Digital Mars D compiler supports compilation for 64bit platform. Reproducible: Always http://www.digitalmars.com/d/2.0/changelog.html
Created attachment 262993 [details, diff] minor fixes to compile phobos2
Created attachment 262995 [details, diff] 32/64 bit selection in makefiles of libraries Cahnges required for compilation of phobos2 and druntime for 32bit and 64bit platforms.
Created attachment 262997 [details] ebuild with amd64/multilib support This ebuild is based on dev-lang/dmd-bin-2.008-r1 (files/25dmd should be available), but adds rebuilding druntime (will be part of phobos2 as I understand) before rebuilding phobos2. This change is required, because the only library of druntime shipped with dmd is for 32bit platform.
there are few problems: I tried to upgrade from the 2.008 but dmd in that version doesn't understand -lib. So I unmerged the 2.008 and now it can't find the command dmd. My quick and dirty solution was to copy the dmd binary from the 2.052 into the $PATH and now this emerge fine. So the the euibld should use the dmd executable included in the zip.
(In reply to comment #4) the resulting installation can't produce (link) even a simple hello.d (http://pastebin.com/VXwtAsHW), bunch of undefined references (http://pastebin.com/Jm77amZN), output of dmd -v (http://pastebin.com/TismBNpg)
Created attachment 263125 [details, diff] makefiles fixes Makefiles updated to allow multilib building. Minor changes in single source to build under gcc45
Created attachment 263131 [details] dev-lang/dmd Added building of dmd for host platform and libraries for multilib. Added building of hello.d to check that we have proper build env. During compilation of libraries using freshly built dmd. Without USE=build it will use 32bit dmd and 32bit/64bit libraries which is precompiled in zip.
There is d-overlay: http://www.assembla.com/code/d-overlay/subversion/nodes/dev-lang/dmd?rev=118 It's outdated a bit, but I guess it should be considered while introducing dmd in Gentoo. Now I think that adding rebuilding of libraries and compiler in dmd-bin is a wrong idea. Will look further to render those dev-util/dmd-common, dev-lang/dmd, dev-libs/phobos, app-admin/eselect-dmd, dev-lang/ldc, dev-libs/tango to 2.052 version with multilib.
Created attachment 264047 [details] dev-lang/dmd Based on dev-lang/dmd-2.046 from d-overlay. This is good idea to move dumpobj, obj2asm and rdmd to separate package. But as I can see there is no need to depend on it. Phobos is still there, because it will compile druntime.
*** This bug has been marked as a duplicate of bug 212793 ***