aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-02-14 20:47:35 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-02-14 20:47:35 +0000
commit35ea42ebad66fbde760c2b699d14364475056eda (patch)
tree3a28beba9719e730346302bc491d8f1d652fef2c /libgo
parentd25b1e3a80b442b145cbcd57c234393a70ec4605 (diff)
downloadgcc-35ea42ebad66fbde760c2b699d14364475056eda.zip
gcc-35ea42ebad66fbde760c2b699d14364475056eda.tar.gz
gcc-35ea42ebad66fbde760c2b699d14364475056eda.tar.bz2
re PR go/48407 (libgo/configure --without-libffi doesn't work)
PR go/48407 runtime: Permit building libgo without libffi. From-SVN: r184234
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-reflect-call.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/libgo/runtime/go-reflect-call.c b/libgo/runtime/go-reflect-call.c
index a818dba..688c68e 100644
--- a/libgo/runtime/go-reflect-call.c
+++ b/libgo/runtime/go-reflect-call.c
@@ -8,13 +8,17 @@
#include <stdint.h>
#include <stdlib.h>
-#include "ffi.h"
+#include "config.h"
#include "go-alloc.h"
#include "go-assert.h"
#include "go-type.h"
#include "runtime.h"
+#ifdef USE_LIBFFI
+
+#include "ffi.h"
+
/* The functions in this file are only called from reflect_call. As
reflect_call calls a libffi function, which will be compiled
without -fsplit-stack, it will always run with a large stack. */
@@ -500,3 +504,20 @@ reflect_call (const struct __go_func_type *func_type, const void *func_addr,
free (call_result);
}
+
+#else /* !defined(USE_LIBFFI) */
+
+void
+reflect_call (const struct __go_func_type *func_type __attribute__ ((unused)),
+ const void *func_addr __attribute__ ((unused)),
+ _Bool is_interface __attribute__ ((unused)),
+ _Bool is_method __attribute__ ((unused)),
+ void **params __attribute__ ((unused)),
+ void **results __attribute__ ((unused)))
+{
+ /* Without FFI there is nothing we can do. */
+ runtime_throw("libgo built without FFI does not support "
+ "reflect.Call or runtime.SetFinalizer");
+}
+
+#endif /* !defined(USE_LIBFFI) */