Don wrote:

> I really want to use D but I'm constantly frustrated by issues just
> like this.
> 
> I get the same error message on 64 bit Ubunutu 10.10 as well.
> 
> I do plan to stick with it and when D is within 5% of the speed of gcc
> for my type of application (computer chess) I'm switching.
> 
> Sorry I cannot be of more help to you.   I was hoping to at least find
> a binary distribution that is up to date but I have not been able to
> do so.    I wonder if this will compile on a 32 bit box?  I may try it
> with virtual-box when I get time and that would my only suggestion.
> 
> GDC is in the repository for Ubuntu but it's an ancient version and I
> don't know if it produces 64 bit executables.    It's my understanding
> that GDC runs as a 32 bit application but that later version do
> produce 64 bit binaries which is important to me since I rely on 64
> bit data structures for high performance.
I spent Sunday evening tackling the issue you are speaking of for my own 
use. I have attached a patch I created yesterday, for the ubuntu package 
from the repository, that should make the package build D2. It contains 
everything I have done so far. I haven't tested it much but some simple 
tests show it works (so far limited to opening a window with xcb, a writefln 
hello world and a simple immutable test to make sure I was dealing with D2). 
I essentially wanted a gdc install that I could remove or upgrade without 
fuss :-). I am using 11.04 not 10.10 so you might need to tweak the patch 
for the older version (the changelog shows recent changes despite the age of 
the gdc version).

Follow the below instructions.

1. Execute "sudo apt-get build-dep gdc-4.4" (you might need to install some 
of the deb tools and fakeroot if it doesn't, I can't remember the package 
names but I can try and figure them out if needed)
2. Execute "apt-get source gdc-4.4"
3. Rename new directory to gdc-4.4-2.052-4.4.5 (not sure if this is 
necessary but it is at least a convention and more accurately represents 
what I am creating :-) )
4. Apply the patch to gdc-4.4-2.052-4.4.5
5. Delete the archive inside gdc-4.4-2.052-4.4.5.
6. Pull gdc from repo.
7. Compress the "d" directory to an archive named gdc-20110517.orig.tar.gz 
(replace the date if you want, just what I called it). Make sure "d" is the 
root directory inside the tar. I had issues using KDE's ark to compress too 
tar.xz, it wouldn't decompress on build, but it works with tar.gz too so I 
went that route.
8. Place the new archive inside gdc-4.4-2.052-4.4.5.
9. Open a terminal in gdc-4.4-2.052-4.4.5.
10. Execute "dpkg-buildpackage -rfakeroot"
11. Go have a snack while it compiles.
12. Should have a gdc-4.4 and libphobos2-dev package sitting in the 
directory above gdc-4.4-2.052-4.4.5. (it might ask you to sign it, not 
strictly necessary). Install them.

You should then be able to compile with

gdc-4.4 -I/usr/include/d2/4.4 -I/usr/include/d2/4.4/x86_64-linux-gnu -o 
<output> <files.d>

Hope that helps :-).

p.s. I can provide my compiled package if people want them. They are 64bit.
diff -Naur gdc-4.4-2.052-4.4.5-old/debian//changelog gdc-4.4-2.052-4.4.5/debian//changelog
--- gdc-4.4-2.052-4.4.5-old/debian//changelog	2011-05-23 20:35:13.000000000 +0100
+++ gdc-4.4-2.052-4.4.5/debian//changelog	2011-05-21 22:52:40.626769583 +0100
@@ -1,3 +1,9 @@
+gdc-4.4 (2.052-4.4.5-15ubuntu4) natty; urgency=low
+
+  * D2
+
+ -- Adam Burton <adz...@gmail.com>  Fri, 21 May 2011 22:52:00 +0000
+
 gdc-4.4 (1.063-4.4.5-15ubuntu4) natty; urgency=low
 
   * Fix D system include dir for multiarch locations.
@@ -975,7 +981,7 @@
  -- Matthias Klose <d...@debian.org>  Fri, 29 Sep 2006 22:32:41 +0200
 
 gcc-4.1 (4.1.1ds1-14) unstable; urgency=medium
-	
+
   [Matthias Klose]
   * Update to SVN 20060920.
     - Fix PR c++/26957. Closes: #373257, #386910.
@@ -989,7 +995,7 @@
     - When running the i386 binaries on amd64, adjust the properties
       java.home, gnu.classpath.home.url, sun.boot.class.path,
       gnu.gcj.precompiled.db.path.
