The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add caml_runtime_standard_library_default

Previously, the bytecode runtime just used OCAML_STDLIB_DIR from
build_config.h. This value is now stored once in dynlink.o as
caml_runtime_standard_library_default.

+14 -4
+4
runtime/caml/dynlink.h
··· 46 46 extern char_os * caml_parse_ld_conf(const char_os * stdlib, 47 47 struct ext_table * table); 48 48 49 + /* The default location of the Standard Library as used by the runtime to find 50 + ld.conf */ 51 + extern const char_os *caml_runtime_standard_library_default; 52 + 49 53 #endif /* CAML_INTERNALS */ 50 54 51 55 #endif /* CAML_DYNLINK_H */
+6 -1
runtime/dynlink.c
··· 58 58 /* The table of shared libraries currently opened */ 59 59 static struct ext_table shared_libs; 60 60 61 + /* The default location of the Standard Library as used by the runtime to find 62 + ld.conf */ 63 + const char_os *caml_runtime_standard_library_default = OCAML_STDLIB_DIR; 64 + 61 65 /* The search path for shared libraries */ 62 66 struct ext_table caml_shared_libs_path; 63 67 ··· 278 282 if (lib_path != NULL) 279 283 for (char_os *p = lib_path; *p != 0; p += strlen_os(p) + 1) 280 284 caml_ext_table_add(&caml_shared_libs_path, p); 281 - caml_parse_ld_conf(OCAML_STDLIB_DIR, &caml_shared_libs_path); 285 + caml_parse_ld_conf(caml_runtime_standard_library_default, 286 + &caml_shared_libs_path); 282 287 /* Open the shared libraries */ 283 288 caml_ext_table_init(&shared_libs, 8); 284 289 if (libs != NULL)
+4 -3
runtime/startup_byt.c
··· 379 379 const char_os * stdlib; 380 380 stdlib = caml_secure_getenv(T("OCAMLLIB")); 381 381 if (stdlib == NULL) stdlib = caml_secure_getenv(T("CAMLLIB")); 382 - if (stdlib == NULL) stdlib = OCAML_STDLIB_DIR; 382 + if (stdlib == NULL) stdlib = caml_runtime_standard_library_default; 383 383 return stdlib; 384 384 } 385 385 ··· 392 392 /* Print the runtime configuration */ 393 393 printf("version: %s\n", OCAML_VERSION_STRING); 394 394 printf("standard_library_default: %s\n", 395 - caml_stat_strdup_of_os(OCAML_STDLIB_DIR)); 395 + caml_stat_strdup_of_os(caml_runtime_standard_library_default)); 396 396 printf("standard_library: %s\n", 397 397 caml_stat_strdup_of_os(get_stdlib_location())); 398 398 printf("int_size: %d\n", 8 * (int)sizeof(value)); ··· 431 431 puts("shared_libs_path:"); 432 432 caml_decompose_path(&caml_shared_libs_path, 433 433 caml_secure_getenv(T("CAML_LD_LIBRARY_PATH"))); 434 - caml_parse_ld_conf(OCAML_STDLIB_DIR, &caml_shared_libs_path); 434 + caml_parse_ld_conf(caml_runtime_standard_library_default, 435 + &caml_shared_libs_path); 435 436 for (int i = 0; i < caml_shared_libs_path.size; i++) { 436 437 dir = caml_shared_libs_path.contents[i]; 437 438 if (dir[0] == 0)