unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: davide.restivo--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Andrea Corallo <akrl@sdf.org>
Cc: 45934@debbugs.gnu.org
Subject: bug#45934: native-comp - Dylib ID of ELN files not optimal
Date: Sat, 23 Jan 2021 17:13:23 +0100	[thread overview]
Message-ID: <14FA30A6-E8CC-4A7D-9F40-954515F814D9@yahoo.it> (raw)
In-Reply-To: <xjfim7vz5u6.fsf@sdf.org>

Ciao Andrea,

Please find below inline my answers. Sorry for the late reply :).

Regards,
Davide


> yes my question was on what the dylib ID is and what's is purpose.

A `dylib ID` a.k.a. `install_name` is the unique identifier that a library
provides to an executable that links against it. Once an executable
links against a library, the install_name values is stored in the linking
application and used at runtime to find the .dylib location.

Very important is that there cannot be, as far as I understood, two .dylib
loaded at the same time with the same dylib ID. I guess this was the
reason for the strange behaviour (unmapped .eln) we discussed
some time ago [1].

> Okay, we should be able to work it around but as anticipated only using
> GCC >= 9, that is indeed not very satisfactory.

Maybe you could conditionally enable the `install_name` support only if GCC >=9.
I will add a dependency in my Homebrew GNU/Emacs Formula to GCC-10, that
is anyway the Homebrew default.


> My question is: if is homebrew the owner of this build process shouldn't
> be its responsibility to keep the ID unique?

Unfortunately this is not the case since Homebrew simply change the dylib ID
basepath from `sandbox` to `installation directory`. I have already opened an
‘issue’ to homebrew core developers but they suggested to properly set the
install_name. Please see [2] and [3] for more insights.


> How do you work around this issue now?


What I have implemented as a workaround is the replacing of the original dylib ID
i.e. /private/tmp/libgccjit-3AyZly/fake.so with  <sandbox_path>/<filename>.eln.

Below the ruby code snippet.

```
        # Change .eln files dylib ID to avoid that after the
        # post-install phase all of the *.eln files end up with the
        # same ID. See: https://github.com/Homebrew/brew/issues/9526
        # and https://github.com/Homebrew/brew/pull/10075
        Dir.glob(contents_dir/"native-lisp/*/*.eln").each do |f|
          fo = MachO::MachOFile.new(f)
          ohai "Change dylib_id of ELN files before post_install phase"
          fo.dylib_id = "#{contents_dir}/" + f
          fo.write!
        end
      end
```


[1] https://github.com/daviderestivo/homebrew-emacs-head/issues/23#issuecomment-695175926
[2] https://github.com/Homebrew/brew/issues/9526
[3] https://github.com/Homebrew/brew/pull/10075




  reply	other threads:[~2021-01-23 16:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@yahoo.it>
2021-01-17 10:13 ` bug#45934: native-comp - Dylib ID of ELN files not optimal davide.restivo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-17 12:36   ` akrl--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-17 16:48     ` davide.restivo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-17 20:06       ` akrl--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-23 16:13         ` davide.restivo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-01-24 19:37           ` akrl--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-28 21:59           ` akrl--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-29  7:09             ` Eli Zaretskii
2021-01-29  8:52               ` akrl--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-30  8:18             ` davide.restivo--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-11 16:00               ` xgutter--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-30 12:32                 ` Lars Ingebrigtsen
2021-08-02 14:19                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-04  6:55                     ` Lars Ingebrigtsen
2021-08-04 18:11                       ` Alan Third
2021-08-05 10:54                         ` Lars Ingebrigtsen
2021-08-05 19:00                           ` Alan Third
2021-08-06 10:49                             ` Lars Ingebrigtsen
2021-08-06 16:37                               ` Alan Third
2021-08-07  9:52                                 ` Lars Ingebrigtsen
2021-08-07  9:57                                   ` Lars Ingebrigtsen
2021-08-07 10:25                                     ` Lars Ingebrigtsen
2021-08-07 13:11                                       ` Alan Third
2021-08-09 12:20                                         ` Lars Ingebrigtsen
2021-08-22 17:18                                           ` Davide Restivo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-22 19:40                                             ` Davide Restivo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-22 21:18                                               ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14FA30A6-E8CC-4A7D-9F40-954515F814D9@yahoo.it \
    --to=bug-gnu-emacs@gnu.org \
    --cc=45934@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=davide.restivo@yahoo.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).