-    - Configure the 32bit build on amd64 
+    - Configure the 32bit build on amd64
       --with-java-home=/usr/lib32/jvm/java-1.4.2-gcj-4.1-1.4.2.0/jre.
     - Configure --with-long-double-128 for glibc-2.4 on alpha, powerpc, ppc64,
       s390, s390x, sparc, sparc64.
@@ -2698,23 +2704,23 @@
 
   * Robert Millan <r...@debian.org>
 
-    * control.m4: 
-      - s/locale_no_archs !hurd-i386/locale_no_archs/g 
-        (This is now handled in rules.defs. [1]) 
-      - s/procps [check_no_archs]/procps [linux_gnu_archs]/g [2] 
-      - Add type-handling to build-deps. [3] 
-    * rules.conf: 
-      - Don't require (>= $(libc_ver)) for libc0.1-dev. [4] 
-      - Generate *_no_archs variables with type-handling and use them for 
-        for m4's -D parameters. [3] 
-    * rules.defs: 
-      - use filter instead of findstring [1]. 
-      - s/netbsd-elf-gnu/netbsdelf-gnu/g [5]. 
-      - enable java for kfreebsd-gnu [6] 
-      - enable ffi for kfreebsd-gnu and knetbsd-gnu [6] 
-      - enable libgc for kfreebsd-gnu [6] 
-      - enable checks for kfreebsd-gnu and knetbsd-gnu [7] 
-      - enable locales for kfreebsd-gnu and gnu [1] [8]. 
+    * control.m4:
+      - s/locale_no_archs !hurd-i386/locale_no_archs/g
+        (This is now handled in rules.defs. [1])
+      - s/procps [check_no_archs]/procps [linux_gnu_archs]/g [2]
+      - Add type-handling to build-deps. [3]
+    * rules.conf:
+      - Don't require (>= $(libc_ver)) for libc0.1-dev. [4]
+      - Generate *_no_archs variables with type-handling and use them for
+        for m4's -D parameters. [3]
+    * rules.defs:
+      - use filter instead of findstring [1].
+      - s/netbsd-elf-gnu/netbsdelf-gnu/g [5].
+      - enable java for kfreebsd-gnu [6]
+      - enable ffi for kfreebsd-gnu and knetbsd-gnu [6]
+      - enable libgc for kfreebsd-gnu [6]
+      - enable checks for kfreebsd-gnu and knetbsd-gnu [7]
+      - enable locales for kfreebsd-gnu and gnu [1] [8].
     * Closes: #264025.
 
  -- Matthias Klose <d...@debian.org>  Sun, 12 Sep 2004 12:52:56 +0200
@@ -2799,7 +2805,7 @@
     - Use of configure flags affecting binary ABI's not yet determined.
     - Several ABI bugs have been fixed. Unfortunately, these changes will break
       binary compatibility with earlier releases on several architectures:
-      alpha, mips, sparc, 
+      alpha, mips, sparc,
     - hppa and m68k changed sjlj based exception handling to dwarf2 based
       exception handling.
 
@@ -3073,7 +3079,7 @@
     (Phil Blundell)
   * Update priorities in debian/control to match the archive.
     (Ryan Murray)
