From unknown Sun Jun 22 11:42:50 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#64129] [PATCH] gnu: clang-runtime-15: Fix address sanitizer support Resent-From: Tobias Kortkamp Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Jun 2023 13:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64129 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64129@debbugs.gnu.org Cc: Tobias Kortkamp X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168700877211815 (code B ref -1); Sat, 17 Jun 2023 13:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jun 2023 13:32:52 +0000 Received: from localhost ([127.0.0.1]:51066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAW2u-00034U-0R for submit@debbugs.gnu.org; Sat, 17 Jun 2023 09:32:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:56458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAW2s-00034L-6U for submit@debbugs.gnu.org; Sat, 17 Jun 2023 09:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAW2r-0000A1-T9 for guix-patches@gnu.org; Sat, 17 Jun 2023 09:32:49 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qAW2p-0004mF-NL for guix-patches@gnu.org; Sat, 17 Jun 2023 09:32:49 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5164c5bd369so445814a12.1 for ; Sat, 17 Jun 2023 06:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687008765; x=1689600765; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=31BpmyyZ4aBBgJpyOFd40SsAlrk/pC7HTZH6ooUO5xU=; b=eTmnFC1pZdlBh/wx9ohdI/arDB0KIlXQRyrRytic+QPGYUsBCPzqMmafY2FpeexV0m cgqfK9be8rWM/ay0yLJcqYXjtmTvW2MOUtwb2oZb+NED+qBCCgiEWjLueQdtTyj5kEow 496g7C9iWipPgRPRlb4fuK4mvfC8+VYDSD5u8KSf5aPNVdS+atcLyQS/nY6IpQKXyGRO ZcCCfY8+M+4TDAmAy8Wm/vjr4qLtZYy38NftgDo8RCPHvRT2j8Ij6hdRbSQi9s2MlXhK xQfa6zrbNGbBTs4cgupAv9pSPjwi4uwEOyRvQWGOA4jVN6hlj776Iz756i4f61uuFQr0 Uu5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687008765; x=1689600765; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=31BpmyyZ4aBBgJpyOFd40SsAlrk/pC7HTZH6ooUO5xU=; b=RNfnZmkV6QdoZNwxuZ752AAiOsJb0XU3GcapQys9qyF05oekn3UZrZBHamczg7WqZE /ELS7jXwJRTAZug8ImQ7sctyDv/G5zlTc+kvYgYSuam/h8qDxXfdAI3MPUdntKTtf8xV A+AyWgV4bqSwrZ5lHHR0zNX1aLCBhx8mYmTXB7vdhE6Y1dyR1mQmQMtclwKLRwqq2O7k Wrz1nzPJ/R/jfdm9UDXf1pbx4bXHTVcQhZJ5XSPI4gcDp5lo4f0fFRL7k/tYJM1Sog8o e7slmgZOJvwBGD/sDY8GIvuw09jpprW5zjx3PRZbb5chj2H5v3vi8IGtbOjeZLAuL6+3 ZCPQ== X-Gm-Message-State: AC+VfDzKI9Wwom6NjtW8EHRPuvX3Tsq76cZSNaCJcLCbadxmPiRa2b/g 6w0ButBr4lxZoknhYChQn9iUpFoClj0= X-Google-Smtp-Source: ACHHUZ4JfO8rstp5WE7QQqgjxmaOqXx14X4YtZ7heRVrkW86UYMgeHo113vQh84ff1obkbrRS70f4g== X-Received: by 2002:a17:906:5354:b0:986:7872:a7bc with SMTP id j20-20020a170906535400b009867872a7bcmr3155046ejo.3.1687008764776; Sat, 17 Jun 2023 06:32:44 -0700 (PDT) Received: from anubis.kortkamp.xyz (p200300ff7f008500873e7d05b0b76269.dip0.t-ipconnect.de. [2003:ff:7f00:8500:873e:7d05:b0b7:6269]) by smtp.gmail.com with ESMTPSA id e24-20020a170906081800b009786c8249d6sm12266367ejd.175.2023.06.17.06.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jun 2023 06:32:44 -0700 (PDT) From: Tobias Kortkamp Date: Sat, 17 Jun 2023 15:31:56 +0200 Message-Id: <5c775384d6459219465668b778bcb9ddf1c803d1.1687008629.git.tobias.kortkamp@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=tobias.kortkamp@gmail.com; helo=mail-ed1-x529.google.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) $ guix shell clang-toolchain@15 -- clang -o test -fsanitize=address test.c ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan_static-x86_64.a: No such file or directory ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory clang-15: error: linker command failed with exit code 1 (use -v to see invocation) * gnu/packages/llvm.scm (clang-runtime-15): Fix address sanitizer support by bringing back the static libraries. --- Hi, I'm unable to compile programs with -fsanitize=address with clang-toolchain@15: #+name test.c #+begin_src c int main() { return 0; } #+end_src #+begin_quote $ guix describe Generation 46 Jun 12 2023 09:12:12 (current) guix dffaf42 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: dffaf42e5eac3822bd6b44e9749fc8e5f48fb99c $ guix shell clang-toolchain -- clang -o test -fsanitize=address test.c ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan_static-x86_64.a: No such file or directory ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory clang-15: error: linker command failed with exit code 1 (use -v to see invocation) #+end_quote Similar with -shared-libsan: #+begin_quote $ guix shell clang-toolchain -- clang -o test -shared-libsan -fsanitize=address test.c ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan-preinit-x86_64.a: No such file or directory ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan_static-x86_64.a: No such file or directory clang-15: error: linker command failed with exit code 1 (use -v to see invocation) #+end_quote With clang-toolchain@14 everything works fine. Unless I'm missing some magic flag in the clang command, I'm guessing that the reason for this is the following bad phase in the clang-runtime-15 package which is missing in clang-runtime-14: #+begin_src scheme (add-after 'install 'delete-static-libraries ;; Reduce size from 33 MiB to 7.4 MiB. (lambda _ (for-each delete-file (find-files #$output "\\.a(\\.syms)?$")))) #+end_src If I remove it then the toolchain works fine again. The phase needs to removed or fixed to not outright delete all static libraries. The patch just removes it since that's easiest. Best regards, Tobias gnu/packages/llvm.scm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index f59c8e9592..9764552a62 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -699,12 +699,7 @@ (define-public clang-runtime-15 #~(modify-phases #$phases (add-after 'unpack 'change-directory (lambda _ - (chdir "compiler-rt"))) - (add-after 'install 'delete-static-libraries - ;; Reduce size from 33 MiB to 7.4 MiB. - (lambda _ - (for-each delete-file - (find-files #$output "\\.a(\\.syms)?$")))))))) + (chdir "compiler-rt"))))))) (native-inputs (modify-inputs (package-native-inputs template) (prepend gcc-12))) ;libfuzzer fails to build with GCC 11 base-commit: 52f2980fa3feaf6e59b9e5144391faf8feb52a87 -- 2.40.1 From unknown Sun Jun 22 11:42:50 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#64129] [PATCH] gnu: clang-runtime-15: Fix address sanitizer support References: <5c775384d6459219465668b778bcb9ddf1c803d1.1687008629.git.tobias.kortkamp@gmail.com> In-Reply-To: <5c775384d6459219465668b778bcb9ddf1c803d1.1687008629.git.tobias.kortkamp@gmail.com> Resent-From: Philippe Virouleau Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 10 Jul 2023 14:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64129 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64129@debbugs.gnu.org Received: via spool by 64129-submit@debbugs.gnu.org id=B64129.168899996018828 (code B ref 64129); Mon, 10 Jul 2023 14:40:02 +0000 Received: (at 64129) by debbugs.gnu.org; 10 Jul 2023 14:39:20 +0000 Received: from localhost ([127.0.0.1]:48931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIs2m-0004tX-B9 for submit@debbugs.gnu.org; Mon, 10 Jul 2023 10:39:20 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:28938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIq9B-0001Hp-6W for 64129@debbugs.gnu.org; Mon, 10 Jul 2023 08:37:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:message-id:subject:mime-version; bh=3HlzZj++kOOcDhmbp2rTez91QLGD8PjNYmzP73V2SKY=; b=tUgDS/fGydYwvVpg5IO67Ir7/6rVaP4LooOjUMMJFka80/lKPfrA3CGU JpRntT34SFjCO05MdDNep4Oayh/Vxvhu1ZEZqiEc2grhFdKJBAjZBAcnG 8HlGrm9mZW8PxSy5mfgMS/oK3DaVf95VEEcLMwiS7/VZCYUL21QN1qRQ/ A=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=philippe.virouleau@inria.fr; spf=None smtp.helo=postmaster@zcs-store3.inria.fr Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of philippe.virouleau@inria.fr designates 128.93.142.30 as permitted sender) identity=mailfrom; client-ip=128.93.142.30; receiver=mail2-relais-roc.national.inria.fr; envelope-from="philippe.virouleau@inria.fr"; x-sender="philippe.virouleau@inria.fr"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:128.93.142.0/24 ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx ~all" Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@zcs-store3.inria.fr) identity=helo; client-ip=128.93.142.30; receiver=mail2-relais-roc.national.inria.fr; envelope-from="philippe.virouleau@inria.fr"; x-sender="postmaster@zcs-store3.inria.fr"; x-conformance=spf_only X-IronPort-AV: E=Sophos;i="6.01,194,1684792800"; d="scan'208,217";a="116907650" X-MGA-submission: MDFeIsdRYwdMgiy7MVZq/i35ti3mIezawce3eKldQyJLHzjolesp5EfHuqX4g8dXvlEOXXHUR3cJdepTp6euYg7z08uag3NzmJRTR1XCRSYDilSlG7tTT1qytzq6fIUbcrSTTk0BtBwdNzC9KMbKR8YptZIt4VYYs3pGV06VKeh8iA== Received: from zcs-store3.inria.fr ([128.93.142.30]) by mail2-relais-roc.national.inria.fr with ESMTP; 10 Jul 2023 14:37:38 +0200 Date: Mon, 10 Jul 2023 14:37:38 +0200 (CEST) From: Philippe Virouleau Message-ID: <228747686.15986979.1688992658667.JavaMail.zimbra@inria.fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_339a5816-d763-4cf4-bc0f-265c901673e6" X-Originating-IP: [193.50.110.150] X-Mailer: Zimbra 8.8.15_GA_4545 (ZimbraWebClient - FF115 (Linux)/8.8.15_GA_4545) Thread-Index: HB7QI3AL4RNlBuFBphdg8do6wKOXIw== Thread-Topic: clang-runtime-15: Fix address sanitizer support X-Spam-Score: -2.3 (--) X-Mailman-Approved-At: Mon, 10 Jul 2023 10:39:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=_339a5816-d763-4cf4-bc0f-265c901673e6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Tobias and all, I can confirm instrumented builds are also broken with [ mailto:clang-runtime@15 | clang-runtime@15 ] at the moment(using `clang -fprofile-instr-generate`) because `libclang_rt.profile-x86_64.a` doesn't exist. In my opinion your suggested patch is just fine, as I believe we have to keep static files for this package: - clang's driver actually explicitly link static files for some of them: [ https://github.com/llvm/llvm-project/blob/4c6f95be29c6ce0f89663a5103c58ee63d76cda3/clang/lib/Driver/ToolChains/CommonArgs.cpp#L1070-L1072 | https://github.com/llvm/llvm-project/blob/4c6f95be29c6ce0f89663a5103c58ee63d76cda3/clang/lib/Driver/ToolChains/CommonArgs.cpp#L1070-L1072 ] - I couldn't find a recent explanation for this and all compiler-rt components, but this forum post explains why there are both static libs and shared libs: [ https://discourse.llvm.org/t/asan-static-linking-on-android/29223/3 | https://discourse.llvm.org/t/asan-static-linking-on-android/29223/3 ] (basically they use static linking to intercept only calls from the main binary and not from dependent libraries, thanks to a glibc load order behavior, but the trick doesn't work on android and other platforms so they LD_PRELOAD a shared lib). By a quick glance at the installed components I couldn't find any static library that we can remove (most of them only exist as a static library, and the others are sanitizers). Regards, Philippe --=_339a5816-d763-4cf4-bc0f-265c901673e6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Tobias and all,
=

