Skip to content

Instantly share code, notes, and snippets.

@staticfloat
Created December 18, 2014 19:01
Show Gist options
  • Save staticfloat/9d5e3caeba8cb4d66e14 to your computer and use it in GitHub Desktop.
Save staticfloat/9d5e3caeba8cb4d66e14 to your computer and use it in GitHub Desktop.
diff --git a/src/dump.c b/src/dump.c
index 892a656..32dd4cb 100644
--- a/src/dump.c
+++ b/src/dump.c
@@ -1353,25 +1353,35 @@ extern void jl_get_uv_hooks();
DLLEXPORT
const char * jl_get_system_image_cpu_target(const char *fname)
{
+ printf("Entering jl_get_system_image_cpu_target()...\n");
// If passed NULL, don't even bother
if (!fname)
return NULL;
// First, get "sys" from "sys.ji"
+ printf(" strlen(fname): %d\n", strlen(fname));
+ printf(" fname: %s\n", fname);
char *fname_shlib = (char*)alloca(strlen(fname));
strcpy(fname_shlib, fname);
+
char *fname_shlib_dot = strrchr(fname_shlib, '.');
if (fname_shlib_dot != NULL)
*fname_shlib_dot = 0;
+ printf(" fname_shlib: %s\n", fname_shlib);
+
// Get handle to sys.so
uv_lib_t * sysimg_handle = jl_load_dynamic_library_e(fname_shlib, JL_RTLD_DEFAULT | JL_RTLD_GLOBAL);
// Return jl_sysimg_cpu_target if we can
- if (sysimg_handle)
- return (const char *)jl_dlsym(sysimg_handle, "jl_sysimg_cpu_target");
+ if (sysimg_handle) {
+ const char * jl_sysimg_cpu_target = (const char *)jl_dlsym(sysimg_handle, "jl_sysimg_cpu_target");
+ printf(" jl_sysimg_cpu_target: %s\n", jl_sysimg_cpu_target);
+ return jl_sysimg_cpu_target;
+ }
// If something goes wrong, return NULL
+ printf(" Couldn't open fname_shlib!\n");
return NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment