Help with building GDC?

Vladimir Panteleev thecybershadow at gmail.com
Tue Jul 10 00:11:04 PDT 2007


Hello. I've been having some memory corruption issues on DMD/Windows, and after lots of pointless debugging, I decided to try to make a time investment of porting my software to GDC/Linux and trying to catch the issue with Valgrind. Since I plan to reuse parts of the project in an upcoming much larger project, I decided to keep the source compatible with both D 2.0 and 1.x. The latest (binary) release of GDC, however, is a way behind - no "string" types, no "ref", no automatic static opCalls for structures, and other tidbits. The project is over 8000 lines, so I decided to just build a newer GDC using Gregor's patch posted above.

So, I realise I'm not exactly a Linux guru, and I probably messed up somewhere - I was hoping someone could point out what I did wrong. Here's what I did:

1) installed the gcc-4.1-source package (Kubuntu 7.04)
     This installed a source tarball to /usr/src/gcc-4.1, along with some patches (patches/*.dpatch and patch.* files). I have no idea how idea how to use them, so I left them alone.
2) unpacked the tarball (got source in /usr/src/gcc-4.1/gcc-4.1.2)
3) unpacked gdc-0.23-src.tar.bz2 (and got /usr/src/gcc-4.1/gcc-4.1.2/gcc/d)
4) got and applied Gregor's patch, fixing the line endings first
5) from /usr/src/gcc-4.1/gcc-4.1.2, ran ./gcc/d/setup-gcc.sh
6) cd ..; mkdir gcc-4.1-out; cd gcc-4.1-out (WD is /usr/src/gcc-4.1/gcc-4.1.2-out/)
7) /usr/src/gcc-4.1/gcc-4.1.2/configure --prefix=/usr/local/gcc-4.1 --enable-languages=c,d,c++
8) make

make runs fine for a while, until I get this:

checking If /usr/src/gcc-4.1/gcc-4.1.2-out/./gcc/gdc -B/usr/src/gcc-4.1/gcc-4.1.2-out/./gcc/ -B/usr/local/gcc-4.1/i686-pc-linux-gnu/bin/ -B/usr/local/gcc-4.1/i686-pc-linux-gnu/lib/ -isystem /usr/local/gcc-4.1/i686-pc-linux-gnu/include -isystem /usr/local/gcc-4.1/i686-pc-linux-gnu/sys-include can compile D sources... /usr/src/gcc-4.1/gcc-4.1.2-out/./gcc/cc1d: /usr/src/gcc-4.1/gcc-4.1.2-out/./gcc/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)
no
configure: error: can't compile D sources!
make[1]: *** [configure-target-libphobos] Error 1
make[1]: Leaving directory `/usr/src/gcc-4.1/gcc-4.1.2-out'
make: *** [all] Error 2

So, seems like a 4.2 dependency crawled in somehow.

What should I do? Install GCC 4.2? It isn't listed in the package manager, so I'd be getting that manually. Or should I take down the whole thing and get the GCC sources from SVN?

-- 
Best regards,
  Vladimir                          mailto:thecybershadow at gmail.com


More information about the D.gnu mailing list