build gdc with gcc 4.2.2

Arthur Loiret arthur.loiret at gmail.com
Fri Nov 16 03:56:43 PST 2007


Hi,


I've been able to build gdc with gcc-4.2, it stills segfault sometimes
and is unable to build phobos/tango for now, but it's a beginning and
can compile short D files.

I've put the patches in: http://people.dunnewind.net/arthur/gdc-4.2/patches/

gdc-4.2-build.dpatch updates gcc/d/Make-lang.in for the new gcc-4.2 objs
(pr26885) and gcc/d/d-builtins.c copied from the new c-common.c.

gdc-4.2.dpatch is mostly taked from patch-gcc-4.1.x, adding this:

--- gcc/tree.h  2007-11-15 14:21:01.000000000 +0100
+++ gcc/tree.h  2007-11-15 14:22:05.000000000 +0100
@@ -3535,6 +3535,19 @@
 
 extern tree build_nt (enum tree_code, ...);
 
+/* Still required by gdc */
+#if GCC_VERSION >= 3000 || __STDC_VERSION__ >= 199901L
+/* Use preprocessor trickery to map "build" to "buildN" where N is the
+   expected number of arguments.  This is used for both efficiency (no
+   varargs), and checking (verifying number of passed arguments).  */
+#define build(code, ...) \
+  _buildN1(build, _buildC1(__VA_ARGS__))(code, __VA_ARGS__)
+#define _buildN1(BASE, X)       _buildN2(BASE, X)
+#define _buildN2(BASE, X)       BASE##X
+#define _buildC1(...)           _buildC2(__VA_ARGS__,9,8,7,6,5,4,3,2,1,0,0)
+#define _buildC2(x,a1,a2,a3,a4,a5,a6,a7,a8,a9,c,...) c
+#endif
+
 extern tree build0_stat (enum tree_code, tree MEM_STAT_DECL);
 #define build0(c,t) build0_stat (c,t MEM_STAT_INFO)
 extern tree build1_stat (enum tree_code, tree, tree MEM_STAT_DECL);



I'm currently trying to fix ICEs, the problems seems to come from
gimple.


Any help would be welcome, there is still a lot of work to get it
working. :-)


Arthur.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.puremagic.com/pipermail/d.gnu/attachments/20071116/153fa48c/attachment.pgp 


More information about the D.gnu mailing list