Hi! This patch ensures that any runtime-linker path is specified with the "-rpath" option in csc, then it is used when invoking "install_name_tool" to modify the runtime path in produced executables. Other platforms use "-Wl,-rpath" or similar, but on Mac OS this is done via said tool.
This also caused problems when running "make check" on Macs with an old installation still in the install-prefix: csc would invoke install_name_tool with the default prefix and thus any installed libchicken would be picked (instead of the new one just built). On Linux LD_LIBRARY_PATH takes care of that (and rpaths are not set by default). cheers, felix
From 9da58707e6ecf04a17cc514eb0dec15a97a2b45d Mon Sep 17 00:00:00 2001 From: felix <[email protected]> Date: Thu, 12 Dec 2024 14:54:16 +0100 Subject: [PATCH] csc: use -rpath option value when invoking postinstall program on mac os --- csc.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/csc.scm b/csc.scm index 3bdb205f..9ee459c9 100644 --- a/csc.scm +++ b/csc.scm @@ -971,9 +971,10 @@ EOF (list "-change" lib (if deployed (make-pathname "@executable_path" lib) - (make-pathname (if host-mode - host-libdir - TARGET_RUN_LIB_HOME) + (make-pathname (or rpath + (if host-mode + host-libdir + TARGET_RUN_LIB_HOME)) lib)) target-filename)))) (unless keep-files -- 2.42.0
