Subject: cross compiling errors
To: None <rearnsha@netbsd.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: port-arm
Date: 11/17/2001 04:30:38
Hiya Richard,

In my efford to get arch/acorn32 fully ELF operatable i've tried
cross-compiling acorn32 on an Alpha.

Unfortunataly I got the assembler errors prolly connected to ints getting 
zero after shifting or so wich breaks on LP64 ...

Since i am not familiar with the gnu toolset :( I would very much apreciate 
if you could shed your eye on it ... i think its a relative small patch in 
the offset calculation or so ... here is the data ... happy hacking ;)

-----

dependall ===> gnu/usr.bin/groff/hpftodit
/usr/tmp/acorn32-toolset//bin/arm--netbsdelf-c++ -O2  -Werror   
-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -D
HAVE_SYS_DIR_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_MATH_H=1 
-DRET_TYPE_SRAND_IS_VOID=1 -DHAVE_SYS_NERR=1 -DHAVE_SYS_ERRLIST=1 -D
HAVE_CC_LIMITS_H=1 -DRETSIGTYPE=void -DHAVE_STRUCT_EXCEPTION=1 
-DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_FMOD=1 -DHAVE_S
TRTOL=1 -DHAVE_GETCWD=1 -DHAVE_STRERROR=1 -DHAVE_PUTENV=1 -DHAVE_RENAME=1 
-DHAVE_MKSTEMP=1 -DHAVE_STRCASECMP=1 -DHAVE_STRNCASECMP=1 -DHAVE
_STRSEP=1 -DHAVE_STRDUP=1 -DSYS_SIGLIST_DECLARED=1 
-I/usr/sources/cvs.netbsd.org/src/gnu/usr.bin/groff/hpftodit/../include 
-I/usr/sources/
cvs.netbsd.org/src/gnu/usr.bin/groff/hpftodit/../../../dist/groff/src/include 
-nostdinc -isystem /usr/tmp/acorn32-snapshot/usr/include  -c
 
/usr/sources/cvs.netbsd.org/src/gnu/usr.bin/groff/hpftodit/../../../dist/groff/src/utils/hpftodit/hpftodit.cc
/var/tmp/ccT0aLQB.s: Assembler messages:
/var/tmp/ccT0aLQB.s:765: Error: Value of 4294967296 too large for field of 4 bytes at 2536
/var/tmp/ccT0aLQB.s:836: Error: Value of 4294967392 too large for field of 4 bytes at 2808
/var/tmp/ccT0aLQB.s:904: Error: Value of 4294967548 too large for field of 4 bytes at 3000
/var/tmp/ccT0aLQB.s:978: Error: Value of 4294967344 too large for field of 4 bytes at 3248
/var/tmp/ccT0aLQB.s:1334: Error: Value of 4294967332 too large for field of 4 bytes at 4508
/var/tmp/ccT0aLQB.s:1336: Error: Value of 4294967752 too large for field of 4 bytes at 4516
/var/tmp/ccT0aLQB.s:1337: Error: Value of 4294967716 too large for field of 4 bytes at 4520
/var/tmp/ccT0aLQB.s:1338: Error: Value of 4294967728 too large for field of 4 bytes at 4524
/var/tmp/ccT0aLQB.s:1379: Error: Value of 4294967428 too large for field of 4 bytes at 4636
/var/tmp/ccT0aLQB.s:1407: Error: Value of 4294967440 too large for field of 4 bytes at 4716
/var/tmp/ccT0aLQB.s:1476: Error: Value of 4294967800 too large for field of 4 bytes at 4924
/var/tmp/ccT0aLQB.s:1524: Error: Value of 4294967404 too large for field of 4 bytes at 5072
/var/tmp/ccT0aLQB.s:1525: Error: Value of 4294967464 too large for field of 4 bytes at 5076
/var/tmp/ccT0aLQB.s:1560: Error: Value of 4294967452 too large for field of 4 bytes at 5176
/var/tmp/ccT0aLQB.s:1707: Error: Value of 4294967440 too large for field of 4 bytes at 5532
/var/tmp/ccT0aLQB.s:1831: Error: Value of 4294967764 too large for field of 4 bytes at 5968
/var/tmp/ccT0aLQB.s:2103: Error: Value of 4294967452 too large for field of 4 bytes at 6996
/var/tmp/ccT0aLQB.s:2114: Error: Value of 4294967584 too large for field of 4 bytes at 7048
/var/tmp/ccT0aLQB.s:2122: Error: Value of 4294967620 too large for field of 4 bytes at 7092
/var/tmp/ccT0aLQB.s:2123: Error: Value of 4294967632 too large for field of 4 bytes at 7096
*** Error code 1

Stop.

-----------


I tracked down the first one in the file near :

static
void check_type()
{
  require_tag(type_tag);
  if (tag_info(type_tag).value != 0) {
    if (tag_info(type_tag).value == 2)
      fatal("cannot handle TrueType tfm files");
    fatal("unknown type tag %1", int(tag_info(type_tag).value));
  }
}

with the following functions :

inline
entry &tag_info(tag_type t)
{ 
  return tags[t - min_tag];
}

and
  min_tag = 400,

and

static 

void require_tag(tag_type t)
{
  if (!tag_info(t).present)
    fatal("tag %1 missing", int(t));
}



its the int(tag_info(type_tag).value) thats breaking it ... it gets 
compiled into :



.............
.Lfe9:  
        .size    read_tags__FR4File,.Lfe9-read_tags__FR4File
        .align  2
.LC14:
        .ascii  "cannot handle TrueType tfm files\000"
        .align  2
.LC15:
        .ascii  "unknown type tag %1\000"
        .align  2
        .type    check_type__Fv,%function
check_type__Fv:
        @ args = 0, pretend = 0, frame = 12
        @ frame_needed = 1, current_function_anonymous_args = 0
        mov     ip, sp
        stmfd   sp!, {r4, r5, fp, ip, lr, pc}
        sub     fp, ip, #4
        mov     r0, #400
        ldr     r4, .L124
        sub     sp, sp, #12
        bl      require_tag__F8tag_type
        ldr     r3, [r4, #8]
        cmp     r3, #0
        beq     .L118
        cmp     r3, #2
        ldr     r5, .L124+4
        bne     .L120
        mov     r1, r5
        mov     r2, r5
        mov     r3, r5
        ldr     r0, .L124+8
        bl      fatal__FPCcRC6errargN21
.L120:
        ldr     r1, [r4, #8]
        sub     r4, fp, #32
        mov     r0, r4
        bl      __6errargi
        mov     r1, r4
        mov     r2, r5
        ldr     r0, .L124+12
        mov     r3, r2
        bl      fatal__FPCcRC6errargN21
        b       .L123
.L125:
        .align  2
.L124:
        .word   tags+4294967296	<=== obvious fault ... is this supposed to
                                     be a signed int/wrap ?? on 32 bits 
                                     processors this gets 2^32 => 0
        .word   empty_errarg
        .word   .LC14
        .word   .LC15
.L123:
.L118:
        ldmea   fp, {r4, r5, fp, sp, pc}
.Lfe10:
        .size    check_type__Fv,.Lfe10-check_type__Fv
        .align  2


--------

happy debugging! and thanks a lot in advance,

Cheers,
Reinoud