Sat 11 Feb 2017 02:47:20 PM UTC, comment #15:
Additional fixes for sparc64 have now been delivered:
http://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=commit;h=2aad1e1919771a2d9f43848ccebd86564ea79ae0
http://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=commit;h=f3357dcc41dd917842ff7adeb8aa1d1d892471ae
http://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=commit;h=e1e9beccee008f0914628c2bfe50685882636ccd
http://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=commit;h=1f42eb80cc44457bfb673542b1a26e73c7bdb0b7
|
Tue 20 Jul 2010 08:52:29 PM UTC, comment #14:
committed.
thanks!
|
Tue 20 Jul 2010 06:57:42 PM UTC, comment #13:
And you want the same in callback/trampoline_r too. The test doesn't get SIGBUS after that, but still fails (Linux/sparc64, 64-bit). I don't have time to investigate. It work on NetBSD and Solaris.
-uwe
|
Tue 20 Jul 2010 06:53:53 PM UTC, comment #12:
I mean, if you add that snippet to trampoline.c - it works. But that was just a quick check, instead you probably want to use something like the /CPU/ block at the top of avcall.h.in and then configure will take care to define _sparc64_ for you if it's not defined.
-uwe
|
Tue 20 Jul 2010 05:58:26 PM UTC, comment #11:
I don't see the snippet you mention in comment #9 anywhere.
in fact, the only places where arch64 is mentioned
are the configure files.
|
Tue 20 Jul 2010 04:18:26 PM UTC, comment #10:
The following is from my old notes. Pasting it here as-is for the record.
gcc versions prior to gcc3.4 have an ABI bug that affects passing small structs with a 'float' member in registers. I've fixed the code to comply to ABI, but it fails passing 'Float' tests with gcc3.3.3 that we have in-tree. [uwe: "we" == NetBSD and the year is 2005]
retrning small structs with fp members doesn't work, as fp members are returned in fp regs and the generic avcall code doesn't know what members of the structure are, so it doesn't know if it should pick the result from fp or from integer registers [uwe: this makes two extracheck tests fail on systems that pass structs in registers, all tests work on solaris that doesn't do that]
-uwe
|
Tue 20 Jul 2010 03:24:15 PM UTC, comment #9:
Linux/sparc64 failure in trampoline is in sparc (32-bit code).
I noticed that gcc there doesn't define _sparc64_ (only _arch64_), so wrong code gets compiled even with -m64. With
#if defined(_sparc_) && defined(_arch64_) && !defined(_sparc64_)
#define _sparc64_ 1
#endif
it works.
avcall.h.in already seems to have necessary magic, that just needs to be duplicated in trampoline/config.h.in I guess.
-uwe
|
Tue 20 Jul 2010 03:14:37 PM UTC, comment #8:
could you please try to fix Linux/sparc64 trampoline?
|
Tue 20 Jul 2010 03:00:24 PM UTC, comment #7:
FWIW, on NetBSD/sparc64 cvs head with my patches passes make check completely, including trampoline.
-uwe
|
Tue 20 Jul 2010 01:40:24 AM UTC, comment #6:
I've tried my patches on Linux/sparc64 against the cvs snapshot they were originally created for and everything works just fine, so the trampoline problem is "recent" (and my patches don't touch trampoline anyway).
Judging by CVS/Entries timestamps that cvs snapshot corresponds to the cvs head as of early March 12, 2008.
-uwe
|
Tue 20 Jul 2010 01:15:00 AM UTC, comment #5:
Linux/sparc64 compiler compiles to 32-bit by default, so you are using sparc files not sparc64. Configure with CC="gcc -m64" and you will see the compilation errors quoted in the bug description.
With my patches it compiles and passes make check in avcall and vacall, but trampoline/test1 gets bus error (just tried it, so haven't done any investigation yet).
Program received signal SIGBUS, Bus error.
alloc_trampoline (address=0x100840 <f>, variable=0x2011c8, data=0x2011a8)
at ./trampoline.c:656
656 (long ) (function + 4) = 0x05000000 | hi(data);
(gdb) p function
$1 = 0x202020 ""
-uwe
|
Wed 14 Jul 2010 03:56:40 PM UTC, comment #4:
on Linux deluxe 2.6.26-2-sparc64-smp #1 SMP Tue Mar 9 23:01:40 UTC 2010 sparc64 GNU/Linux
(gcc63 http://gcc.gnu.org/wiki/CompileFarm)
these patches are not needed (ffcall works OOTB, passes "make check").
however, the tests are passed with the patches too.
|
Tue 13 Jul 2010 09:45:56 PM UTC, comment #3:
on gcc64 (http://gcc.gnu.org/wiki/CompileFarm):
$ diff -u minitests.out minitests.output.sparc64-unknown-openbsd4.6
--- minitests.out Tue Jul 13 23:44:49 2010
+++ minitests.output.sparc64-unknown-openbsd4.6 Tue Jul 13 23:44:49 2010
@@ -1,7 +1,3 @@
-void f(void):
-void f(void):
-int f(void):->99
-int f(void):->99
int f(int):(1)->2
int f(int):(1292)->1293
int f(2*int):(1,2)->3
|
Tue 13 Jul 2010 05:44:55 PM UTC, comment #2:
thanks for the patch.
I can build libffcall with it on
OpenBSD loulou.esiee.fr 4.6 GENERIC#43 sparc64
with gcc (GCC) 3.3.5 (propolice)
but the tests fail:
cd avcall && make check
gcc -g -O2 -I. -I../../avcall -c ../../avcall/minitests.c
/bin/sh ./libtool --mode=link gcc -g -O2 -x none minitests.o libavcall.la -o minitests
gcc -g -O2 -x none minitests.o -o minitests ./.libs/libavcall.a
./minitests > minitests.out
LC_ALL=C uniq -u < minitests.out > minitests.output.sparc64-unknown-openbsd4.6
test '!' -s minitests.output.sparc64-unknown-openbsd4.6
Stop in /home/sds/top/src/ffcall/build-OpenBSD-sparc64/avcall (line 210 of Makefile).
Stop in /home/sds/top/src/ffcall/build-OpenBSD-sparc64 (line 47 of Makefile).
does the test succeed for you?
|
Thu 09 Oct 2008 08:15:19 PM UTC, comment #1:
I've attached sparc64 fixes that were tested under NetBSD/sparc64 with gcc4 and under Solaris with Sun C 5.9
Summary of changes:
. avcall/asmsparc64.sh
Delete .type declaration from the .S file, if one is needed
DECLARE_FUNCTION will supply it.
The same change needs to be applied to asmsparc64.sh in other
directories (all other sparc64 .S files have that extra .type
line), but as I was not regenerating .S files in those dirs, I
haven't touched their scripts.
. avcall/avcall-sparc64.c
avcall/avcall.h.in
NetBSD now comes with gcc4 which is quite agressive at eliminating
unused stuff, so I had to modify my original patch to address
this.
Kill callee (%g2). Sparc64 doesn't need that code. Come to think
of it trampoline[] should be killed to for the same reason. but I
forgot about it. gcc optimizes it away anyway :)
Delete space[] - gcc optimizes it away anyway, and it doesn't
guarantee correct operation even if it's not removed - if compiler
allocs it below other local vars on the stack, then calling
function with enough arguments will clobber local vars.
Instead i've changed the code to use alloca, see the comment in
the code for details on why this works. It also doesn't waste 2K
of stack on each call, we only grab the space we actually need.
I nuked farg_mask. It's not necessary for float args, marking
them in darg_mask does the right thing (new av_float). And they
just hurt structure passing, where, again, marking up darg_mask
does the right thing.
. avcall/avcall-saprc64.S
Regenerated with NetBSD gcc4. Attached as a separate file to not
pollute the patch.
. vacall/vacall-sparc64.S
callback/vacall_r/vacall-sparc64.S
New binutils on sparc64 insist on having global registers properly
declared with .register. I've just added the declarations
manually w/out actually regenerating the files to demonstrate
that's the only change needed there. IF the files are regenerated
with a newer compiler you will get them automatically.
I'm not sure if there are still any assemblers in wide circulation
that don't understand .register. I wonder if anyone is crazy
enough to still actively use a.out on sparc64.
-uwe@netbsd
|
Tue 22 Jan 2008 08:04:21 PM UTC, original submission:
http://sourceforge.net/tracker/index.php?func=detail&aid=952681&group_id=1355&atid=101355
SunOS monty-burns 5.8 Generic_108528-24 sun4u sparc
SUNW,Sun-Blade-1000
gcc (GCC) 3.2.2
CC="gcc -m64" ./configure --build
gcc -m64 -E `if test false = true; then echo
'-DASM_UNDERSCORE'; fi` ../../ffcal
l/avcall/avcall-sparc64.S | grep -v '^ *#line' | grep
-v '^#' | sed -e 's,% ,%,g
' -e 's,//.*$,,' -e 's,\$,#,g' > avcall-sparc64.s
/bin/sh ./libtool --mode=compile gcc -m64 -x none -c
avcall-sparc64.s
gcc -m64 -x none -c avcall-sparc64.s -o avcall-sparc64.o
/usr/ccs/bin/as: "avcall-sparc64.s", line 2: error:
.version "01.01" greater tha
n assembler version ""
/usr/ccs/bin/as: "avcall-sparc64.s", line 13: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 15: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 15: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 15: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 15: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 17: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 17: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 19: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 19: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 19: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 19: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 21: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 21: error:
detect global register use
not covered .register pseudo-op
&c
/usr/ccs/bin/as: "avcall-sparc64.s", line 927: error:
detect global register use
not covered .register pseudo-op
/usr/ccs/bin/as: "avcall-sparc64.s", line 928: error:
detect global register use
not covered .register pseudo-op
make: Fatal error: Command failed for target
`avcall-sparc64.lo'
|