GNU bug report logs - #45934
native-comp - Dylib ID of ELN files not optimal

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Davide Restivo <davide.restivo@HIDDEN>; dated Sun, 17 Jan 2021 10:45:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 45934 <at> debbugs.gnu.org:


Received: (at 45934) by debbugs.gnu.org; 29 Jan 2021 07:09:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 29 02:09:20 2021
Received: from localhost ([127.0.0.1]:51015 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l5NuC-0006h2-8g
	for submit <at> debbugs.gnu.org; Fri, 29 Jan 2021 02:09:20 -0500
Received: from eggs.gnu.org ([209.51.188.92]:34416)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1l5NuA-0006gq-Gf
 for 45934 <at> debbugs.gnu.org; Fri, 29 Jan 2021 02:09:18 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:33579)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1l5Nu4-00080m-SQ; Fri, 29 Jan 2021 02:09:12 -0500
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1501
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1l5Nu4-0000QS-4o; Fri, 29 Jan 2021 02:09:12 -0500
Date: Fri, 29 Jan 2021 09:09:29 +0200
Message-Id: <83v9bgxlqu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Andrea Corallo <akrl@HIDDEN>
In-Reply-To: <xjfo8h8vi2z.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#45934: native-comp - Dylib ID of ELN files not optimal
References: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@HIDDEN>
 <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN>
 <xjfy2grzqo6.fsf@HIDDEN>
 <34A641C2-F9E7-487F-8998-D0BC416402FB@HIDDEN>
 <xjfim7vz5u6.fsf@HIDDEN>
 <14FA30A6-E8CC-4A7D-9F40-954515F814D9@HIDDEN> <xjfo8h8vi2z.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45934
Cc: davide.restivo@HIDDEN, 45934 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> Date: Thu, 28 Jan 2021 21:59:16 +0000
> Cc: 45934 <at> debbugs.gnu.org
> From: akrl--- via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> +/* On MacOS set a unique dylib ID (Bug#45934). */
> +#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \
> +  && defined (DARWIN_OS)
> +  gcc_jit_context_add_driver_option (
> +    comp.ctxt,
> +    SSDATA (concat2 (build_string ("-install_name "),
> +		     Ffile_name_nondirectory (filename))));
> +#endif

A minor nit unrelated to the issue at hand: if you take care to
mention the bug number in the commit log message, there's no need to
do that in the comments.

In general, I don't think it's a good idea to have our sources full of
references to bug reports; if the comment by itself doesn't explain
the underlying issue, it is better to enhance the comment to be
self-contained.  IMO, a reference to a bug in the comments is only
justified when the issue is so complicated to explain that having such
an explanation in comments is impractical.

TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45934; Package emacs. Full text available.

Message received at 45934 <at> debbugs.gnu.org:


