From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: davide.restivo--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#45934: native-comp - Dylib ID of ELN files not optimal Date: Sat, 23 Jan 2021 17:13:23 +0100 Message-ID: <14FA30A6-E8CC-4A7D-9F40-954515F814D9@yahoo.it> References: <34A641C2-F9E7-487F-8998-D0BC416402FB@yahoo.it> Reply-To: Davide Restivo Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34982"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45934@debbugs.gnu.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 23 17:14:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3LYG-0008yW-Ip for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 17:14:16 +0100 Original-Received: from localhost ([::1]:43066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3LYF-0003yN-9W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 11:14:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3LY3-0003yG-Ny for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 11:14:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3LY2-0005E0-FJ for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 11:14:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l3LY2-0000Nc-AM for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 11:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Davide Restivo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jan 2021 16:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45934 X-GNU-PR-Package: emacs Original-Received: via spool by 45934-submit@debbugs.gnu.org id=B45934.16114184191422 (code B ref 45934); Sat, 23 Jan 2021 16:14:02 +0000 Original-Received: (at 45934) by debbugs.gnu.org; 23 Jan 2021 16:13:39 +0000 Original-Received: from localhost ([127.0.0.1]:35051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3LXe-0000Ms-S7 for submit@debbugs.gnu.org; Sat, 23 Jan 2021 11:13:39 -0500 Original-Received: from sonic310-24.consmr.mail.ne1.yahoo.com ([66.163.186.205]:40058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3LXc-0000Md-9i for 45934@debbugs.gnu.org; Sat, 23 Jan 2021 11:13:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s2048; t=1611418410; bh=DD01nMn+eH7RwrF8a7uckhOocfhJvnIFC5xwjvFvuyw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=ZMCgzkJXuc6vTt13maT5zySrKv67HkBncayxkKg7kdO1iVDRi3Fbd8Fy2bIQtSwlOmUegD9CZ9Cax9M5hqpoDRyX3p8PL+3IIbkRojF41TJsRrnXnxbQqae/y/D9pmAbtlh6uulhZpfHGMUTclFnQ//JhfDsxFYf+pGdp1K6t8cTZjLUm2DbPOQ4ytntHPL/bYfQjgcxBCEsNxi7BpMVsHZJx2LOCVabfl63i6iLEwAakaLa/VqoepSOxM0l2YmcLIgTd9WYQ2IBVR5AUnSWVfV15z9zAiZk72yTx+VZ38fUYW6rB5R/Vf14MngXrmnkpk7C6t0pEwPIM7HkmYMipw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1611418410; bh=/ZDWkhKb485ApGAH1GY1lnzvzBgnAX9ZyESy6rCg3NY=; h=Subject:From:Date:To:From:Subject:Reply-To; b=k0Gw0X2RfidXRMcwUTE8fgODp9SOw0K1FDMTrhS4aMdBcDH64zwKqQMnmw1J6/4ukRx8RuTaArjGXGzFCKPY/aeiLLhB7f+hCI4RE66Fc/dGvFvhEsJloy3cufljp7pY2hyR7PFZIQPYGhnjEz+oFTJmRD6i199fVKVAIN0UnIzr90Qof0+In864PBxodFQ5H1+l8HoDvfThgiDrHIB3oxXiB1xvtAWx5xtI70vPAD14bZPdGcDHFvuks7uS3KyWU3NyHgjt0eDn3KfgIc+ddvwieJUpHp/fXUOkOOYzQ3NO/nwYapnu+OpSA4lEG5hsvIhF//RFJLXMibsfts+qqg== X-YMail-OSG: OLfBcMMVM1lmINZK8w1nIF0tWvxWP1nyXF5fzD21xDs_UpMc.fzUNGbKzEXn0pF shGnWubqItReyx21uVWs21XdWfVaAcSlUWI7.b4CGpNLYbLj1JuZNpmS5LAdAxyd_m_1j8Hx7zZy 85soVHpbP6NlTYSe0sglp0pCi4cvrM7GkgNDq_MKGiEAgBuy1n5gwWltNmXW.iMJHpu9xbiYT.6z GiyNfDTS47eh6ZWd8XSM4snxsAzL4A8X4k7gVF29wmq9zyXT.tVNNaunOC8TSi.vZFVj9yFwre1G GUskiK1z9kF2PArDfFmWMBntv3TsjwiP8BjSvRb2ILJPinYonlN4ZHDNsy7FWajIaLUuKtX3y.fk KJXHqiVpZzy.OzH7DZMINeTU4GG4dIecuAjBSzUA2KYuhuQwVzfZGxcToOLNXLGQfoSSwqAknjS_ f9PYckXxMT9Wp65SGKeTOH_2v.VlKl.hXRzfLucrxHZmf9ZnMxEa2hdIJS1VD5vRqFrBaOIyy_Pz GxKwcW1C5NoTtej7KpF4NLt7OH3zqfpFWPGXXEdNcUEIK_oQEOIWU7mU.M5RSNEPAv37A.PJLVLY yVKcOq3UAj8653ZVK4Df7kbFRne1VgFxE8ABwDqZ9mWOD0dAsUwcPu0KIfpkHV2EXjTnwjZ8babB XbPU34QevfIvYGWjwkfDUdf.FGzw9kDevpIDJyrAyX5Ko5lHIu3NjLpF7FiMbWQwpzf0ok.t2y15 3HFR06H2TjwVCnV_gsnb9.r0MXNQVCHNtdKu3pC2rz530JR2GbVyGBJaGD9c8MKBwkxdqjO0Gc1o b5Y.MRaroD.970VrFBdcodnYhfB0Bxy7YTrIomvJtS Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sat, 23 Jan 2021 16:13:30 +0000 Original-Received: by smtp414.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 054b55368eca5178bf27ca397cb7b1ed; Sat, 23 Jan 2021 16:13:26 +0000 (UTC) In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:198433 Archived-At: 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 >=3D 9, that is indeed not very satisfactory. Maybe you could conditionally enable the `install_name` support only if = GCC >=3D9. 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 =E2=80=98issue=E2=80=99 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 = /.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 =3D MachO::MachOFile.new(f) ohai "Change dylib_id of ELN files before post_install phase" fo.dylib_id =3D "#{contents_dir}/" + f fo.write! end end ``` [1] = https://github.com/daviderestivo/homebrew-emacs-head/issues/23#issuecommen= t-695175926 [2] https://github.com/Homebrew/brew/issues/9526 [3] https://github.com/Homebrew/brew/pull/10075=