-  * s390-nonlocal-goto patch added. Fixes some pascal testcase failures. 
+  * s390-nonlocal-goto patch added. Fixes some pascal testcase failures.
     (Gerhard Tonn)
   * On alpha-linux, make -mieee default and add -mieee-disable switch
     to turn default off (closes: #212912).
diff -Naur gdc-4.4-2.052-4.4.5-old/debian//control gdc-4.4-2.052-4.4.5/debian//control
--- gdc-4.4-2.052-4.4.5-old/debian//control	2011-05-23 20:35:13.000000000 +0100
+++ gdc-4.4-2.052-4.4.5/debian//control	2011-05-22 00:31:39.886767583 +0100
@@ -14,19 +14,19 @@
 Package: gdc-4.4
 Architecture: any
 Priority: optional
-Depends: gcc-4.4-base (>= ${gcc:SoftVersion}), g++-4.4 (>= ${gcc:SoftVersion}), libphobos-4.4-dev (= ${gdc:Version}) [!hurd-i386 !hurd-alpha], ${shlibs:Depends}, ${misc:Depends}
+Depends: gcc-4.4-base (>= ${gcc:SoftVersion}), g++-4.4 (>= ${gcc:SoftVersion}), libphobos2-4.4-dev (= ${gdc:Version}) [!hurd-i386 !hurd-alpha], ${shlibs:Depends}, ${misc:Depends}
 Provides: d-compiler
 Description: The D compiler
  This is the D compiler, which compiles D on platforms supported by the gcc
  compiler. It uses the GCC backend to generate optimised code.
 Homepage: https://bitbucket.org/goshawk/gdc
 
-Package: libphobos-4.4-dev
+Package: libphobos2-4.4-dev
 Architecture: any
 Section: libdevel
 Priority: optional
 Depends: gdc-4.4 (= ${gdc:Version}), zlib1g-dev, ${shlibs:Depends}, ${misc:Depends}
-Provides: libphobos-dev
+Provides: libphobos2-dev
 Description: The phobos D standard library
  This is the Phobos standard library that comes with the D compiler.
  .
diff -Naur gdc-4.4-2.052-4.4.5-old/debian//rules.d/binary-d.mk gdc-4.4-2.052-4.4.5/debian//rules.d/binary-d.mk
--- gdc-4.4-2.052-4.4.5-old/debian//rules.d/binary-d.mk	2011-05-23 20:35:13.000000000 +0100
+++ gdc-4.4-2.052-4.4.5/debian//rules.d/binary-d.mk	2011-05-22 22:06:51.000525476 +0100
@@ -21,6 +21,9 @@
 files_gdc = \
 	$(PF)/bin/gdc$(pkg_ver) \
 	$(PF)/bin/gdmd$(pkg_ver) \
+	$(gdc_include_dir)/$(BASE_VERSION)/gcc \
+	$(gdc_include_dir)/$(BASE_VERSION)/object.di \
+	$(PF)/$(libdir)/libgdruntime.a \
 	$(PF)/share/man/man1/gdc$(pkg_ver).1 \
 	$(PF)/share/man/man1/gdmd$(pkg_ver).1 \
 	$(gcc_lib_dir)/cc1d
@@ -28,7 +31,9 @@
 
 dirs_libphobos = \
 	$(PF)/lib \
-	$(gdc_include_dir)/$(BASE_VERSION) \
+	$(gdc_include_dir)/$(BASE_VERSION)/etc \
+	$(gdc_include_dir)/$(BASE_VERSION)/std \
+	$(gdc_include_dir)/$(BASE_VERSION)/crc32.d \
 	$(gcc_lib_dir)
 
 files_libphobos = \
@@ -56,10 +61,6 @@
 
 	DH_COMPAT=2 dh_movefiles -p$(p_gdc) -X/zlib/ $(files_gdc)
 
-	# Always needed by gdc.
-	cp $(srcdir)/gcc/d/phobos$(libphobos_version)/object.d \
-	    $(d_gdc)/$(gdc_include_dir)/$(BASE_VERSION)/
-
 	dh_link -p$(p_gdc) $(links_gdc)
 
 	dh_strip -p$(p_gdc)
@@ -89,9 +90,6 @@
 	mv $(d_libphobos)/$(PF)/$(libdir)/libgphobos$(libphobos_version).a \
 	    $(d_libphobos)/$(gcc_lib_dir)
 
-	# included in gdc package
-	rm -f $(d_libphobos)/$(gdc_include_dir)/$(BASE_VERSION)/object.d
-
 	# no need to have it twice
 	dh_link -p$(p_libphobos) \
 	    /$(PF)/share/doc/$(p_gdc) /$(PF)/share/doc/$(p_libphobos)
diff -Naur gdc-4.4-2.052-4.4.5-old/debian//rules.defs gdc-4.4-2.052-4.4.5/debian//rules.defs
--- gdc-4.4-2.052-4.4.5-old/debian//rules.defs	2011-05-23 20:35:13.000000000 +0100
+++ gdc-4.4-2.052-4.4.5/debian//rules.defs	2011-05-21 23:37:36.006768675 +0100
@@ -12,7 +12,7 @@
 distrelease	:= $(shell lsb_release -cs)
 
 # On non official archives, "lsb_release -cs" default to "n/a". Assume
-# sid in that case 
+# sid in that case
 ifeq ($(distrelease),n/a)
 distrelease	:= sid
 endif
@@ -650,13 +650,13 @@
 
 ifeq ($(with_d),yes)
   # no suffix for D 1.0
-  libphobos_version :=
+  #libphobos_version :=
   # still experimental
-  #libphobos_version := 2
+  libphobos_version := 2
 
   with_libphobos := yes
 
-  libphobos_no_cpus := 
+  libphobos_no_cpus :=
   libphobos_no_systems := gnu
   ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(libphobos_no_cpus)))
     with_libphobos := disabled for cpu $(DEB_TARGET_ARCH_CPU)