I can confirm instrumented b= uilds are also broken with clang-runtim= e@15 at the moment(using `clang -fprofile-instr-generate`) because `lib= clang_rt.profile-x86_64.a` doesn't exist.
In my opinion your suggested patch is just fine, as I believe we have to = keep static files for this package:
  - I couldn't find a recent explanation f= or this and all compiler-rt components, but this forum post explains why th= ere are both static libs and shared libs: https://discourse.llvm.org/t= /asan-static-linking-on-android/29223/3 (basically they use static link= ing to intercept only calls from the main binary and not from dependent lib= raries, thanks to a glibc load order behavior, but the trick doesn't work o= n android and other platforms so they LD_PRELOAD a shared lib).

By a quick glan= ce at the installed components I couldn't find any static library that we c= an remove (most of them only exist as a static library, and the others are = sanitizers).

Regards,
Philippe
--=_339a5816-d763-4cf4-bc0f-265c901673e6-- From unknown Sun Jun 22 11:42:50 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Tobias Kortkamp Subject: bug#64129: closed (Re: bug#64129: [PATCH] gnu: clang-runtime-15: Fix address sanitizer support) Message-ID: References: <87sf9ryf32.fsf_-_@gnu.org> <5c775384d6459219465668b778bcb9ddf1c803d1.1687008629.git.tobias.kortkamp@gmail.com> X-Gnu-PR-Message: they-closed 64129 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 64129@debbugs.gnu.org Date: Thu, 13 Jul 2023 16:03:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1689264182-6881-1" This is a multi-part message in MIME format... ------------=_1689264182-6881-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #64129: [PATCH] gnu: clang-runtime-15: Fix address sanitizer support which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 64129@debbugs.gnu.org. --=20 64129: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64129 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1689264182-6881-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 64129-done) by debbugs.gnu.org; 13 Jul 2023 16:02:53 +0000 Received: from localhost ([127.0.0.1]:40648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJymK-0001mR-Nl for submit@debbugs.gnu.org; Thu, 13 Jul 2023 12:02:52 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:62177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJymG-0001m5-II for 64129-done@debbugs.gnu.org; Thu, 13 Jul 2023 12:02:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version:content-transfer-encoding; bh=/ObQsjkXiB7+hRmRZh649M2oo8kNTClsR/obsdaCJkg=; b=IjuyxUiJhE2raP41kbsPKE1TO65r9FZTNtPh9LCs5KCnt9VCMUMuo0GU XoJYkqNmgLI3Q/ydctfUul/oKO9A+a2cvGtWBqJWnSPPuy8ck4W6oabE9 jckPtYO+yWGBIdkZGDhegEMS2Keh2vPTLibX399UFCb0f/8gYdB9u9Y/1 4=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludovic.courtes@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.01,203,1684792800"; d="scan'208";a="117503976" Received: from unknown (HELO ribbon) ([193.50.110.205]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2023 18:02:43 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Philippe Virouleau , Tobias Kortkamp Subject: Re: bug#64129: [PATCH] gnu: clang-runtime-15: Fix address sanitizer support References: <5c775384d6459219465668b778bcb9ddf1c803d1.1687008629.git.tobias.kortkamp@gmail.com> <228747686.15986979.1688992658667.JavaMail.zimbra@inria.fr> Date: Thu, 13 Jul 2023 18:02:41 +0200 In-Reply-To: <228747686.15986979.1688992658667.JavaMail.zimbra@inria.fr> (Philippe Virouleau's message of "Mon, 10 Jul 2023 14:37:38 +0200 (CEST)") Message-ID: <87sf9ryf32.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64129-done Cc: 64129-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Tobias & Philippe, I was reluctant about keeping all those .a files due to the extra size, but based on your analysis, we have no choice but to keep them. So pushed as commit ae92d98b9375e1d753bd9ab495ed5c7dcd3f1af5. Thank you! Ludo=E2=80=99. ------------=_1689264182-6881-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Jun 2023 13:32:52 +0000 Received: from localhost ([127.0.0.1]:51066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAW2u-00034U-0R for submit@debbugs.gnu.org; Sat, 17 Jun 2023 09:32:52 -0400 Received: from lists.gnu.org ([209.51.188.17]:56458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAW2s-00034L-6U for submit@debbugs.gnu.org; Sat, 17 Jun 2023 09:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAW2r-0000A1-T9 for guix-patches@gnu.org; Sat, 17 Jun 2023 09:32:49 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qAW2p-0004mF-NL for guix-patches@gnu.org; Sat, 17 Jun 2023 09:32:49 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5164c5bd369so445814a12.1 for ; Sat, 17 Jun 2023 06:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687008765; x=1689600765; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=31BpmyyZ4aBBgJpyOFd40SsAlrk/pC7HTZH6ooUO5xU=; b=eTmnFC1pZdlBh/wx9ohdI/arDB0KIlXQRyrRytic+QPGYUsBCPzqMmafY2FpeexV0m cgqfK9be8rWM/ay0yLJcqYXjtmTvW2MOUtwb2oZb+NED+qBCCgiEWjLueQdtTyj5kEow 496g7C9iWipPgRPRlb4fuK4mvfC8+VYDSD5u8KSf5aPNVdS+atcLyQS/nY6IpQKXyGRO ZcCCfY8+M+4TDAmAy8Wm/vjr4qLtZYy38NftgDo8RCPHvRT2j8Ij6hdRbSQi9s2MlXhK xQfa6zrbNGbBTs4cgupAv9pSPjwi4uwEOyRvQWGOA4jVN6hlj776Iz756i4f61uuFQr0 Uu5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687008765; x=1689600765; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=31BpmyyZ4aBBgJpyOFd40SsAlrk/pC7HTZH6ooUO5xU=; b=RNfnZmkV6QdoZNwxuZ752AAiOsJb0XU3GcapQys9qyF05oekn3UZrZBHamczg7WqZE /ELS7jXwJRTAZug8ImQ7sctyDv/G5zlTc+kvYgYSuam/h8qDxXfdAI3MPUdntKTtf8xV A+AyWgV4bqSwrZ5lHHR0zNX1aLCBhx8mYmTXB7vdhE6Y1dyR1mQmQMtclwKLRwqq2O7k Wrz1nzPJ/R/jfdm9UDXf1pbx4bXHTVcQhZJ5XSPI4gcDp5lo4f0fFRL7k/tYJM1Sog8o e7slmgZOJvwBGD/sDY8GIvuw09jpprW5zjx3PRZbb5chj2H5v3vi8IGtbOjeZLAuL6+3 ZCPQ== X-Gm-Message-State: AC+VfDzKI9Wwom6NjtW8EHRPuvX3Tsq76cZSNaCJcLCbadxmPiRa2b/g 6w0ButBr4lxZoknhYChQn9iUpFoClj0= X-Google-Smtp-Source: ACHHUZ4JfO8rstp5WE7QQqgjxmaOqXx14X4YtZ7heRVrkW86UYMgeHo113vQh84ff1obkbrRS70f4g== X-Received: by 2002:a17:906:5354:b0:986:7872:a7bc with SMTP id j20-20020a170906535400b009867872a7bcmr3155046ejo.3.1687008764776; Sat, 17 Jun 2023 06:32:44 -0700 (PDT) Received: from anubis.kortkamp.xyz (p200300ff7f008500873e7d05b0b76269.dip0.t-ipconnect.de. [2003:ff:7f00:8500:873e:7d05:b0b7:6269]) by smtp.gmail.com with ESMTPSA id e24-20020a170906081800b009786c8249d6sm12266367ejd.175.2023.06.17.06.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Jun 2023 06:32:44 -0700 (PDT) From: Tobias Kortkamp To: guix-patches@gnu.org Subject: [PATCH] gnu: clang-runtime-15: Fix address sanitizer support Date: Sat, 17 Jun 2023 15:31:56 +0200 Message-Id: <5c775384d6459219465668b778bcb9ddf1c803d1.1687008629.git.tobias.kortkamp@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=tobias.kortkamp@gmail.com; helo=mail-ed1-x529.google.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Tobias Kortkamp X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) $ guix shell clang-toolchain@15 -- clang -o test -fsanitize=address test.c ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan_static-x86_64.a: No such file or directory ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory clang-15: error: linker command failed with exit code 1 (use -v to see invocation) * gnu/packages/llvm.scm (clang-runtime-15): Fix address sanitizer support by bringing back the static libraries. --- Hi, I'm unable to compile programs with -fsanitize=address with clang-toolchain@15: #+name test.c #+begin_src c int main() { return 0; } #+end_src #+begin_quote $ guix describe Generation 46 Jun 12 2023 09:12:12 (current) guix dffaf42 repository URL: https://git.savannah.gnu.org/git/guix.git branch: master commit: dffaf42e5eac3822bd6b44e9749fc8e5f48fb99c $ guix shell clang-toolchain -- clang -o test -fsanitize=address test.c ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan_static-x86_64.a: No such file or directory ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory clang-15: error: linker command failed with exit code 1 (use -v to see invocation) #+end_quote Similar with -shared-libsan: #+begin_quote $ guix shell clang-toolchain -- clang -o test -shared-libsan -fsanitize=address test.c ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan-preinit-x86_64.a: No such file or directory ld: cannot find /gnu/store/i429h17s15g48ir9vl1bzp3cv39l5pib-clang-runtime-15.0.7/lib/linux/libclang_rt.asan_static-x86_64.a: No such file or directory clang-15: error: linker command failed with exit code 1 (use -v to see invocation) #+end_quote With clang-toolchain@14 everything works fine. Unless I'm missing some magic flag in the clang command, I'm guessing that the reason for this is the following bad phase in the clang-runtime-15 package which is missing in clang-runtime-14: #+begin_src scheme (add-after 'install 'delete-static-libraries ;; Reduce size from 33 MiB to 7.4 MiB. (lambda _ (for-each delete-file (find-files #$output "\\.a(\\.syms)?$")))) #+end_src If I remove it then the toolchain works fine again. The phase needs to removed or fixed to not outright delete all static libraries. The patch just removes it since that's easiest. Best regards, Tobias gnu/packages/llvm.scm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index f59c8e9592..9764552a62 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -699,12 +699,7 @@ (define-public clang-runtime-15 #~(modify-phases #$phases (add-after 'unpack 'change-directory (lambda _ - (chdir "compiler-rt"))) - (add-after 'install 'delete-static-libraries - ;; Reduce size from 33 MiB to 7.4 MiB. - (lambda _ - (for-each delete-file - (find-files #$output "\\.a(\\.syms)?$")))))))) + (chdir "compiler-rt"))))))) (native-inputs (modify-inputs (package-native-inputs template) (prepend gcc-12))) ;libfuzzer fails to build with GCC 11 base-commit: 52f2980fa3feaf6e59b9e5144391faf8feb52a87 -- 2.40.1 ------------=_1689264182-6881-1-- From unknown Sun Jun 22 11:42:50 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#64129] [PATCH] gnu: clang-runtime-15: Fix address sanitizer support Resent-From: Philippe Virouleau Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Jul 2023 20:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64129 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 64129-done@debbugs.gnu.org, Tobias Kortkamp Received: via spool by 64129-done@debbugs.gnu.org id=D64129.168953802012249 (code D ref 64129); Sun, 16 Jul 2023 20:07:01 +0000 Received: (at 64129-done) by debbugs.gnu.org; 16 Jul 2023 20:07:00 +0000 Received: from localhost ([127.0.0.1]:48616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qL81E-0003BV-Gf for submit@debbugs.gnu.org; Sun, 16 Jul 2023 16:07:00 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:1093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qL819-0003B9-Er for 64129-done@debbugs.gnu.org; Sun, 16 Jul 2023 16:06:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:message-id:in-reply-to:references: subject:mime-version:content-transfer-encoding; bh=JMU1My8jb+o3ozXiGGPV5n/hX9k6IWMOFFwbfcaTe+w=; b=JFIoxvNRYL7zosw2ZCdGIKCWtZtacvEZdryd5kSEHhlVb6+wVXxeVrOO qfMLmeuYJIHfCqNOzDJnjY4BU89FdSNnfL4gQWkFxDXxvpBHHWZbt53B0 Kepme+O4HPpg2aHrL96TdvPcYubnDZPX2vtodO7VoocdKaegCsSrMOwve k=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=philippe.virouleau@inria.fr; spf=None smtp.helo=postmaster@zcs-store3.inria.fr Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of philippe.virouleau@inria.fr designates 128.93.142.30 as permitted sender) identity=mailfrom; client-ip=128.93.142.30; receiver=mail2-relais-roc.national.inria.fr; envelope-from="philippe.virouleau@inria.fr"; x-sender="philippe.virouleau@inria.fr"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:128.93.142.0/24 ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx ~all" Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@zcs-store3.inria.fr) identity=helo; client-ip=128.93.142.30; receiver=mail2-relais-roc.national.inria.fr; envelope-from="philippe.virouleau@inria.fr"; x-sender="postmaster@zcs-store3.inria.fr"; x-conformance=spf_only X-IronPort-AV: E=Sophos;i="6.01,211,1684792800"; d="scan'208";a="117702941" X-MGA-submission: MDF2QGlHuU1fiKgOPTywg2Pz89QZHlrjq0JQavIHuE5X+lCXhSjEGakaAm5zYip2+Yj24WPQwC8vQM4sERI+AcZdQT6VqNz5dvA69+FqcZQwavvYUjBL5ovkUs0YtQWd5F4f/rts6Z+Djg0M/A33AhNUWylc9z4kiTB8NiInHQ3TRw== Received: from zcs-store3.inria.fr ([128.93.142.30]) by mail2-relais-roc.national.inria.fr with ESMTP; 16 Jul 2023 22:06:49 +0200 Date: Sun, 16 Jul 2023 22:06:48 +0200 (CEST) From: Philippe Virouleau Message-ID: <2020320932.18688059.1689538008841.JavaMail.zimbra@inria.fr> In-Reply-To: <87sf9ryf32.fsf_-_@gnu.org> References: <5c775384d6459219465668b778bcb9ddf1c803d1.1687008629.git.tobias.kortkamp@gmail.com> <228747686.15986979.1688992658667.JavaMail.zimbra@inria.fr> <87sf9ryf32.fsf_-_@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [90.50.57.191] X-Mailer: Zimbra 8.8.15_GA_4545 (ZimbraWebClient - FF115 (Linux)/8.8.15_GA_4545) Thread-Topic: bug#64129: [PATCH] gnu: clang-runtime-15: Fix address sanitizer support Thread-Index: 8GajtlJDfGyVw1+w0snYRxvgyCB53w== X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Thanks Ludo! ----- Mail original ----- > De: "Ludovic Court=C3=A8s" > =C3=80: "Philippe Virouleau" , "Tobias Kortk= amp" > Cc: 64129-done@debbugs.gnu.org > Envoy=C3=A9: Jeudi 13 Juillet 2023 18:02:41 > Objet: Re: bug#64129: [PATCH] gnu: clang-runtime-15: Fix address sanitize= r support > Hi Tobias & Philippe, >=20 > I was reluctant about keeping all those .a files due to the extra size, > but based on your analysis, we have no choice but to keep them. >=20 > So pushed as commit ae92d98b9375e1d753bd9ab495ed5c7dcd3f1af5. >=20 > Thank you! >=20 > Ludo=E2=80=99.