Subject: [PATCH] #52292

From: No Wayman <[email-masked]>
Date: Wed, 11 May 2022 00:23:42 -0400

The solution for this seems simple enough, but I'm not sure 
exactly where it should be placed.
In any case, here's a patch which may solve the problem.
Offering it in hopes that someone more knowledgeable in this area 
can step in and apply the actual fix.

>From 1c78d0dd6b197986c660d0f82a7ccd93b2bbb712 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <[email-masked]>
Date: Wed, 11 May 2022 00:16:45 -0400
Subject: [PATCH] autoload.el: Don't use file truename for symlinked autoloads

* lisp/emacs-lisp/autoload.el (autoload-find-generated-file): Bind
find-file-true-visit-truename to nil.  Otherwise the output file may
resolve to a relative path when the file it is based off of is
symlinked (bug #52292).
---
 lisp/emacs-lisp/autoload.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 1e4b2c14a0..23e34ddad0 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -282,6 +282,7 @@ autoload-find-generated-file
   (let ((enable-local-variables :safe)
         (enable-local-eval nil)
         (find-file-hook nil)
+        (find-file-visit-truename nil)
         (delay-mode-hooks t))
     ;; We used to use `raw-text' to read this file, but this causes
     ;; problems when the file contains non-ASCII characters.
-- 
2.36.0