Received: (at 45934) by debbugs.gnu.org; 28 Jan 2021 21:59:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 28 16:59:20 2021
Received: from localhost ([127.0.0.1]:50470 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l5FJw-0005oA-CZ
	for submit <at> debbugs.gnu.org; Thu, 28 Jan 2021 16:59:20 -0500
Received: from mab.sdf.org ([205.166.94.33]:55028 helo=ma.sdf.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akrl@HIDDEN>) id 1l5FJu-0005o2-D8
 for 45934 <at> debbugs.gnu.org; Thu, 28 Jan 2021 16:59:19 -0500
Received: from akrl by ma.sdf.org with local (Exim 4.92)
 (envelope-from <akrl@HIDDEN>)
 id 1l5FJs-00031b-Ui; Thu, 28 Jan 2021 21:59:16 +0000
From: Andrea Corallo <akrl@HIDDEN>
To: Davide Restivo <davide.restivo@HIDDEN>
Subject: Re: bug#45934: native-comp - Dylib ID of ELN files not optimal
References: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@HIDDEN>
 <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN>
 <xjfy2grzqo6.fsf@HIDDEN>
 <34A641C2-F9E7-487F-8998-D0BC416402FB@HIDDEN>
 <xjfim7vz5u6.fsf@HIDDEN>
 <14FA30A6-E8CC-4A7D-9F40-954515F814D9@HIDDEN>
Date: Thu, 28 Jan 2021 21:59:16 +0000
In-Reply-To: <14FA30A6-E8CC-4A7D-9F40-954515F814D9@HIDDEN> (Davide Restivo's
 message of "Sat, 23 Jan 2021 17:13:23 +0100")
Message-ID: <xjfo8h8vi2z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 45934
Cc: 45934 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Ciao Davide,

could you give it a try with the following blind patch? (can't test it
my-self).

Thanks

  Andrea


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-On-MacOS-set-a-unique-dylib-ID-Bug-45934.patch

From c4990edcea51e273452e13a4b9b98549aa62a508 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <akrl@HIDDEN>
Date: Thu, 28 Jan 2021 22:54:49 +0100
Subject: [PATCH] * On MacOS set a unique dylib ID (Bug#45934)

	* src/comp.c (Fcomp__compile_ctxt_to_file): On MacOS set a unique
	dylib ID (Bug#45934).
---
 src/comp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/comp.c b/src/comp.c
index b5adc3ed86..d959c3188c 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4374,6 +4374,16 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
 				  GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
 				  comp.speed < 0 ? 0
 				  : (comp.speed > 3 ? 3 : comp.speed));
+
+/* On MacOS set a unique dylib ID (Bug#45934). */
+#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \
+  && defined (DARWIN_OS)
+  gcc_jit_context_add_driver_option (
+    comp.ctxt,
+    SSDATA (concat2 (build_string ("-install_name "),
+		     Ffile_name_nondirectory (filename))));
+#endif
+
   comp.d_default_idx =
     CALL1I (comp-data-container-idx, CALL1I (comp-ctxt-d-default, Vcomp_ctxt));
   comp.d_impure_idx =
-- 
2.20.1


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45934; Package emacs. Full text available.

Message received at 45934 <at> debbugs.gnu.org:


Received: (at 45934) by debbugs.gnu.org; 24 Jan 2021 19:37:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 24 14:37:32 2021
Received: from localhost ([127.0.0.1]:37339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l3lCV-0002u3-To
	for submit <at> debbugs.gnu.org; Sun, 24 Jan 2021 14:37:32 -0500
Received: from mx.sdf.org ([205.166.94.24]:63140)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akrl@HIDDEN>) id 1l3lCU-0002tt-4S
 for 45934 <at> debbugs.gnu.org; Sun, 24 Jan 2021 14:37:31 -0500
Received: from mab (ma.sdf.org [205.166.94.33])
 by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 10OJbOvg003645
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO);
 Sun, 24 Jan 2021 19:37:25 GMT
From: Andrea Corallo <akrl@HIDDEN>
To: Davide Restivo <davide.restivo@HIDDEN>
Subject: Re: bug#45934: native-comp - Dylib ID of ELN files not optimal
References: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@HIDDEN>
 <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN>
 <xjfy2grzqo6.fsf@HIDDEN>
 <34A641C2-F9E7-487F-8998-D0BC416402FB@HIDDEN>
 <xjfim7vz5u6.fsf@HIDDEN>
 <14FA30A6-E8CC-4A7D-9F40-954515F814D9@HIDDEN>
Date: Sun, 24 Jan 2021 19:37:24 +0000
In-Reply-To: <14FA30A6-E8CC-4A7D-9F40-954515F814D9@HIDDEN> (Davide Restivo's
 message of "Sat, 23 Jan 2021 17:13:23 +0100")
Message-ID: <xjfbldexh1n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 45934
Cc: 45934 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Davide Restivo <davide.restivo@HIDDEN> writes:

> 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.

Ciao Davide,

SGTM, I'll try to come-up with patch.

  Andrea




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45934; Package emacs. Full text available.

Message received at 45934 <at> debbugs.gnu.org:


Received: (at 45934) by debbugs.gnu.org; 23 Jan 2021 16:13:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 23 11:13:39 2021
Received: from localhost ([127.0.0.1]:35051 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l3LXe-0000Ms-S7
	for submit <at> debbugs.gnu.org; Sat, 23 Jan 2021 11:13:39 -0500
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 <xgutter@HIDDEN>) id 1l3LXc-0000Md-9i
 for 45934 <at> 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: OLfBcMMVM1lmINZK8w1nIF0tWvxWP1nyXF5fz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xNnh2A7d1b3mDi8r_Wckhy5iZHCsl3Qwg8aJuiKNMdb7ciUZT4j9D
 TiLfIuwr5jPVr6AnILjElMNy_y2Nacdd3Q9BBuHc3_hQa8P7oOR3ZqtIhsbicpoNnmrWlFynNr8l
 B2P06ts7cZz012ucX3nhFraD42F49bjODt4vyPR0DNGvr.74R2Wg2mMEKC2pAqLkMZkNVfnKbxVi
 kGyoXROGsR0_ZTPMgGH_qyOAWrF1NKWflpQ4OHWxzT1A5XxVUB5m0xCG5f_OB41uJ5p4vh38bQTW
 2bLJKppUn3eEY9VWmo_gKySnElS8NnUEAvbJ0Ow7djsyEsjcPI_DfrohcziSZzxnPJFDDNA_tkaq
 06rsRxoLoRkuFzrVaFcvXYX82OyuYj.j3Q3R4n1zaYXUKpUPMO28zSy3y.a8-
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
Received: by smtp414.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA
 ID 054b55368eca5178bf27ca397cb7b1ed; 
 Sat, 23 Jan 2021 16:13:26 +0000 (UTC)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
Subject: Re: bug#45934: native-comp - Dylib ID of ELN files not optimal
From: Davide Restivo <davide.restivo@HIDDEN>
In-Reply-To: <xjfim7vz5u6.fsf@HIDDEN>
Date: Sat, 23 Jan 2021 17:13:23 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <14FA30A6-E8CC-4A7D-9F40-954515F814D9@HIDDEN>
References: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@HIDDEN>
 <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN> <xjfy2grzqo6.fsf@HIDDEN>
 <34A641C2-F9E7-487F-8998-D0BC416402FB@HIDDEN> <xjfim7vz5u6.fsf@HIDDEN>
To: Andrea Corallo <akrl@HIDDEN>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Content-Length: 2403
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 45934
Cc: 45934 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

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  =
<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 =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=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45934; Package emacs. Full text available.

Message received at 45934 <at> debbugs.gnu.org:


Received: (at 45934) by debbugs.gnu.org; 17 Jan 2021 20:06:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 17 15:06:17 2021
Received: from localhost ([127.0.0.1]:45730 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l1EJV-0005oe-IA
	for submit <at> debbugs.gnu.org; Sun, 17 Jan 2021 15:06:17 -0500
Received: from mx.sdf.org ([205.166.94.24]:52818)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akrl@HIDDEN>) id 1l1EJQ-0005oT-Q2
 for 45934 <at> debbugs.gnu.org; Sun, 17 Jan 2021 15:06:16 -0500
Received: from mab (ma.sdf.org [205.166.94.33])
 by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 10HK69bT001505
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO);
 Sun, 17 Jan 2021 20:06:10 GMT
