www.digitalmars.com         C & C++   DMDScript  

D.gnu - Help with building GDC?

reply "Vladimir Panteleev" <thecybershadow gmail.com> writes:
Hello. I've been having some memory corruption issues on DMD/Windows, an=
d after lots of pointless debugging, I decided to try to make a time inv=
estment of porting my software to GDC/Linux and trying to catch the issu=
e with Valgrind. Since I plan to reuse parts of the project in an upcomi=
ng much larger project, I decided to keep the source compatible with bot=
h D 2.0 and 1.x. The latest (binary) release of GDC, however, is a way b=
ehind - no "string" types, no "ref", no automatic static opCalls for str=
uctures, 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 som=
ewhere - I was hoping someone could point out what I did wrong. Here's w=
hat 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 som=
e 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=3D/usr/local/gcc-4.1 --=
enable-languages=3Dc,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-inc=
lude 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 manage=
r, so I'd be getting that manually. Or should I take down the whole thin=
g and get the GCC sources from SVN?

-- =

Best regards,
  Vladimir                          mailto:thecybershadow gmail.com
Jul 10 2007
parent reply Carlos Santander <csantander619 gmail.com> writes:
Vladimir Panteleev escribió:
 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?
 
Try adding --disable-shared to "configure". See http://d.puremagic.com/issues/show_bug.cgi?id=781 -- Carlos Santander Bernal
Jul 10 2007
parent "Vladimir Panteleev" <thecybershadow gmail.com> writes:
On Tue, 10 Jul 2007 15:12:34 +0300, Carlos Santander <csantander619 gmai=
l.com> wrote:

 Try adding --disable-shared to "configure". See
 http://d.puremagic.com/issues/show_bug.cgi?id=3D781
Thanks - adding --disable-multilib --disable-shared worked for me (I got= the tip from someone else, so I'm not sure if --disable-multilib was st= rictly required). -- = Best regards, Vladimir mailto:thecybershadow gmail.com
Jul 10 2007