www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - GDC on 64 bit linux fails (gentoo)

reply Anders Johnsen <skabet gmail.com> writes:
I'm trying to compile GDC 0.22 in 64 bit with GCC 4.1.1. I followed the guide
but recived this error.

....
Adding multilib support to Makefile in ../../../libstdc++-v3
multidirs=32
with_multisubdir=
Running configure in multilib subdirs 32
pwd: /home/johnsen/c++/gcc-4.1.1/gcc/d/gcc-4.1.1/build/x86_64-unknown-linux-gnu/libstdc++-v3
Running configure in multilib subdir 32
pwd: /home/johnsen/c++/gcc-4.1.1/gcc/d/gcc-4.1.1/build/x86_64-unknown-linux-gnu
mkdir 32
configure: creating cache ./config.cache
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for x86_64-unknown-linux-gnu-gcc...
/home/johnsen/c++/gcc-4.1.1/gcc/d/gcc-4.1.1/build/./gcc/xgcc
-B/home/johnsen/c++/gcc-4.1.1/gcc/d/gcc-4.1.1/build/./gcc/
-B/opt/gdc/x86_64-unknown-linux-gnu/bin/
-B/opt/gdc/x86_64-unknown-linux-gnu/lib/ -isystem
/opt/gdc/x86_64-unknown-linux-gnu/include -isystem
/opt/gdc/x86_64-unknown-linux-gnu/sys-include  -m32
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C
compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[2]: *** [configure-target-libstdc++-v3] Error 1
make[2]: Leaving directory `/home/johnsen/c++/gcc-4.1.1/gcc/d/gcc-4.1.1/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/johnsen/c++/gcc-4.1.1/gcc/d/gcc-4.1.1/build'
make: *** [gdc] Error 2

Anyone have same error, or just successfully compiled in 64 bit linux? Also,
are there any plans on making some binary releases of GDC or DMD in 64 bit? 

Thanks,
Anders Johnsen
Feb 12 2007
next sibling parent reply Alberto <reda zioale.it> writes:
 checking whether the C compiler works... configure: error: cannot run C
compiled programs.
usually that error means that you are passing "wrong" LDFLAGS, (that for example are too aggressive..) My suggestion is to try to compile gdc disabling LDFLAGS: LDFLAGS="" emerge gdc ps: are you using this dev-lang/gdc-0.22 ebuild? It works for me (I have compiled gdc in a 32 bit chroot..) http://bugs.gentoo.org/show_bug.cgi?id=48136
Feb 12 2007
parent reply Anders Johnsen <skabet gmail.com> writes:
Thanks, got gdc compiled now. But what about libgphobos.a ? 

Alberto Wrote:

 checking whether the C compiler works... configure: error: cannot run C
compiled programs.
usually that error means that you are passing "wrong" LDFLAGS, (that for example are too aggressive..) My suggestion is to try to compile gdc disabling LDFLAGS: LDFLAGS="" emerge gdc ps: are you using this dev-lang/gdc-0.22 ebuild? It works for me (I have compiled gdc in a 32 bit chroot..) http://bugs.gentoo.org/show_bug.cgi?id=48136
Feb 12 2007
parent reply Alberto <reda zioale.it> writes:
Anders Johnsen ha scritto:
 Thanks, got gdc compiled now. But what about libgphobos.a ? 
[ Searching for packages matching gdc... ] * Contents of dev-lang/gdc-0.22: .. /usr/lib/libgphobos.a /usr/lib/libgphobos.spec .. and the include files are here: /usr/include/d/4.1.1/ however libgphobos.a is phobos, not tango, if you want tango, you must build it by yourself.
Feb 12 2007
parent reply Anders Johnsen <skabet gmail.com> writes:
My problem is that i don't have that dir:

[ Searching for packages matching gdc... ]
* Contents of dev-lang/gdc-0.22:
/usr
/usr/bin
/usr/bin/gdc
/usr/bin/gdmd
/usr/lib
/usr/lib/gcc
/usr/lib/gcc/x86_64-pc-linux-gnu
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1:/usr
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1:/usr/lib
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1:/usr/lib/gcc
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1:/usr/lib/gcc/x86_64-pc-linux-gnu
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1:/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1:/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/32
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1:/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/32/cc1d
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/gdc.1.gz
/usr/share/man/man1/gdmd.1.gz


Alberto Wrote:

 Anders Johnsen ha scritto:
 Thanks, got gdc compiled now. But what about libgphobos.a ? 
[ Searching for packages matching gdc... ] * Contents of dev-lang/gdc-0.22: .. /usr/lib/libgphobos.a /usr/lib/libgphobos.spec .. and the include files are here: /usr/include/d/4.1.1/ however libgphobos.a is phobos, not tango, if you want tango, you must build it by yourself.
Feb 12 2007
parent reply Alberto <reda zioale.it> writes:
 My problem is that i don't have that dir:
mmm.. which ebuild have you used? the one here http://bugs.gentoo.org/show_bug.cgi?id=48136 ?
Feb 12 2007
parent reply Anders Johnsen <skabet gmail.com> writes:
Yeah... the 0.22 one... Are there ebuilds for it?

Alberto Wrote:

 My problem is that i don't have that dir:
mmm.. which ebuild have you used? the one here http://bugs.gentoo.org/show_bug.cgi?id=48136 ?
Feb 12 2007
parent reply Alberto <reda zioale.it> writes:
 Yeah... the 0.22 one... Are there ebuilds for it?
yes, the ebuild is: http://bugs.gentoo.org/attachment.cgi?id=109352 ps: you must put it in an overlay, just like every other third part ebuild. If you have problem even with that ebuild, try to create a 32 bit chroot and then install gdc there. (many 64bit gentoo users have it for mplayer and some other 32bit apps)
Feb 12 2007
next sibling parent reply John Demme <me teqdruid.com> writes:
Alberto wrote:

 Yeah... the 0.22 one... Are there ebuilds for it?
yes, the ebuild is: http://bugs.gentoo.org/attachment.cgi?id=109352 ps: you must put it in an overlay, just like every other third part ebuild. If you have problem even with that ebuild, try to create a 32 bit chroot and then install gdc there. (many 64bit gentoo users have it for mplayer and some other 32bit apps)
I also didn't get libgphobos installed. I actually don't want gphobos- want to use Tango. I can't compile anything with gdc, though. First it couldn't find object.d. so I linked my tango directory to /usr/include/d. Now it wants libgphobos.spec. I don't know that that does or why it wants it. I also don't want to have to use a 32-bit chroot. IMO, it's a pain in the ass. Any suggestions? Thanks. -- ~John Demme me teqdruid.com http://www.teqdruid.com/
Feb 12 2007
parent reply Alberto <reda zioale.it> writes:
 I also didn't get libgphobos installed.  I actually don't want gphobos- want
 to use Tango.  I can't compile anything with gdc, though.  First it
 couldn't find object.d. so I linked my tango directory to /usr/include/d. 
I had the same "problem" with tango, very easy to fix
 Now it wants libgphobos.spec.  I don't know that that does or why it wants
 it.
you must have it, however if you compile tango, you can run the installer (that will linstall libgphobos.spec and libgphobos.a) or you can follow the instruction on the tango site and install all manually. (I had a lot of problems with the install scripts, only a manual install has solved all problems.
 
 I also don't want to have to use a 32-bit chroot.  IMO, it's a pain in the
 ass.  Any suggestions?
cross compile?
Feb 13 2007
parent reply John Demme <me teqdruid.com> writes:
Alberto wrote:

 I also didn't get libgphobos installed.  I actually don't want gphobos-
 want
 to use Tango.  I can't compile anything with gdc, though.  First it
 couldn't find object.d. so I linked my tango directory to /usr/include/d.
I had the same "problem" with tango, very easy to fix
 Now it wants libgphobos.spec.  I don't know that that does or why it
 wants it.
you must have it, however if you compile tango, you can run the installer (that will linstall libgphobos.spec and libgphobos.a) or you
Nope. Don't have it. libgphobos.spec doesn't exist anywhere on my computer. This means that build-gdc.sh won't work since gdc doesn't work. Also means that install-gdc.sh can't install libgphobos.spec because it modifies your existing one. The question is, why didn't the ebuild install it? Looks like Anders is on the right track. Will investigate there. -- ~John Demme me teqdruid.com http://www.teqdruid.com/
Feb 13 2007
next sibling parent Anders Johnsen <skabet gmail.com> writes:
Found this link:
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=46366

Looks like it's an error in the gdc code, when compiling 64 bit.

John Demme Wrote:

 Nope.  Don't have it.  libgphobos.spec doesn't exist anywhere on my
 computer.  This means that build-gdc.sh won't work since gdc doesn't work. 
 Also means that install-gdc.sh can't install libgphobos.spec because it
 modifies your existing one.  The question is, why didn't the ebuild install
 it?  Looks like Anders is on the right track.  Will investigate there.
 
 -- 
 ~John Demme
 me teqdruid.com
 http://www.teqdruid.com/
Feb 14 2007
prev sibling parent Anders Johnsen <skabet gmail.com> writes:
Found this link:
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=46366

Looks like it's an error in the gdc code, when compiling 64 bit.

John Demme Wrote:

 Nope.  Don't have it.  libgphobos.spec doesn't exist anywhere on my
 computer.  This means that build-gdc.sh won't work since gdc doesn't work. 
 Also means that install-gdc.sh can't install libgphobos.spec because it
 modifies your existing one.  The question is, why didn't the ebuild install
 it?  Looks like Anders is on the right track.  Will investigate there.
 
 -- 
 ~John Demme
 me teqdruid.com
 http://www.teqdruid.com/
Feb 14 2007
prev sibling parent Anders Johnsen <skabet gmail.com> writes:
Looks like this is the error:

line 101: cd: /var/tmp/portage/gdc-0.22/work/gdc-build/*/libphobos: No such
file or directory

when i try and make it manuelly in the
/var/tmp/portage/gdc-0.22/work/gcc-4.1.1/gcc/d/phobos folder, i get following:

gdc -o std/c/linux/linux.o -g -frelease -O2  -fversion=GC_Use_Alloc_MMap
-fversion=GC_Use_Stack_GLibC -fversion=GC_Use_Data_Fixed -nostdinc -I/ -I . -I
./internal/gc -I ./ -c std/c/linux/linux.d
gdc -o gcc/configunix.o -g -frelease -O2  -fversion=GC_Use_Alloc_MMap
-fversion=GC_Use_Stack_GLibC -fversion=GC_Use_Data_Fixed -nostdinc -I/ -I . -I
./internal/gc -I ./ -c /gcc/configunix.d
gdc -o std/c/unix/unix.o -g -frelease -O2  -fversion=GC_Use_Alloc_MMap
-fversion=GC_Use_Stack_GLibC -fversion=GC_Use_Data_Fixed -nostdinc -I/ -I . -I
./internal/gc -I ./ -c std/c/unix/unix.d
gdc -o internal/fpmath.o -g -frelease -O2  -fversion=GC_Use_Alloc_MMap
-fversion=GC_Use_Stack_GLibC -fversion=GC_Use_Data_Fixed -nostdinc -I/ -I . -I
./internal/gc -I ./ -c internal/fpmath.d
gdc -o std/boxer.o -g -frelease -O2  -fversion=GC_Use_Alloc_MMap
-fversion=GC_Use_Stack_GLibC -fversion=GC_Use_Data_Fixed -nostdinc -I/ -I . -I
./internal/gc -I ./ -c std/boxer.d
cc1d: /var/tmp/portage/gdc-0.22/work/gcc-4.1.1/gcc/d/dmd/toobj.c:417: virtual
void ClassDeclaration::toObjFile(): Assertion `classinfo->structsize ==
(0x3C+8)' failed.
std/boxer.d:523: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
make: *** [std/boxer.o] Error 1

Close on giving up now :-/
Feb 13 2007
prev sibling parent Sjoerd van Leent <svanleent gmail.com> writes:
I seem to get this with 0.23 as well. Tried just about any suggestion,
suppressing
LDFLAGS, CFLAGS and disabling sandbox feature, even searched fstab whether the
filesystem was r/o. Any other ideas?
Jul 14 2007