From: Andrea Corallo <akrl@HIDDEN>
To: Davide Restivo <davide.restivo@HIDDEN>
Subject: Re: bug#45934: native-comp - Dylib ID of ELN files not optimal
References: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@HIDDEN>
 <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN>
 <xjfy2grzqo6.fsf@HIDDEN>
 <34A641C2-F9E7-487F-8998-D0BC416402FB@HIDDEN>
Date: Sun, 17 Jan 2021 20:06:09 +0000
In-Reply-To: <34A641C2-F9E7-487F-8998-D0BC416402FB@HIDDEN> (davide restivo's
 message of "Sun, 17 Jan 2021 17:48:00 +0100")
Message-ID: <xjfim7vz5u6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 45934
Cc: 45934 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"davide.restivo--- via \"Bug reports for GNU Emacs, the Swiss army knife
of text editors\"" <bug-gnu-emacs@HIDDEN> writes:

> Hi Andrea,
>
> A dylib (extension .dylib) is the same as a GNU/Linux shared object (extension .so). Please find below the requested output:

Ciao Davide,

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

> ```
> $ /usr/local/bin/gcc-10 --version
> gcc-10 (Homebrew GCC 10.2.0_2) 10.2.0
> Copyright (C) 2020 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[...]

> /usr/bin/ld -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/ -dynamic -dylib -arch x86_64 -dylib_install_name /usr/lib/ratings.dylib -macosx_version_min 10.15.0 -weak_reference_mismatches non-weak -o ratings.dylib -L/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0 -L/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/../../.. /var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//cccaMqmZ.o -lSystem -lgcc_ext.10.5 -lgcc -lSystem -no_compact_unwind -v

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

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

How do you work around this issue now?

Thanks

  Andrea




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45934; Package emacs. Full text available.

Message received at 45934 <at> debbugs.gnu.org:


Received: (at 45934) by debbugs.gnu.org; 17 Jan 2021 16:48:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 17 11:48:16 2021
Received: from localhost ([127.0.0.1]:45606 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l1BDr-0007SE-F2
	for submit <at> debbugs.gnu.org; Sun, 17 Jan 2021 11:48:16 -0500
Received: from sonic314-20.consmr.mail.ne1.yahoo.com ([66.163.189.146]:39507)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <xgutter@HIDDEN>) id 1l1BDo-0007Rz-3s
 for 45934 <at> debbugs.gnu.org; Sun, 17 Jan 2021 11:48:15 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s2048;
 t=1610902086; bh=TVEnxmdHw54Dau/cXuca6jut8uOcfPSvRlNsoCfCdqU=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To;
 b=HsYHrNf+x0UJ5vpeyQIC5nqKpGzPplZwPqXdU9v39MlDVDpAoyWxaGyEwlaTuZofzcL39M/f8GVVFxjBNMnCO2MewtgJ7A6cL3AfvQEpdB7soF5RfQ8AKunNhibRzrz9Hr7IQ/AE77SlDiCISw/urtooalz6D1SwowRqVEBT0wREJmm699ndELQApZiGQ4iXdj61OoCbPqy6DxZYB0ytqXj1nGZK0ZKGvqBdFt42qZNY8jpnSoGZzbB+Ut/riMJDXAgPHGFuwDWQqSdR5OjB/0V0vscKDB881xo3G2qQSjf0j+v3Htcq7+czn7JXL9jbrtq/wf26CDwJgYJlTPx+JQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1610902086; bh=q1HkSGRmGWqHE5ayfuwNiwEIMl3JqPjyOO+c676ix/9=;
 h=Subject:From:Date:To:From:Subject:Reply-To;
 b=kT5yalDSPwU+uSdvSIU9/8jveU23fXjQ+2kJS3r5WG2cmN9XNx3pkq1e6VcUkyyptTktVWhu1d+rHp8qnnEnbOcL5fQ537vXf9jd6+qJ6WDXJw5iR+0yUg6WnKHxAQENvqSwPZS0+gYyMX6+0o958RJKGg55LMJQ/9ULij+slQGxdgbdnJ/my5dVWboGe27TpsUtpP6+7bthGAOjJ/iHpKIDOxM455FPqelzDomEtxLh4Ny6Hq5aFzIRTyWxF4sSoIaMVvr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j8Rsh3dotlRXqdMxjCPAE.lnCrBSKnbMKpS4U.DTqFkTQbD
 Jn5OXplfXRat733xnLgfPoctCPYk7BqN2LtPgQ78FIRCX4o7ZKIKaFMYLzccqk8cEutK0LF2Uf_H
 J1OpOJsj3rlYvaEzARKllPh7ExAzP5nOhQ5kyHMjl1oeuvVMBHqVSfNKXogVJpI_DqwBjRy7FDt.
 V67CQg742DS3Y.wHJtUePjbSXczsbf2MpthUjtcPM28NBLmyJ55g7v9k1yVTzV26eSK2D32Rltsr
 y8gKBz6MU6QR3OtD5U6nIkzwFJNGw6BNolbtZVMgJZovkQCKa3.pH6lkorpy9Xv8El8lesr4THAO
 QunWcT7Ebp.rjqIs.ZXlaYNlVuRHLyYKJwxNUgRMKrUMwS6vuMaondPE94EjPhPw2LSI7NP3kcR6
 XVKMjDUFxdqt1d3tlXed0DFrObBdEJ1iUIlkB55Iyqk1AIBbVzXIZzvdNAeBS_72o40uvCUI5aOP
 6ibSt6wSZSl_gXSyafRc2wyi.PtXKH.1ezFEAgZE.P2.6cA--
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 17 Jan 2021 16:48:06 +0000
Received: by smtp402.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA
 ID c27d5e380743e36fe57a29bcf2bb1e5a; 
 Sun, 17 Jan 2021 16:48:02 +0000 (UTC)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
Subject: Re: bug#45934: native-comp - Dylib ID of ELN files not optimal
From: Davide Restivo <davide.restivo@HIDDEN>
In-Reply-To: <xjfy2grzqo6.fsf@HIDDEN>
Date: Sun, 17 Jan 2021 17:48:00 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <34A641C2-F9E7-487F-8998-D0BC416402FB@HIDDEN>
References: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@HIDDEN>
 <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN> <xjfy2grzqo6.fsf@HIDDEN>
To: Andrea Corallo <akrl@HIDDEN>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Content-Length: 11007
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 45934
Cc: 45934 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Andrea,

A dylib (extension .dylib) is the same as a GNU/Linux shared object =
(extension .so). Please find below the requested output:

```
$ /usr/local/bin/gcc-10 --version
gcc-10 (Homebrew GCC 10.2.0_2) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is =
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR =
PURPOSE.

