--- ./src/basic/ml/FStar_Compiler_Util.ml.orig	2021-08-24 00:25:27.000000000 -0600
+++ ./src/basic/ml/FStar_Compiler_Util.ml	2021-08-24 11:17:47.000000000 -0600
@@ -853,7 +853,10 @@
 let decr r = FStar_ST.(Z.(write r (read r - one)))
 let geq (i:int) (j:int) = i >= j
 
-let get_exec_dir () = Filename.dirname (Sys.executable_name)
+let get_exec_dir () =
+  (*  Unfortunately, OCaml does not expose realpath(3) *)
+  let bin_path = String.trim (List.hd (Process.read_stdout "@PREFIX@/bin/realpath" [| Sys.executable_name |])) in
+  Filename.dirname (bin_path)
 let expand_environment_variable x = try Some (Sys.getenv x) with Not_found -> None
 
 let physical_equality (x:'a) (y:'a) = x == y
