FreeBSD 6 amd64 tweak: Compiling problem: CLASSINFO_SIZE assert

Sean Chittenden sean at arcscale.com
Sun Jan 7 11:48:43 PST 2007


Howdy.  I'm on an amd64 FreeBSD 6.2-rc machine and have been able to get it to compile on FreeBSD6 amd64 with the following
patches.  I haven't conditionalized them inside of the build infrastructure, but am going to likely incorporate them into
my port upgrade to 0.21.  The problem is described below:

/usr/ports/lang/gdc/work/build/gcc/gdc -B/usr/ports/lang/gdc/work/build/gcc/ -B/usr/local/x86_64-portbld-freebsd6.2/bin/ -B/usr/local/x86_64-portbld-freebsd6.2/lib/ -isystem /usr/local/x86_64-portbld-freebsd6.2/include -isystem /usr/local/x86_64-portbld-freebsd6.2/sys-include -o
std/loader.o -g -frelease -O2  -fversion=GC_Use_Alloc_MMap -fversion=GC_Use_Stack_FreeBSD -fversion=GC_Use_Data_Fixed -nostdinc -I ../.././../gcc-4.0-20061228/libphobos -I ../.././../gcc-4.0-20061228/libphobos/internal/gc -I ./x86_64-portbld-freebsd6.2 -c ../.././../gcc-4.0-20061228/libphobos/std/loader.d
Assertion failed: (classinfo->structsize == CLASSINFO_SIZE), function toObjFile,
file .././../gcc-4.0-20061228/gcc/d/dmd/toobj.c, line 416.
../.././../gcc-4.0-20061228/libphobos/std/loader.d:428: internal compiler error: Abort trap: 6
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
gmake: *** [std/loader.o] Error 1
Exit 2

Line 416 is the assert shown below:
    /* The layout is:
       {
            void **vptr;
            monitor_t monitor;
            byte[] initializer;         // static initialization data
            char[] name;                // class name
            void *[] vtbl;
            Interface[] interfaces;
            ClassInfo *base;            // base class
            void *destructor;
            void *invariant;            // class invariant
            uint flags;
            void *deallocator;
       }
     */
    dt_t *dt = NULL;
    offset = CLASSINFO_SIZE;                    // must be ClassInfo.size
    if (classinfo)
    {
        assert(classinfo->structsize == CLASSINFO_SIZE); // line 416
    }

The '#define CLASSINFO_SIZE 0x3C' line in d/dmd/aggregate.h for amd64 should be 0x70.  Is CLASSINFO_SIZE being set for a
32bit arch vs a 64bit arch?  Where is the classinfo struct being defined?  Can't some sizeof() work fix this?  I also tried
commenting out the assert and replacing it with some printf()'s to see if the #define wasn't set correctly for an x64
system, but I didn't have any luck finding the dependencies and had to patch, then completely recompile.  What's the trick
here?

I'm still working through porting, however....

/usr/ports/lang/gdc/work/build/gcc/gdc -B/usr/ports/lang/gdc/work/build/gcc/ -B/usr/local/x86_64-portbld-freebsd6.2/bin/ -B/usr/local/x86_64-portbld-freebsd6.2/lib/ -isystem /usr/local/x86_64-portbld-freebsd6.2/include -isystem /usr/local/x86_64-portbld-freebsd6.2/sys-include -o
std/format.o -g -frelease -O2  -fversion=GC_Use_Alloc_MMap -fversion=GC_Use_Stack_FreeBSD -fversion=GC_Use_Data_Fixed -nostdinc -I ../.././../gcc-4.0-20061228/libphobos -I ../.././../gcc-4.0-20061228/libphobos/internal/gc -I ./x86_64-portbld-freebsd6.2 -c ../.././../gcc-4.0-20061228/libphobos/std/format.d
../.././../gcc-4.0-20061228/libphobos/std/format.d:837: static assert  (0) is false, "uimplemented"
gmake[1]: *** [std/format.o] Error 1
gmake[1]: Leaving directory `/usr/ports/lang/gdc/work/build/x86_64-portbld-freebsd6.2/libphobos'
gmake: *** [all-target-libphobos] Error 2
*** Error code 2

-sc



More information about the Digitalmars-d mailing list