$ /usr/local/bin/gcc-10 -v -dynamiclib Ratings.c -install_name =
/usr/lib/ratings.dylib -o ratings.dylib
Using built-in specs.
COLLECT_GCC=3D/usr/local/bin/gcc-10
=
COLLECT_LTO_WRAPPER=3D/usr/local/Cellar/gcc/10.2.0_2/libexec/gcc/x86_64-ap=
ple-darwin19/10.2.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: ../configure --build=3Dx86_64-apple-darwin19 =
--prefix=3D/usr/local/Cellar/gcc/10.2.0_2 =
--libdir=3D/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10 --disable-nls =
--enable-checking=3Drelease =
--enable-languages=3Dc,c++,objc,obj-c++,fortran --program-suffix=3D-10 =
--with-gmp=3D/usr/local/opt/gmp --with-mpfr=3D/usr/local/opt/mpfr =
--with-mpc=3D/usr/local/opt/libmpc --with-isl=3D/usr/local/opt/isl =
--with-system-zlib --with-pkgversion=3D'Homebrew GCC 10.2.0_2' =
--with-bugurl=3Dhttps://github.com/Homebrew/homebrew-core/issues =
--disable-multilib --with-native-system-header-dir=3D/usr/include =
--with-sysroot=3D/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk =
SED=3D/usr/bin/sed
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (Homebrew GCC 10.2.0_2)
COLLECT_GCC_OPTIONS=3D'-v' '-Zdynamiclib' '-Zinstall_name' =
'/usr/lib/ratings.dylib' '-o' 'ratings.dylib' =
'-mmacosx-version-min=3D10.15.0' '-asm_macosx_version_min=3D10.15' =
'-mtune=3Dcore2'
 =