diff -Naur gdc-4.4-2.052-4.4.5-old/debian//rules.parameters gdc-4.4-2.052-4.4.5/debian//rules.parameters
--- gdc-4.4-2.052-4.4.5-old/debian//rules.parameters	2011-05-23 20:35:13.000000000 +0100
+++ gdc-4.4-2.052-4.4.5/debian//rules.parameters	2011-05-22 00:31:39.936767583 +0100
@@ -2,17 +2,17 @@
 GCC_VERSION	:= 4.4.5
 NEXT_GCC_VERSION	:= 4.4.6
 BASE_VERSION	:= 4.4
-SOURCE_VERSION	:= 1.063-4.4.5-15ubuntu3
-DEB_VERSION	:= 4.4.5-15ubuntu3
-DEB_EVERSION	:= 1:1.063-4.4.5-15ubuntu3
+SOURCE_VERSION	:= 2.052-4.4.5-15ubuntu4
+DEB_VERSION	:= 4.4.5-15ubuntu4
+DEB_EVERSION	:= 1:2.052-4.4.5-15ubuntu4
 GPC_BASE_VERSION	:= 
-GDC_BASE_VERSION  := 1.063
+GDC_BASE_VERSION  := 2.052
 DEB_GPC_VERSION	:= 
-DEB_GDC_VERSION	:= 1.063-4.4.5-15ubuntu3
+DEB_GDC_VERSION	:= 2.052-4.4.5-15ubuntu4
 DEB_SOVERSION	:= 4.4
 DEB_SOEVERSION	:= 1:4.4
 DEB_LIBGCC_SOVERSION	:= 1:4.4
-DEB_LIBGCC_VERSION	:= 1:1.063-4.4.5-15ubuntu3
+DEB_LIBGCC_VERSION	:= 1:2.052-4.4.5-15ubuntu4
 DEB_STDCXX_SOVERSION	:= 4.4
 DEB_GCJ_SOVERSION	:= 4.4
 PKG_GCJ_EXT	:= 10
diff -Naur gdc-4.4-2.052-4.4.5-old/debian//rules.patch gdc-4.4-2.052-4.4.5/debian//rules.patch
--- gdc-4.4-2.052-4.4.5-old/debian//rules.patch	2011-05-23 20:35:13.000000000 +0100
+++ gdc-4.4-2.052-4.4.5/debian//rules.patch	2011-05-21 22:16:46.056770308 +0100
@@ -187,7 +187,7 @@
 ifeq ($(with_d),yes)
   debian_patches += \
        gdc-4.4$(if $(with_linaro_branch),-linaro) \
-       gdc-hg-updates \
+       #gdc-hg-updates \
        gdc-hg-doc-updates \
        gdc-ice-valist \
        gdc-stubs \
@@ -203,7 +203,7 @@
     debian_patches += gdc-driver-nophobos
   endif
   ifeq ($(with_multiarch_lib),yes)
-    debian_patches += gdc-multiarch-incdir
+    #debian_patches += gdc-multiarch-incdir
   endif
 else
   debian_patches += gcc-d-lang
diff -Naur gdc-4.4-2.052-4.4.5-old/debian//rules.unpack gdc-4.4-2.052-4.4.5/debian//rules.unpack
--- gdc-4.4-2.052-4.4.5-old/debian//rules.unpack	2011-05-23 20:35:13.000000000 +0100
+++ gdc-4.4-2.052-4.4.5/debian//rules.unpack	2011-05-22 20:49:22.480527041 +0100
@@ -265,7 +265,16 @@
 	mkdir $(srcdir)/libphobos && \
 	  cd $(srcdir)/libphobos && \
 	    ../symlink-tree ../gcc/d/phobos$(libphobos_version) 2>&1 && \
-	cd $(srcdir)
+	    cd $(srcdir)
+	mkdir $(srcdir)/libphobos/zlib && \
+	  cd $(srcdir)/libphobos/zlib && \
+	    ../../symlink-tree ../../gcc/d/zlib 2>&1 && \
+	    cd $(srcdir)
+  ifeq ($(libphobos_version),2)
+	cd $(srcdir)/libphobos && \
+	  ../symlink-tree ../gcc/d/druntime 2>&1 && \
+	  cd $(srcdir)
+  endif
 endif
 	[ -e $(srcdir)/gcc/d/d-make-include ] && rm -f $(srcdir)/gcc/d/d-make-include || true
 ifeq ($(libphobos_version),2)

Reply via email to