Skip to content

Commit

Permalink
Fix llvm loading when calling through a symlink.
Browse files Browse the repository at this point in the history
	mini-llvm.h: When trying to load mono from ./.libs or ../lib we did not
	resolve the current binary for symlinks. This failed on OSX since
	everyone calls /usr/bin/mono while libmono-llvm was on
	/Library/Frameworks/Mono.framework/Versions/Current/lib.

	This make mono --llvm work on release mono.
  • Loading branch information
kumpera committed Apr 8, 2013
1 parent 60f89d9 commit 87b9278
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mono/mini/mini-llvm.h
Expand Up @@ -106,9 +106,10 @@ mono_llvm_load (const char* bpath)
#endif
if (binl != -1) {
char *base;
char *name;
char *resolvedname, *name;
buf [binl] = 0;
base = g_path_get_dirname (buf);
resolvedname = mono_path_resolve_symlinks (buf);
base = g_path_get_dirname (resolvedname);
name = g_strdup_printf ("%s/.libs", base);
err = NULL;
llvm_lib = try_llvm_load (name, &err);
Expand All @@ -121,6 +122,7 @@ mono_llvm_load (const char* bpath)
g_free (name);
}
g_free (base);
g_free (resolvedname);
}
if (!llvm_lib) {
llvm_lib = try_llvm_load (NULL, &err);
Expand Down
1 change: 1 addition & 0 deletions mono/mini/mini.c
Expand Up @@ -54,6 +54,7 @@
#include <mono/utils/mono-counters.h>
#include <mono/utils/mono-logger-internal.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-path.h>
#include <mono/utils/mono-tls.h>
#include <mono/utils/dtrace.h>

Expand Down

0 comments on commit 87b9278

Please sign in to comment.