This is the mail archive of the
libffi-discuss@sources.redhat.com
mailing list for the libffi project.
3.0.1 PATCH: Avoid gas-only mnemonic in libffi for Alpha
- To: libffi-discuss at sources dot redhat dot com, gcc-patches at gcc dot gnu dot org
- Subject: 3.0.1 PATCH: Avoid gas-only mnemonic in libffi for Alpha
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Fri, 13 Jul 2001 20:18:04 +0200 (MEST)
- Cc: Albert Chin-A-Young <china at thewrittenword dot com>, Jeff Sturm <jsturm at one-point dot com>, "Anthony Green" <green at redhat dot com>
Despite two suggestions to fix this
http://gcc.gnu.org/ml/gcc/2001-06/msg01536.html
http://gcc.gnu.org/ml/gcc-patches/2001-06/msg01523.html
nothing has happened yet to allow libffi to compile on Tru64 UNIX. The
following patch allows to compile libffi/src/alpha/ffi.c on Tru64 UNIX
(both V4.0F and V5.1) and explains what's happening.
ffitest passes on V4.0F, but SEGVs in ffitest.c (ldblit), but this is
certainly not related to this patch, but to the fact that long double is
128 bits on V5.1 vs. 64 bits on V4.0, so libffi's long double handling
seems to be in error.
Ok for branch and mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
Fri Jul 13 20:06:04 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic.
Fixes PR bootstrap/3563.
===================================================================
RCS file: libffi/src/alpha/RCS/ffi.c,v
retrieving revision 1.1
diff -up -r1.1 libffi/src/alpha/ffi.c
--- libffi/src/alpha/ffi.c 2000/12/10 07:13:18 1.1
+++ libffi/src/alpha/ffi.c 2001/07/13 18:00:06
@@ -168,8 +168,13 @@ ffi_prep_closure (ffi_closure* closure,
closure->fun = fun;
closure->user_data = user_data;
- /* Flush the Icache. */
- asm volatile ("imb" : : : "memory");
+ /* Flush the Icache.
+
+ Tru64 UNIX as doesn't understand the imb mnemonic, so use call_pal
+ instead, since both Compaq as and gas can handle it.
+
+ 0x86 is PAL_imb in Tru64 UNIX <alpha/pal.h>. */
+ asm volatile ("call_pal 0x86" : : : "memory");
return FFI_OK;
}