Subject: bug#47558: 28.0.50; dlopen 'image not found' gccemacs native-lisp macos

From: Alan Third <[email-masked]>
Date: Fri, 2 Apr 2021 17:29:22 +0100

On Fri, Apr 02, 2021 at 08:46:35AM +0300, Eli Zaretskii wrote:
> > From: Bryan O'Brien <[email-masked]>
> > Date: Thu, 01 Apr 2021 20:36:43 -0500
> > 
> > 
> > Compiling gccemacs from latest git branch.
> > Emacs compiles with warnings but no errors.
> > Starting Emacs with fails with:
> > 
> > gccemacs/nextstep/Emacs.app/Contents/MacOS/Emacs -Q --debug-init
> > emacs:
> > dlopen(/Users/bobrien/src/gnu-emacs/28/gccemacs/nextstep/Emacs.app/Contents/MacOS/../native-lisp/28.0.50-2865d7b3/window-0d1b8b93-513ac8ca.eln, 1): image not found
> > 
> > Workaround is as follows:
> > 
> > cd ~/src/gnu-emacs/28/gccemacs/nextstep/Emacs.app/Contents
> > ln -s ~/src/gnu-emacs/28/gccemacs/native-lisp .
> 
> Do you understand the need for this workaround on macOS?  If so, can
> you explain what's going on here?

It looks to me like the "-D" flag for the install command isn't
available on macOS. I think the equivalent is "-d", which appears to
do something different again on GNU/Linux.

Line 752 of Makefile.in:

### Install native compiled Lisp files.
install-eln:
ifeq ($(HAVE_NATIVE_COMP),yes)
	find native-lisp -type f -exec ${INSTALL_DATA} -D "{}" "$(ELN_DESTDIR){}" \;
endif
                                                       ^^
-- 
Alan Third