Hi again, Ok I think I've found my mistake - the rc type wasnt large enough to hold 64bit of data. ffi_arg seems to be 32bit on 32bit systems.. should have known, I fixed my code accordingly. I also fixed my bug regarding custom struct handling, it works now on multiple arch's (i386, amd64, parisc, arm). :) However, feel free to pass along helpful advice regarding my testing code and/or regarding porting libffi to parisc64. Am 13.04.19 um 20:26 schrieb Georg Bege: > Hello guys, > > Im recently tinkering with PARISC machines which I've left. > I've got two of them, one with HPUX 11iv1 (old, I know) and one with Linux. > > According to the libffi main page, HPPA is indeed supported (not on > Linux, but this is outdated?). > I've written a simple test code, in order to sanity check libffi's basic > functionality. > > This code is working fine on i386 and amd64.. just for reference. > My main goal is getting libffi working (eg. ported) to HPUX LP64... I've > began consulting the proper documents from HP and learning a bit of > PARISC asm.. but Im still at the beginning. > > Right now, I wanted to confirm the functionality which is obviously > existing... > The first try I've given is on the C8k with Gentoo Linux: > > Linux hppa 4.9.49-gentoo-r1-hppa64 #4 SMP Fri Jun 8 19:33:13 CEST 2018 > parisc64 PA8900 (Shortfin) 9000/785/C8000 GNU/Linux > > therion@hppa ~ $ qlist -Iv libffi > dev-libs/libffi-3.2.1 > virtual/libffi-3.0.13-r1 > > So far so good... I've this installation now for a while... > The thing is that my test code is failing with 64bit signed integers. > > Im hoping that any of you may look into it, or can lend me a hand - was > this ever supposed to work? Is it actually working? > My test code is buggy? If so which part? :) > > Since it's just test I'll attach my code here. > > Output: > ---------------snip-------------------- > therion@hppa ~ $ ./test-ffi > Signed 8bit integer result:    126 > Unsigned 8bit integer result:    254 > Signed 16bit integer result:    32766 > Unsigned 16bit integer result:    65534 > Signed 32bit integer result:    2147483646 > Unsigned 32bit integer result:    4294967294 > Signed 64bit integer result:    0, expected: 2147483646 > test-ffi: test-ffi.c:151: main: Assertion `*src == result' failed. > Aborted > ---------------snip-------------------- > > best regards, -- Georg Bege Mail: georg@bege.email XMPP: therion@ninth-art.de IRC: megaTherion @ Freenode