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: Sun, 17 Jan 2021 17:48:00 +0100 Message-ID: <34A641C2-F9E7-487F-8998-D0BC416402FB@yahoo.it> References: 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="24894"; 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 Sun Jan 17 17:54:33 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 1l1BJx-0006Ly-0L for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jan 2021 17:54:33 +0100 Original-Received: from localhost ([::1]:40234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1BJw-000458-3C for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jan 2021 11:54:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1BEc-0004Qy-T5 for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2021 11:49:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1BEc-0001zz-Dk for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2021 11:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l1BEc-0007TF-Bf for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2021 11:49: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: Sun, 17 Jan 2021 16:49: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.161090209628662 (code B ref 45934); Sun, 17 Jan 2021 16:49:02 +0000 Original-Received: (at 45934) by debbugs.gnu.org; 17 Jan 2021 16:48:16 +0000 Original-Received: from localhost ([127.0.0.1]:45606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1BDr-0007SE-F2 for submit@debbugs.gnu.org; Sun, 17 Jan 2021 11:48:16 -0500 Original-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 ) id 1l1BDo-0007Rz-3s for 45934@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/iHpKIDOxM455FPqelzDomEtxLh4Ny6Hq5aFzIRTyWxF4sSoIaMVvrGJeKOM7640mkH10U6BxSazqtESqCbRuInevi5k2+oYKhYYfw3yr/nyZ1kCQiHDpCqguk+rqKuapDwrQ== X-YMail-OSG: SxiY.mkVM1kg1Zn07dD2UDt0kGUL.GHB5h4h2Zwiv_o7IFL2UGi8F_CEkvEoXWE GoL1S1JZZ5HKXuP7rIfG9muGHUAt5vlVSss3qMew.HGj7aG8MG2zyViLC4Zh_FXtApxHBrxcA9c4 0P_QYZzvdu8gdB0qklnRh6KWa3xmQ2qN3b0WwwDEUVWjTJLMkqVL00xmkgsGUn6pvk80VK.t0kHa iekG7fYVTLHG2eH5Dm0Mf7VjJ3s4MhGh.tXMTllvuUGg4kAn7Gd3YjbDjeLnX2WnZPuTyrHHO0gn IGlcE4EIioM0gc_dx6pK5TJZfgATNljD5BWNVBfQNdBVGhrPORo.NTxiaYS5yV4gMUH3CNC32f_2 PZ5ZVe9LnOT1zk5qWB.Yx0R.eXVUH91k6wdnmicu.kjY7U73BUt9aabKVg5az2BFsqmo5X5eawIl 2p9.kpFGbrY_5DLSk0Xd2wQxsug0Cn7_nKXB6GniFKBEGuTUW3Vc0OSbFo8_8dUIuR1s7139U40r wkseqnjtrNgFXtGyECkAXZ26dhOMPXapFe0bcxKbUfyRlIHaRVOELPjP8AOAKyZGM9A_7OhJohqN 3MabBZaYTx0_jmIQYTg9KGyXgAdS7jDh6m2utydzh2FFYa.hv_hJcStnTR772jFHc0LTTxFtLrQr YX4VeO1FT_PrT9FOySbSfotT9gm_gT2yrAP5w0VcEH9NGvNXUhykpzEWo.vkC87.zvus2A72UETG WjT8yxA5.LyBn77BOjHaoFumK0SKmWV4ibBNXzAHEZRynBYupEmgLZSHAFlBsUTx4wLNfVPZVRQ7 21uQEvgT86.hwIj_XyQ0WUuGvUEFKCjnAh7YQLeKxE Original-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 Original-Received: by smtp402.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID c27d5e380743e36fe57a29bcf2bb1e5a; Sun, 17 Jan 2021 16:48:02 +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:198059 Archived-At: 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] ... -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 start dissassemble from routine name -s 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 wrote: >=20 > "davide.restivo--- via \"Bug reports for GNU Emacs, the Swiss army = knife > of text editors\"" 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