<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>47780</bug_id>
          
          <creation_ts>2023-09-28 20:51:35 +0300</creation_ts>
          <short_desc>Produce palatable build-id in clang-built executables</short_desc>
          <delta_ts>2023-10-01 19:18:46 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>clang</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://lore.altlinux.org/devel/ZRS1KlTv1QQr0yvL@cello/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>46625</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Arseny Maslennikov">arseny</reporter>
          <assigned_to name="Arseny Maslennikov">arseny</assigned_to>
          <cc>aen</cc>
    
    <cc>arseny</cc>
    
    <cc>lakostis</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>234057</commentid>
    <comment_count>0</comment_count>
    <who name="Arseny Maslennikov">arseny</who>
    <bug_when>2023-09-28 20:51:35 +0300</bug_when>
    <thetext>On Sat, Sep 23, 2023 at 04:44:38PM +0700, Ilya Kurdyukov wrote:
&gt; On 9/23/23 16:36, Dmitry V. Levin wrote:
&gt; &gt; &gt;   &gt; --ldflags=-Wl,--build-id=sha1
&gt; &gt; Этой истории уже много лет, поэтому удивительно, что где-то до сих пор
&gt; &gt; по умолчанию создаётся 64-битный build id.  С точки зрения репозитория
&gt; &gt; важно не столько, чтобы конкретный пакет был исправлен, сколько чтобы
&gt; &gt; этого не происходило по умолчанию.
&gt; &gt; 
&gt; ghc (смотрел спеку 8.6.4) для armh/aarch64 собирается через LLVM:
&gt; 
&gt; * Thu Aug 17 2023 Anton Zhukharev &lt;ancieg@altlinux.org&gt; 8.6.4-alt9
&gt; - Fixed FTBFS.
&gt; - Built with llvm12.0 on armh and aarch64.
&gt; - Stored LLVM version in %%ghc_llvm_version macro.
&gt; 
&gt; Это опции LLD, линковщика из LLVM:
&gt; 
&gt; --build-id=value
&gt;     Generate a build ID note. value may be one of fast, md5, sha1, tree,
&gt; uuid, 0xhex-string, and none. tree is an alias for sha1. Build-IDs of type
&gt; fast, md5, sha1, and tree are calculated from the object contents. fast is
&gt; not intended to be cryptographically secure.
&gt; --build-id
&gt;     Synonym for --build-id=fast.

Выяснилось, что собранные clang+lld бинарники вообще никакого build-id не содержат.
  % eu-readelf -n $(command -v make) | grep -cFA4 .note.gnu.build-id
  1
  % eu-readelf -n $(command -v clangd-17) | grep -cFA4 .note.gnu.build-id
  0

	«– Как же, позвольте?.. Он же служил в очистке...»

Пусть clang, используемый для сборки пакетов, передаёт линкеру --build-id=sha1 (именно так, чтобы все возможные линкеры поняли, что от них требуется).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>234123</commentid>
    <comment_count>1</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2023-10-01 19:13:53 +0300</bug_when>
    <thetext>llvm17.0-17.0.1-alt3 -&gt; sisyphus:

 Thu Sep 28 2023 Arseny Maslennikov &lt;arseny@altlinux&gt; 17.0.1-alt3
 - clang: Restore the default disposition of -grecord-command-line.
 - clang: Pass --build-id=sha1 to linkers by default. (Closes: 47780)
   Both of these changes are applied to clangs we build ALT packages with; if we
   ever decouple clang-for-packages from clang-for-users, upstream behaviour can
   be restored for the latter.
 Mon Sep 25 2023 Arseny Maslennikov &lt;arseny@altlinux&gt; 17.0.1-alt2
 - Readjusted CMake file validation fixes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>234124</commentid>
    <comment_count>2</comment_count>
    <who name="AEN">aen</who>
    <bug_when>2023-10-01 19:18:46 +0300</bug_when>
    <thetext>Спасибо!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>