diff options
Diffstat (limited to 'lisp/loadup.el')
-rw-r--r-- | lisp/loadup.el | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lisp/loadup.el b/lisp/loadup.el index 568b9fe40df..f218ec1ff98 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -449,6 +449,34 @@ lost after dumping"))) ;; At this point, we're ready to resume undo recording for scratch. (buffer-enable-undo "*scratch*") +(when (boundp 'comp-ctxt) + ;; Fix the compilation unit filename to have it working when + ;; when installed or if the source directory got moved. This is set to be + ;; a pair in the form: (rel-path-from-install-bin . rel-path-from-local-bin). + (let ((h (make-hash-table :test #'eq)) + (bin-dest-dir (cadr (member "--bin-dest" command-line-args))) + (eln-dest-dir (cadr (member "--eln-dest" command-line-args)))) + (when (and bin-dest-dir eln-dest-dir) + (setq eln-dest-dir + (concat eln-dest-dir "native-lisp/" comp-native-version-dir "/")) + (mapatoms (lambda (s) + (let ((f (symbol-function s))) + (when (subr-native-elisp-p f) + (puthash (subr-native-comp-unit f) nil h))))) + (maphash (lambda (cu _) + (native-comp-unit-set-file + cu + (cons + ;; Relative path from the installed binary. + (file-relative-name (concat eln-dest-dir + (file-name-nondirectory + (native-comp-unit-file cu))) + bin-dest-dir) + ;; Relative path from the built uninstalled binary. + (file-relative-name (native-comp-unit-file cu) + invocation-directory)))) + h)))) + (when (hash-table-p purify-flag) (let ((strings 0) (vectors 0) @@ -538,6 +566,7 @@ lost after dumping"))) ;; Don't keep `load-file-name' set during the top-level session! ;; Otherwise, it breaks a lot of code which does things like ;; (or load-file-name byte-compile-current-file). +(setq load-true-file-name nil) (setq load-file-name nil) (eval top-level) |