/usr/local/Cellar/gcc/10.2.0_2/libexec/gcc/x86_64-apple-darwin19/10.2.0/cc=
1 -quiet -v -D__DYNAMIC__ Ratings.c -fPIC -quiet -dumpbase Ratings.c =
-mmacosx-version-min=3D10.15.0 -mtune=3Dcore2 -auxbase Ratings -version =
-o /var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//ccN17V5Q.s
GNU C17 (Homebrew GCC 10.2.0_2) version 10.2.0 (x86_64-apple-darwin19)
	compiled by GNU C version 10.2.0, GMP version 6.2.1, MPFR =
version 4.1.0, MPC version 1.2.1, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=3D100 --param =
ggc-min-heapsize=3D131072
ignoring nonexistent directory =
"/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/local/includ=
e"
ignoring nonexistent directory =
"/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.=
0/../../../../../../x86_64-apple-darwin19/include"
ignoring nonexistent directory =
"/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/Library/Framewor=
ks"
#include "..." search starts here:
#include <...> search starts here:
 =
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0=
/include
 =
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0=
/include-fixed
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include
 =
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Fr=
ameworks
End of search list.
GNU C17 (Homebrew GCC 10.2.0_2) version 10.2.0 (x86_64-apple-darwin19)
	compiled by GNU C version 10.2.0, GMP version 6.2.1, MPFR =
version 4.1.0, MPC version 1.2.1, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=3D100 --param =
ggc-min-heapsize=3D131072
Compiler executable checksum: 966ca361396c29aa9c1bedc558ef6a08
COLLECT_GCC_OPTIONS=3D'-v' '-Zdynamiclib' '-Zinstall_name' =
'/usr/lib/ratings.dylib' '-o' 'ratings.dylib' =
'-mmacosx-version-min=3D10.15.0'  '-mtune=3Dcore2'
 as -arch x86_64 -v -force_cpusubtype_ALL -mmacosx-version-min=3D10.15 =
-o /var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//cccaMqmZ.o =
/var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//ccN17V5Q.s
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: =
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolc=
hain/usr/bin
 =
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctool=
chain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.15.0 -filetype =
obj -main-file-name ccN17V5Q.s -target-cpu penryn =
-fdebug-compilation-dir /Users/gutter/Downloads -dwarf-debug-producer =
"Apple clang version 12.0.0 (clang-1200.0.32.28)" -dwarf-version=3D4 =
-mrelocation-model pic -o =
/var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//cccaMqmZ.o =
/var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//ccN17V5Q.s
=
COMPILER_PATH=3D/usr/local/Cellar/gcc/10.2.0_2/libexec/gcc/x86_64-apple-da=
rwin19/10.2.0/:/usr/local/Cellar/gcc/10.2.0_2/libexec/gcc/x86_64-apple-dar=
win19/10.2.0/:/usr/local/Cellar/gcc/10.2.0_2/libexec/gcc/x86_64-apple-darw=
in19/:/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/=
10.2.0/:/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin1=
9/
=
LIBRARY_PATH=3D/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-=
darwin19/10.2.0/:/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-appl=
e-darwin19/10.2.0/../../../
COLLECT_GCC_OPTIONS=3D'-v' '-Zdynamiclib' '-Zinstall_name' =
'/usr/lib/ratings.dylib' '-o' 'ratings.dylib' =
'-mmacosx-version-min=3D10.15.0'  '-mtune=3Dcore2'
 =
