bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45934: native-comp - Dylib ID of ELN files not optimal


From: Davide Restivo
Subject: bug#45934: native-comp - Dylib ID of ELN files not optimal
Date: Sun, 17 Jan 2021 11:13:25 +0100

Hi, 

I'm currently maintaining an Homebrew formula [1] for GNU/Emacs on macOS
and I have recently added to it support for the native-comp feature.
While doing this I have realised that current dylib IDs of the ELN files
might be improved to avoid an issue I have encountered.

Currently whenever and ELN file is generated, the dylib ID has the
following structure: /private/tmp/libgccjit-xxxxxx/fake.so. See below
examples:

Example_1:
Filename:  
   
/usr/local/Cellar/emacs-head@28/28.0.50_1/Emacs.app/Contents/native-lisp/28.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/4Corner-80465fd1980e15f97a4c37918242ae86-c113fb0ce90e32f79bf944d3da555eea.eln
dylib ID: 
  /private/tmp/libgccjit-3AyZly/fake.so

Example_2:
Filename:  
   
/usr/local/Cellar/emacs-head@28/28.0.50_1/Emacs.app/Contents/native-lisp/28.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/5x5-a61d71cfcb41ac534af48635fb74337a-d665a8dec895c4d242614826b692b6ba.eln
dylib ID: 
  /private/tmp/libgccjit-aVl48M/fake.so

The dylib IDs of two different ELN are unique (this is required by
macOS).

Homebrew compiles GNU/Emacs in a 'sandbox' directory and then it moves
 the artifacts to the final directory location (i.e.
 /usr/local/Cellar/emacs-head@28/28.0.50_1). While doing that it changes
 the dylib ID of the ELN files. For example:

==> Changing dylib ID of 
/usr/local/Cellar/emacs-head@28/28.0.50_1/Emacs.app/Contents/native-lisp/28.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/4Corner-80465fd1980e15f97a4c37918242ae86-c113fb0ce90e32f79bf944d3da555eea.eln
  from /private/tmp/libgccjit-3AyZly/fake.so
    to 
/usr/local/opt/emacs-head@28/Emacs.app/Contents/native-lisp/28.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/fake.so

==> Changing dylib ID of 
/usr/local/Cellar/emacs-head@28/28.0.50_1/Emacs.app/Contents/native-lisp/28.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/5x5-a61d71cfcb41ac534af48635fb74337a-d665a8dec895c4d242614826b692b6ba.eln
  from /private/tmp/libgccjit-aVl48M/fake.so
    to 
/usr/local/opt/emacs-head@28/Emacs.app/Contents/native-lisp/28.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/fake.so

Since the tmp directory is stripped out and replaced with the
destination directory, as you can see, all of the ELN files ends up with
the same dylib ID, and this is not allowed on macOS. My suggestion here
would be to add the 'install_name' [2] flag to gcc during the ELN files
compilation replacing the 'fake.so' with the original .eln filename.

Thanks and regards,
Davide


[1] https://github.com/daviderestivo/homebrew-emacs-head
[2] gcc -o libdummy.dylib -install_name ${PREFIX}/lib/libdummy.dylib 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]