Tango 0.96 beta2 released

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sat Mar 17 05:34:48 PDT 2007


Sean Kelly wrote:
> Frits van Bommel wrote:
>>
>> However, copying GDC's std.c.stdarg module over it lets it compile a 
>> bit further. Unfortunately, it then chokes on something else:
>> ---
>> gcc -c -O -m32 core/ThreadASM.S -ocore/ThreadASM.o
>> gcc -c -O -m32 stdc/wrap.c -ostdc/wrap.o
>> In file included from /usr/include/features.h:346,
>>                  from /usr/include/errno.h:29,
>>                  from stdc/wrap.c:1:
>> /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or 
>> directory
>> make[1]: *** [stdc/wrap.o] Error 1
>> make[1]: Leaving directory 
>> `/home/urxae/opt/tango/svn-trunk/lib/common/tango'
>> make: *** [lib] Error 2
> 
> Okay, I've changed the makefiles a bit.  Please let me know if you still 
> see this error (or if I've created a new one).

The above error is fixed.

However, after reverting my changes, I still get the old va_arg error:
---
gdc -o lifetime.o -g -frelease -O2 -fversion=GC_Use_Alloc_MMap 
-fversion=GC_Use_Stack_GLibC -fversion=GC_Use_Data_Fixed -nostdinc -pipe 
-I../../..   \
         -c lifetime.d
../../../std/c/stdarg.di:19: Error: cannot have out or inout parameter 
of type ubyte[24][1]
../../../std/c/stdarg.di:815: template instance 
std.c.stdarg.va_start!(uint) error instantiating
lifetime.d:815: Error: cannot change reference to static array 'va'
make[2]: *** [lifetime.o] Error 1
make[2]: Leaving directory 
`/home/urxae/opt/tango/svn-trunk/lib/compiler/gdc'
make[1]: *** [all] Error 2
make[1]: Leaving directory 
`/home/urxae/opt/tango/svn-trunk/lib/compiler/gdc'
make: *** [lib] Error 2
---

I dug into it a bit more and it turns out GDC chokes if va_start and/or 
va_arg are inside version(GNU)(!).
This patch fixes it, at least for GDC:
=====
Index: std/c/stdarg.di
===================================================================
--- std/c/stdarg.di     (revision 1923)
+++ std/c/stdarg.di     (working copy)
@@ -14,6 +14,7 @@
      alias __builtin_va_end  va_end;
      alias __builtin_va_copy va_copy;

+}
      template va_start(T)
      {
          void va_start( out va_list ap, inout T parmn )
@@ -29,4 +30,3 @@
              return T.init;
          }
      }
-}
=====
(just moves the closing brace of version(GNU) above those functions)

I don't think this should cause problems for DMD since the only import 
of this module is inside version(GNU) itself...
User-level code importing std.c.stdarg may be a problem. Unfortunately, 
this seems unavoidable since the code is needed by tango.stdc.stdarg. 
Unless perhaps it could be moved to lib/compiler/gdc and only copied to 
an import path when building/installing for GDC?



More information about the Digitalmars-d-announce mailing list