/usr/local/Cellar/gcc/10.2.0_2/libexec/gcc/x86_64-apple-darwin19/10.2.0/co=
llect2 -syslibroot =
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/ -dynamic =
-dylib -arch x86_64 -dylib_install_name /usr/lib/ratings.dylib =
-macosx_version_min 10.15.0 -weak_reference_mismatches non-weak -o =
ratings.dylib =
-L/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2=
.0 =
-L/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2=
.0/../../.. /var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//cccaMqmZ.o =
-lSystem -lgcc_ext.10.5 -lgcc -lSystem -no_compact_unwind -v
collect2 version 10.2.0
/usr/bin/ld -syslibroot =
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/ -dynamic =
-dylib -arch x86_64 -dylib_install_name /usr/lib/ratings.dylib =
-macosx_version_min 10.15.0 -weak_reference_mismatches non-weak -o =
ratings.dylib =
-L/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2=
.0 =
-L/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2=
.0/../../.. /var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//cccaMqmZ.o =
-lSystem -lgcc_ext.10.5 -lgcc -lSystem -no_compact_unwind -v
@(#)PROGRAM:ld  PROJECT:ld64-609.8
BUILD 20:09:52 Nov  4 2020
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 =
i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
	=
/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0=

	/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10
	/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib
Framework search paths:
	=
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Fr=
ameworks/
ld: warning: static initializer found in =
'/var/folders/r4/5c0t6dm912vggdd3jbjf_3tr0000gn/T//cccaMqmZ.o'. Use =
-no_inits to make this an error.  Use -no_warn_inits to suppress warning
ld: warning: invalid -install_name =
(/usr/local/lib/gcc/10/libgcc_s.1.dylib) in dependent dylib =
(/usr/local/Cellar/gcc/10.2.0_2/lib/gcc/10/libgcc_ext.10.5.dylib). =
Dylibs/frameworks which might go in dyld shared cache cannot link with =
dylibs that won't be in the shared cache
ld: warning: linking with (/usr/local/lib/gcc/10/libgcc_s.1.dylib) but =
not using any symbols from it
```

Now we can verify using otool that the dylib ID is correctly set:

```
$ otool
Usage: =
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolc=
hain/usr/bin/otool [-arch arch_type] [-fahlLDtdorSTMRIHGvVcXmqQjCP] =
[-mcpu=3Darg] [--version] <object file> ...
	-f print the fat headers
	-a print the archive header
	-h print the mach header
	-l print the load commands
	-L print shared libraries used
	-D print shared library id name.                          =
<=E2=80=94=E2=80=94 This option is used to print the dylib ID
	-t print the text section (disassemble with -v)
	-x print all text sections (disassemble with -v)
	-p <routine name>  start dissassemble from routine name
	-s <segname> <sectname> print contents of section
	-d print the data section
	-o print the Objective-C segment
	-r print the relocation entries
	-S print the table of contents of a library (obsolete)
	-T print the table of contents of a dynamic shared library =
(obsolete)
	-M print the module table of a dynamic shared library (obsolete)
	-R print the reference table of a dynamic shared library =
(obsolete)
	-I print the indirect symbol table
	-H print the two-level hints table (obsolete)
	-G print the data in code table
	-v print verbosely (symbolically) when possible
	-V print disassembled operands symbolically
	-c print argument strings of a core file
	-X print no leading addresses or headers
	-m don't use archive(member) syntax
	-B force Thumb disassembly (ARM objects only)
	-q use llvm's disassembler (the default)
	-Q use otool(1)'s disassembler
	-mcpu=3Darg use `arg' as the cpu for disassembly
	-j print opcode bytes
	-P print the info plist section as strings
	-C print linker optimization hints
	--version print the version of =
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolc=
hain/usr/bin/otool
```

The dylib ID is correctly set:

```
$ otool -D ratings.dylib
ratings.dylib:
/usr/lib/ratings.dylib
```

Thanks for the help,
Davide


> On 17 Jan 2021, at 13:36, akrl--- via Bug reports for GNU Emacs, the =
Swiss army knife of text editors <bug-gnu-emacs@HIDDEN> wrote:
>=20
> "davide.restivo--- via \"Bug reports for GNU Emacs, the Swiss army =
knife
> of text editors\"" <bug-gnu-emacs@HIDDEN> writes:
>=20
> [...]
>=20
>> 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.
>>=20
>> Thanks and regards,
>> Davide
>>=20
>>=20
>> [1] https://github.com/daviderestivo/homebrew-emacs-head
>> [2] gcc -o libdummy.dylib -install_name ${PREFIX}/lib/libdummy.dylib=20=

>=20
> Hi Davide,
>=20
> I'm really ignorant on MacOS so I'll comment for what I can.  I had a
> look to the GCC doc [1] but I could not figure out if '-install_name' =
is
> an option that goes to the compiler or the linker (nor I know what =
this
> dylib ID exactly is).  If the flag is routed to the linker we should =
be
> able to add it but only when libgccjit >=3D 9 is used.
>=20
> Could you run a random compilation of something using '-install_name'
> but adding also '-v' and report the console output so we can see where
> the driver is routing the flag?
>=20
> Thanks
>=20
>  Andrea
>=20
> [1] https://gcc.gnu.org/onlinedocs/gcc/Darwin-Options.html
>=20
>=20
>=20





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45934; Package emacs. Full text available.

Message received at 45934 <at> debbugs.gnu.org:


Received: (at 45934) by debbugs.gnu.org; 17 Jan 2021 12:36:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 17 07:36:18 2021
Received: from localhost ([127.0.0.1]:44640 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l17I2-0007Wa-8P
	for submit <at> debbugs.gnu.org; Sun, 17 Jan 2021 07:36:18 -0500
Received: from mx.sdf.org ([205.166.94.24]:63358)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <akrl@HIDDEN>) id 1l17Hx-0007WN-OS
 for 45934 <at> debbugs.gnu.org; Sun, 17 Jan 2021 07:36:16 -0500
Received: from mab (ma.sdf.org [205.166.94.33])
 by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 10HCa95t027718
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO);
 Sun, 17 Jan 2021 12:36:11 GMT
