From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uYvhMRyMPmHRRQAAgWs5BA (envelope-from ) for ; Mon, 13 Sep 2021 01:24:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0t0QLRyMPmHaYwAA1q6Kng (envelope-from ) for ; Sun, 12 Sep 2021 23:24:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D32021B986 for ; Mon, 13 Sep 2021 01:24:11 +0200 (CEST) Received: from localhost ([::1]:54898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPYpW-0005qz-Iv for larch@yhetil.org; Sun, 12 Sep 2021 19:24:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPYpO-0005qr-Eq for bug-guix@gnu.org; Sun, 12 Sep 2021 19:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPYpO-0005ER-4P for bug-guix@gnu.org; Sun, 12 Sep 2021 19:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mPYpN-0000NS-UW for bug-guix@gnu.org; Sun, 12 Sep 2021 19:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50556: Clang retains extraneous references to GCC (and zlib) Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 12 Sep 2021 23:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50556 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 50556@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16314889911388 (code B ref -1); Sun, 12 Sep 2021 23:24:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Sep 2021 23:23:11 +0000 Received: from localhost ([127.0.0.1]:43666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPYoY-0000MJ-H3 for submit@debbugs.gnu.org; Sun, 12 Sep 2021 19:23:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:58306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mPYoT-0000M9-Un for submit@debbugs.gnu.org; Sun, 12 Sep 2021 19:23:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPYoT-0005pH-CI for bug-guix@gnu.org; Sun, 12 Sep 2021 19:23:05 -0400 Received: from out2.migadu.com ([2001:41d0:2:aacc::]:59036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPYoQ-0004ZT-5X for bug-guix@gnu.org; Sun, 12 Sep 2021 19:23:05 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1631488976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=K4WhDkqJkX8rbqFBVVwqcCgoIk3hewmZ71or00GiSPg=; b=HQnErwjWPu2Vt9wyearIrW401+shw3lu7YCrdHyitI9HoosGy4uL5NPVU1BLe4Gb9xZIwB UGLP4sV5iUeZjcG6r0dVBIue4U+fBOUbaFBDpL8sqOIjEszVwTy+Ko+KkSka0neSjIeoPc 4T6NtuptrPs+35d4auklWfmg8oNxW+o= From: Sarah Morgensen Date: Sun, 12 Sep 2021 16:22:53 -0700 Message-ID: <86a6khl6pe.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=iskarian@mgsn.dev; helo=out2.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631489052; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=K4WhDkqJkX8rbqFBVVwqcCgoIk3hewmZ71or00GiSPg=; b=Ph0xq9Lma5z9GsjRdVGk7EgwxJgXtlhTKtGMzDzI8xKJYdHjSsefPps41s6cICToY4Chx5 lcWO9E6bbPz0qJqNuDr9ZLx73ak8kw4JeSC0sysxyqKB4jabgjoiHlPCzfSae/v/XMBmu3 xb2HThDhkuGmvJ4P/nyNAUxzlqKhVcyTw+lcee5DSEMoeqe1723jwK/P70hFLaNC1Uj0K5 Fg3XKAyJ1vYTxADm/Vh/kUl6SuW8SxpYWm7mPtVKaIRpAEK53k437kW14NHqN60EDD/4nD 8SQYQ/gUSmZtBWk134pETHxsWMuhuCIiTNcYkjlqfRrqDtX1V0UNOyZdquC3lw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631489052; a=rsa-sha256; cv=none; b=ASkRb/fHmKHZFRFcMIzdtF8Y0ouZrZ/jnP/Y+jNgZrY1F+oUU0jYVYQjRhQmYsCcZu9fhX ZBHcoNoxuEuWvbbHwSwNvxZCL6d6raL8Etnbimzctma/y+hzXyhB5XR7oF1tziI8YJ96Al V9gTEUs/38EmyHz9o7Fjq+67FsgG7ho/BCupZXDdM8rs+N/bZbZtg3pWdM49DnPfeHuWBw vygJv2E4sSXpT23YM3tEruiNn4rCV62vGe6XSL7IowlrANrrGkN2NhgbZBXSdZ7mENRbFK AwfL8VUo7uSzLMq7BUnCA/yEfFnXU6+g/L1+RXyTzyMgw35LJRUYvSaUYPxr2Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=HQnErwjW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 0.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=HQnErwjW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: D32021B986 X-Spam-Score: 0.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: affdsczkJqJD Hello Guix, I recently noticed that Clang has some extra references: --8<---------------cut here---------------start------------->8--- $ guix size clang store item total self /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0 979.2 496.0 50.7% /gnu/store/rmc131fpy2hv408a1awd2wm7kiwyf7d7-llvm-12.0.0 234.1 162.7 16.6% /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0 178.5 107.3 11.0% /gnu/store/8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2 146.2 57.1 5.8% /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31 38.4 36.7 3.8% /gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib 71.0 32.6 3.3% /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib 71.0 32.6 3.3% /gnu/store/nzfhh1rm85lx2p5plbx45qqj82pcv5hp-clang-runtime-12.0.0 95.9 24.9 2.5% /gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32 88.0 17.0 1.7% /gnu/store/c8w9z48vvx2a3q3k44ch9yn00wk1qwhb-libxml2-2.9.10 81.1 7.9 0.8% /gnu/store/mmhimfwmmidf09jw1plw3aw1g1zn2nkh-bash-static-5.0.16 1.6 1.6 0.2% /gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16 39.4 1.0 0.1% /gnu/store/r7k859hmcnkazf492fasqvk25jflnfk6-xz-5.2.4 73.0 0.9 0.1% /gnu/store/g2s5jfkfd4k973wb58476b1bbv9zpm6m-zlib-1.2.11 38.6 0.2 0.0% /gnu/store/rykm237xkmq7rl1p0nwass01p090p88x-zlib-1.2.11 71.2 0.2 0.0% /gnu/store/bw15z9kh9c65ycc2vbhl2izwfwfva7p1-libffi-3.3 71.2 0.2 0.0% total: 979.2 MiB --8<---------------cut here---------------end--------------->8--- It retains references two *two* separate gcc-7.5.0-lib outputs, two separate zlib-1.2.11 outputs, and a gcc-7.5.0 output (clang shouldn't need GCC, right?) --8<---------------cut here---------------start------------->8--- $ guix gc --references /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0 /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib /gnu/store/8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2 /gnu/store/c8w9z48vvx2a3q3k44ch9yn00wk1qwhb-libxml2-2.9.10 /gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31 /gnu/store/nzfhh1rm85lx2p5plbx45qqj82pcv5hp-clang-runtime-12.0.0 /gnu/store/rmc131fpy2hv408a1awd2wm7kiwyf7d7-llvm-12.0.0 /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0 /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0 --8<---------------cut here---------------end--------------->8--- Okay, so only the gcc references are direct. Where is the double gcc-7.5.0-lib reference coming from? --8<---------------cut here---------------start------------->8--- $ readelf -d /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/bin/clang-12 | grep runpath 0x000000000000001d (RUNPATH) Library runpath: [/gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/lib:/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib:/gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib:/gnu/store/rmc131fpy2hv408a1awd2wm7kiwyf7d7-llvm-12.0.0/lib:/gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib] $ ldd /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/bin/clang-12 | grep -v LLVM linux-vdso.so.1 (0x00007ffe55cbb000) libpthread.so.0 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libpthread.so.0 (0x00007f0cd9d1b000) libstdc++.so.6 => /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/libstdc++.so.6 (0x00007f0cd6f33000) libm.so.6 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libm.so.6 (0x00007f0cd6df2000) libgcc_s.so.1 => /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0x00007f0cd6dd9000) libc.so.6 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libc.so.6 (0x00007f0cd6c1c000) /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/ld-linux-x86-64.so.2 (0x00007f0cdcf19000) librt.so.1 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/librt.so.1 (0x00007f0cd64ed000) libdl.so.2 => /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libdl.so.2 (0x00007f0cd64e8000) libz.so.1 => /gnu/store/rykm237xkmq7rl1p0nwass01p090p88x-zlib-1.2.11/lib/libz.so.1 (0x00007f0cd64c8000) --8<---------------cut here---------------end--------------->8--- It has an extra runpath but doesn't use it... Why does it have it? --8<---------------cut here---------------start------------->8--- $ rg "db2-gcc-7.5.0-lib" /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0 /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/include/clang/Config/config.h 58:#define GCC_INSTALL_PREFIX "/gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib" --8<---------------cut here---------------end--------------->8--- So the configure step is probably putting that in there... but why does it have access to two different gcc-7.5.0-lib inputs in the first place? --8<---------------cut here---------------start------------->8--- (inputs `(("libxml2" ,libxml2) ("gcc-lib" ,gcc "lib") ,@(package-inputs llvm) --8<---------------cut here---------------end--------------->8--- That's reasonable, for cross-compiling... or should it be `,(canonical-package gcc)' instead? It couldn't be that simple, could it? But even if that fixes non-cross-compiled builds, the above implies that cross-compiled Clangs could retain a reference to the native gcc-lib as well. That shouldn't be, right? As for zlib... zlib isn't a direct reference, so where is it coming from? --8<---------------cut here---------------start------------->8--- $ guix gc --references /gnu/store/c8w9z48vvx2a3q3k44ch9yn00wk1qwhb-libxml2-2.9.10 /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib /gnu/store/c8w9z48vvx2a3q3k44ch9yn00wk1qwhb-libxml2-2.9.10 /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31 /gnu/store/pwcp239kjf7lnj5i4lkdzcfcxwcfyk72-bash-minimal-5.0.16 /gnu/store/r7k859hmcnkazf492fasqvk25jflnfk6-xz-5.2.4 /gnu/store/rykm237xkmq7rl1p0nwass01p090p88x-zlib-1.2.11 $ guix gc --references /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0 /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31 /gnu/store/g2s5jfkfd4k973wb58476b1bbv9zpm6m-zlib-1.2.11 /gnu/store/mmhimfwmmidf09jw1plw3aw1g1zn2nkh-bash-static-5.0.16 /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0 --8<---------------cut here---------------end--------------->8--- They use two separate zlibs, even though they both reference the same zlib package! Why? I hope we have a Clang expert here! What do you think? -- Sarah