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

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

    <bug>
          <bug_id>40611</bug_id>
          
          <creation_ts>2021-07-30 07:17:49 +0300</creation_ts>
          <short_desc>gcc: liblto_plugin.so packaged in the wrong place</short_desc>
          <delta_ts>2021-08-02 18:44:19 +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>gcc</component>
          <version>unstable</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>40617</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Vitaly Chikunov">vt</reporter>
          <assigned_to name="Gleb F-Malinovskiy">glebfm</assigned_to>
          <cc>glebfm</cc>
    
    <cc>ldv</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>201054</commentid>
    <comment_count>0</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 07:17:49 +0300</bug_when>
    <thetext>man gcc:
  -print-file-name=library
      Print the full absolute name of the library file library that
      would be used when linking---and don&apos;t do anything else.

alt$ gcc -print-file-name=liblto_plugin.so
liblto_plugin.so

Other distros:

opensuse# gcc -print-file-name=liblto_plugin.so
/usr/lib64/gcc/x86_64-suse-linux/11/liblto_plugin.so

clearlinux# gcc -print-file-name=liblto_plugin.so
/usr/lib64/gcc/x86_64-generic-linux/11/liblto_plugin.so

fedora# gcc -print-file-name=liblto_plugin.so
liblto_plugin.so</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201082</commentid>
    <comment_count>1</comment_count>
    <who name="Gleb F-Malinovskiy">glebfm</who>
    <bug_when>2021-07-30 20:09:27 +0300</bug_when>
    <thetext>(In reply to Vitaly Chikunov from comment #0)
&gt; man gcc:
&gt;   -print-file-name=library
&gt;       Print the full absolute name of the library file library that
&gt;       would be used when linking---and don&apos;t do anything else.

$ gcc -print-search-dirs
install: /usr/lib64/gcc/x86_64-alt-linux/10/
programs: =/usr/libexec/gcc/x86_64-alt-linux/10/:/usr/libexec/gcc/x86_64-alt-linux/10/:/usr/libexec/gcc/x86_64-alt-linux/:/usr/lib64/gcc/x86_64-alt-linux/10/:/usr/lib64/gcc/x86_64-alt-linux/:/usr/lib64/gcc/x86_64-alt-linux/10/../../../../x86_64-alt-linux/bin/x86_64-alt-linux/10/:/usr/lib64/gcc/x86_64-alt-linux/10/../../../../x86_64-alt-linux/bin/
libraries: =/usr/lib64/gcc/x86_64-alt-linux/10/:/usr/lib64/gcc/x86_64-alt-linux/10/../../../../x86_64-alt-linux/lib/x86_64-alt-linux/10/:/usr/lib64/gcc/x86_64-alt-linux/10/../../../../x86_64-alt-linux/lib/../lib64/:/usr/lib64/gcc/x86_64-alt-linux/10/../../../x86_64-alt-linux/10/:/usr/lib64/gcc/x86_64-alt-linux/10/../../../../lib64/:/lib/x86_64-alt-linux/10/:/lib/../lib64/:/usr/lib/x86_64-alt-linux/10/:/usr/lib/../lib64/:/usr/lib64/gcc/x86_64-alt-linux/10/../../../../x86_64-alt-linux/lib/:/usr/lib64/gcc/x86_64-alt-linux/10/../../../:/lib/:/usr/lib/

В gcc есть две опции на эту тему:
* -print-file-name (она ищет в путях libraries:)
* -print-prog-name (она ищет в путях programs:)

&gt; alt$ gcc -print-file-name=liblto_plugin.so
&gt; liblto_plugin.so
&gt; 
&gt; Other distros:
&gt; 
&gt; opensuse# gcc -print-file-name=liblto_plugin.so
&gt; /usr/lib64/gcc/x86_64-suse-linux/11/liblto_plugin.so
&gt; 
&gt; clearlinux# gcc -print-file-name=liblto_plugin.so
&gt; /usr/lib64/gcc/x86_64-generic-linux/11/liblto_plugin.so

В некоторых дистрибутивах libraries и programs кладутся в одно и то же место.

&gt; fedora# gcc -print-file-name=liblto_plugin.so
&gt; liblto_plugin.so

А в некотороых -- в разные, в таких дистрибутивах работает только
$ gcc -print-prog-name=liblto_plugin.so
/usr/libexec/gcc/x86_64-alt-linux/10/liblto_plugin.so</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201083</commentid>
    <comment_count>2</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 20:23:22 +0300</bug_when>
    <thetext>Значит так и должно быть? Меня смутило &quot;full absolute name&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201085</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-07-30 20:52:45 +0300</bug_when>
    <thetext>(In reply to Vitaly Chikunov from comment #2)
&gt; Значит так и должно быть? Меня смутило &quot;full absolute name&quot;.

Это если найдёт, то full absolute name.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201086</commentid>
    <comment_count>4</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 20:54:10 +0300</bug_when>
    <thetext>(Ответ для Dmitry V. Levin на комментарий #3)
&gt; (In reply to Vitaly Chikunov from comment #2)
&gt; &gt; Значит так и должно быть? Меня смутило &quot;full absolute name&quot;.
&gt; 
&gt; Это если найдёт, то full absolute name.

Теперь понял. Спасибо!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201087</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-07-30 20:54:46 +0300</bug_when>
    <thetext>(In reply to Gleb F-Malinovskiy from comment #1)
&gt; В некоторых дистрибутивах libraries и programs кладутся в одно и то же место.
&gt; 
&gt; &gt; fedora# gcc -print-file-name=liblto_plugin.so
&gt; &gt; liblto_plugin.so
&gt; 
&gt; А в некотороых -- в разные, в таких дистрибутивах работает только
&gt; $ gcc -print-prog-name=liblto_plugin.so
&gt; /usr/libexec/gcc/x86_64-alt-linux/10/liblto_plugin.so

Я не понял, а почему liblto_plugin.so попал в programs, а не в libraries?
Это же plugin, а не executable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201089</commentid>
    <comment_count>6</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 22:30:12 +0300</bug_when>
    <thetext>(Ответ для Dmitry V. Levin на комментарий #5)
&gt; Я не понял, а почему liblto_plugin.so попал в programs, а не в libraries?
&gt; Это же plugin, а не executable.


Видимо, надо переложить в /usr/lib64/gcc/x86_64-alt-linux/10/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201090</commentid>
    <comment_count>7</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-07-30 22:32:33 +0300</bug_when>
    <thetext>(In reply to Vitaly Chikunov from comment #6)
&gt; (Ответ для Dmitry V. Levin на комментарий #5)
&gt; &gt; Я не понял, а почему liblto_plugin.so попал в programs, а не в libraries?
&gt; &gt; Это же plugin, а не executable.
&gt; 
&gt; Видимо, надо переложить в /usr/lib64/gcc/x86_64-alt-linux/10/

Зависит от того, для каких процессов предназначен этот плагин.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201091</commentid>
    <comment_count>8</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 22:37:48 +0300</bug_when>
    <thetext>&gt; Зависит от того, для каких процессов предназначен этот плагин.

Для libbfd, и всех кто с ней слинкован. В binutils это:

/usr/bin/addr2line
/usr/bin/ar
/usr/bin/as
/usr/bin/c++filt
/usr/bin/gprof
/usr/bin/ld.bfd
/usr/bin/ld.default
/usr/bin/nm
/usr/bin/objcopy
/usr/bin/objdump
/usr/bin/ranlib
/usr/bin/size
/usr/bin/strings
/usr/bin/strip

ps.
$ strings /usr/lib64/libbfd-2.35.1.20210104.so|grep bfd-pl
/usr/bin/../lib/bfd-plugins
/usr/lib64/bfd-plugins</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201092</commentid>
    <comment_count>9</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 22:45:54 +0300</bug_when>
    <thetext>$ findsym-remote bfd_plugin_set_plugin:
sisyphus x86_64 binutils-2.35.2-alt2.x86_64.rpm usr/bin/ar bfd_plugin_set_plugin:U
sisyphus x86_64 binutils-2.35.2-alt2.x86_64.rpm usr/bin/nm bfd_plugin_set_plugin:U
sisyphus x86_64 binutils-2.35.2-alt2.x86_64.rpm usr/bin/ranlib bfd_plugin_set_plugin:U
sisyphus x86_64 kcov-38-alt3.x86_64.rpm usr/bin/kcov bfd_plugin_set_plugin@@Base:T
sisyphus x86_64 perf-5.13-alt1.x86_64.rpm usr/bin/trace bfd_plugin_set_plugin@@Base:T
sisyphus x86_64 binutils-2.35.2-alt2.x86_64.rpm usr/lib64/libbfd-2.35.2.20210110.so bfd_plugin_set_plugin@@Base:T</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201093</commentid>
    <comment_count>10</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 22:51:21 +0300</bug_when>
    <thetext>То есть юзают только ar, nm, ranlib, а kcov и perf слинкованы статически.

Или &quot;для каких процессов&quot; вопрос был о чём-то другом?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201094</commentid>
    <comment_count>11</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-07-30 22:53:47 +0300</bug_when>
    <thetext>(In reply to Vitaly Chikunov from comment #10)
&gt; То есть юзают только ar, nm, ranlib, а kcov и perf слинкованы статически.

Т.е. может использовать практически кто угодно.
Тогда получается, что плагин не на месте.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201095</commentid>
    <comment_count>12</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 22:57:15 +0300</bug_when>
    <thetext>Переоткрыл и переименовал ошибку.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201096</commentid>
    <comment_count>13</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-30 23:05:16 +0300</bug_when>
    <thetext>  $ rpm -ql gcc10 | grep /usr/libexec/gcc
  /usr/libexec/gcc/x86_64-alt-linux/10
  /usr/libexec/gcc/x86_64-alt-linux/10/collect2
  /usr/libexec/gcc/x86_64-alt-linux/10/liblto_plugin.so
  /usr/libexec/gcc/x86_64-alt-linux/10/liblto_plugin.so.0
  /usr/libexec/gcc/x86_64-alt-linux/10/liblto_plugin.so.0.0.0
  /usr/libexec/gcc/x86_64-alt-linux/10/lto-wrapper
  /usr/libexec/gcc/x86_64-alt-linux/10/lto1
  /usr/libexec/gcc/x86_64-alt-linux/10/plugin
  /usr/libexec/gcc/x86_64-alt-linux/10/plugin/gengtype

У opensuse и clr /usr/libexec/gcc/ нет и все оттуда лежит в /usr/lib64/gcc/*/11/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201115</commentid>
    <comment_count>14</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-31 23:33:18 +0300</bug_when>
    <thetext>(Ответ для Dmitry V. Levin на комментарий #11)
&gt; Тогда получается, что плагин не на месте.

Сделал пример задания где он переложен https://git.altlinux.org/tasks/281519/

  builder@x86_64:~$ gcc -print-file-name=liblto_plugin.so
  /usr/lib64/gcc/x86_64-alt-linux/10/liblto_plugin.so</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201138</commentid>
    <comment_count>15</comment_count>
    <who name="Gleb F-Malinovskiy">glebfm</who>
    <bug_when>2021-08-02 11:05:47 +0300</bug_when>
    <thetext>(In reply to Dmitry V. Levin from comment #5)
&gt; (In reply to Gleb F-Malinovskiy from comment #1)
&gt; &gt; В некоторых дистрибутивах libraries и programs кладутся в одно и то же место.
&gt; &gt; 
&gt; &gt; &gt; fedora# gcc -print-file-name=liblto_plugin.so
&gt; &gt; &gt; liblto_plugin.so
&gt; &gt; 
&gt; &gt; А в некотороых -- в разные, в таких дистрибутивах работает только
&gt; &gt; $ gcc -print-prog-name=liblto_plugin.so
&gt; &gt; /usr/libexec/gcc/x86_64-alt-linux/10/liblto_plugin.so
&gt; 
&gt; Я не понял, а почему liblto_plugin.so попал в programs, а не в libraries?
&gt; Это же plugin, а не executable.
Это как раз очевидно, они в programs кладут helper-ы, а в libraries кладут то, с чем имеет смысл линковаться.

Но решение меня вполне устраивает, хоть идея смешивать это всё и не вызывает у меня восторга.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201155</commentid>
    <comment_count>16</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2021-08-02 18:44:19 +0300</bug_when>
    <thetext>gcc10-10.3.1-alt3 -&gt; sisyphus:

 Sat Jul 31 2021 Vitaly Chikunov &lt;vt@altlinux&gt; 10.3.1-alt3
 - Move contents of libexecdir to libdir (ALT#40611).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>