From: Andrea Corallo <akrl@HIDDEN>
To: 45934 <at> debbugs.gnu.org
Subject: Re: bug#45934: native-comp - Dylib ID of ELN files not optimal
References: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@HIDDEN>
 <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN>
Date: Sun, 17 Jan 2021 12:36:09 +0000
In-Reply-To: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN> (davide restivo's
 message of "Sun, 17 Jan 2021 11:13:25 +0100")
Message-ID: <xjfy2grzqo6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 45934
Cc: Davide Restivo <davide.restivo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"davide.restivo--- via \"Bug reports for GNU Emacs, the Swiss army knife
of text editors\"" <bug-gnu-emacs@HIDDEN> writes:

[...]

> 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 

Hi Davide,

I'm really ignorant on MacOS so I'll comment for what I can.  I had a
look to the GCC doc [1] but I could not figure out if '-install_name' is
an option that goes to the compiler or the linker (nor I know what this
dylib ID exactly is).  If the flag is routed to the linker we should be
able to add it but only when libgccjit >= 9 is used.

Could you run a random compilation of something using '-install_name'
but adding also '-v' and report the console output so we can see where
the driver is routing the flag?

Thanks

  Andrea

[1] https://gcc.gnu.org/onlinedocs/gcc/Darwin-Options.html




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45934; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Jan 2021 10:44:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 17 05:44:42 2021
Received: from localhost ([127.0.0.1]:44610 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l15Y1-0002eU-Jd
	for submit <at> debbugs.gnu.org; Sun, 17 Jan 2021 05:44:42 -0500
Received: from lists.gnu.org ([209.51.188.17]:46602)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <xgutter@HIDDEN>) id 1l153v-0001vK-Kl
 for submit <at> debbugs.gnu.org; Sun, 17 Jan 2021 05:13:36 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:57960)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <xgutter@HIDDEN>) id 1l153v-0002sI-ED
 for bug-gnu-emacs@HIDDEN; Sun, 17 Jan 2021 05:13:35 -0500
