libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp
libmono_llvm_la_LIBADD = $(LLVM_LIBS) $(LLVM_LDFLAGS)
if PLATFORM_DARWIN
-libmono_llvm_la_LDFLAGS=-undefined suppress
+libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
else
libmono_llvm_la_LIBADD += $(top_builddir)/mono/mini/libmono-$(API_VER).la $(libs)
endif
switch (ainfo->storage) {
case LLVMArgInIReg:
case LLVMArgInFPReg: {
- MonoType *t = (sig->hasthis && i == 0) ? &mono_defaults.int_class->byval_arg : sig->params [i - sig->hasthis];
+ MonoType *t = (sig->hasthis && i == 0) ? &mono_get_intptr_class ()->byval_arg : sig->params [i - sig->hasthis];
if (!t->byref && (t->type == MONO_TYPE_R8 || t->type == MONO_TYPE_R4)) {
MONO_INST_NEW (cfg, ins, OP_FMOVE);
int mono_llvm_load (const char* bpath) MONO_INTERNAL;
#ifdef MONO_LLVM_IN_MINI
+
+#ifdef __MACH__
+#include <mach-o/dyld.h>
+#endif
+
typedef void (*MonoLLVMVoidFunc)(void);
typedef void (*MonoLLVMCFGFunc)(MonoCompile *cfg);
typedef void (*MonoLLVMEmitCallFunc)(MonoCompile *cfg, MonoCallInst *call);
char buf [4096];
int binl;
binl = readlink ("/proc/self/exe", buf, sizeof (buf)-1);
+#ifdef __MACH__
+ if (binl == -1) {
+ uint32_t bsize = sizeof (buf);
+ if (_NSGetExecutablePath (buf, &bsize) == 0) {
+ binl = strlen (buf);
+ }
+ }
+#endif
if (binl != -1) {
char *base;
char *name;
buf [binl] = 0;
base = g_path_get_dirname (buf);
name = g_strdup_printf ("%s/.libs", base);
- g_free (base);
err = NULL;
llvm_lib = try_llvm_load (name, &err);
g_free (name);
+ if (!llvm_lib) {
+ char *newbase = g_path_get_dirname (base);
+ name = g_strdup_printf ("%s/lib", newbase);
+ err = NULL;
+ llvm_lib = try_llvm_load (name, &err);
+ g_free (name);
+ }
+ g_free (base);
}
if (!llvm_lib) {
llvm_lib = try_llvm_load (NULL, &err);