Received: from sonic303-21.consmr.mail.ne1.yahoo.com ([66.163.188.147]:42980)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <xgutter@HIDDEN>) id 1l153t-0006aN-1d
 for bug-gnu-emacs@HIDDEN; Sun, 17 Jan 2021 05:13:35 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s2048;
 t=1610878408; bh=TaTuzX/TiqM/7dEG4vVvc+tGRy987LnqqlLvZoPxmZM=;
 h=From:Subject:Date:To:References:From:Subject:Reply-To;
 b=BndXx/Qut2hgQTQS7tdyG46RuZpK50NPSw53DMQI6uclH/xKUyMgnW8wdQkNry8M7X+Bs3bVtPzwVEPcntTywq2ClPIFGMqdh9kYwswD3PjviJOJXIXCfo52CAItUQOlOPjqOiSpzARjQx3Vxr7GSNyiP+bcV4+OvaGlgshuryZbvJ3WVlrIr3TIGodY05FNiSbFFWFzbaDH5C19RDKs/sL/Ls5bU/Vno+Ln0hPFuuwO0B4OM/ltBXPrrR/kr8mz2BsKu9P5mlB8a3t0mn2LMkWpbHAglj4Nb2B8Mt7PEVH3cR1UXvGhk5Zlt+qcn6LfR/kFpTJNt7+6YDJT3p6FNw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1610878408; bh=UifZD0VEhRZjT03Kkykr7fuNxeDZeuQgXEy2ddtKhqm=;
 h=From:Subject:Date:To:From:Subject:Reply-To;
 b=pWgVgf2dkksuRx4/yZHiKr0Fde8L8zQWm39Ug2SNwQBwCIxkCwgZPNx0cslAEMMbpqghDtlWaHNUo1UjeSrsXQTm1NEIcabvVAHyfaccc5d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dAV.GCwGgmiBjlU5XNZmVyf4
 PmjlcyeIs2AjC2Qvrej0uSFn2gBdVCymRAu.Izvl42yh9dxv5vy3Kp8EkWeCoEZ1LqVOLwAQXSA9
 Ie4dixWvdDG8M4VQ7Yn4QDi8rsoEiQKFWBOG65Lg2bwdbnDa7mWPQjjx.m3OaSmD_M2EJhyNFVAA
 W5s1I1cV.GQXLuyj_aM1.6YBm7o35BOOPjlK_OeAbHF0S5Ia078KgG7Lacn9I9JjyTfsTTmzRgxQ
 0q9c.P95APLhwMYDAiIpjc_k3_h0URrPAzHDtWkdeN56v_JMdA2qpJSt3qiQIiGrm6vKTOaGaT0U
 kyWzW7TtiqMoXWpKdT3MWjaSDRMAdRYc6OI40E7.2olfm0dG5Apj9sRnDevhcOiPe8d7_XMpYh3H
 sucQxutJNTG2nueG0eF.UOhg5whnXo8iTsCnLacBCq2F.UQHp4I8QSt36iqnqE0WTKZ_o55vY8bt
 3RKM8RRNOvCdUEL7qlJyJP04EGxuPW47TfC93lOYkcFW53o0c97wFHZES_dl87OjUZkDfwC8NFb.
 Xh33_1SuDkb6AN0FFa3lDrowjtLTxc7ooqDK9JLY-
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic303.consmr.mail.ne1.yahoo.com with HTTP; Sun, 17 Jan 2021 10:13:28 +0000
Received: by smtp422.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA
 ID 7d419fd2cf111b33d3880439b5dfc7cc; 
 Sun, 17 Jan 2021 10:13:27 +0000 (UTC)
From: Davide Restivo <davide.restivo@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\))
Subject: native-comp - Dylib ID of ELN files not optimal
Message-Id: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42@HIDDEN>
Date: Sun, 17 Jan 2021 11:13:25 +0100
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3608.120.23.2.4)
References: <EDAEF3DD-6B4E-4ED9-A7B8-8FB4F236DF42.ref@HIDDEN>
Content-Length: 2749
Received-SPF: pass client-ip=66.163.188.147; envelope-from=xgutter@HIDDEN;
 helo=sonic303-21.consmr.mail.ne1.yahoo.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 17 Jan 2021 05:44:38 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Hi,=20

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: =20
   =
/usr/local/Cellar/emacs-head@28/28.0.50_1/Emacs.app/Contents/native-lisp/2=
8.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/4Corner-=
80465fd1980e15f97a4c37918242ae86-c113fb0ce90e32f79bf944d3da555eea.eln
dylib ID:=20
  /private/tmp/libgccjit-3AyZly/fake.so

Example_2:
Filename: =20
   =
/usr/local/Cellar/emacs-head@28/28.0.50_1/Emacs.app/Contents/native-lisp/2=
8.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/5x5-a61d=
71cfcb41ac534af48635fb74337a-d665a8dec895c4d242614826b692b6ba.eln
dylib ID:=20
  /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:

=3D=3D> Changing dylib ID of =
/usr/local/Cellar/emacs-head@28/28.0.50_1/Emacs.app/Contents/native-lisp/2=
8.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

=3D=3D> Changing dylib ID of =
/usr/local/Cellar/emacs-head@28/28.0.50_1/Emacs.app/Contents/native-lisp/2=
8.0.50-x86_64-apple-darwin19.6.0-280c4c724fff373c5b7192112ad4147c/5x5-a61d=
71cfcb41ac534af48635fb74337a-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=20





Acknowledgement sent to Davide Restivo <davide.restivo@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#45934; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 29 Jan 2021 07:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.