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

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

    <bug>
          <bug_id>38991</bug_id>
          
          <creation_ts>2020-09-25 07:15:08 +0300</creation_ts>
          <short_desc>Некорректные пути к libgcc в собираемом приложении</short_desc>
          <delta_ts>2023-02-24 10:40:12 +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>libgccjit9-devel</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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Denis Smirnov">mithraen</reporter>
          <assigned_to name="Gleb F-Malinovskiy">glebfm</assigned_to>
          <cc>ldv</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>192833</commentid>
    <comment_count>0</comment_count>
    <who name="Denis Smirnov">mithraen</who>
    <bug_when>2020-09-25 07:15:08 +0300</bug_when>
    <thetext>пример из: https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html
собирается, но не работает вываливая ошибки:

/usr/bin/ld.default: cannot find crtbeginS.o: No such file or directory
/usr/bin/ld.default: cannot find -lgcc
/usr/bin/ld.default: cannot find -lgcc_s
libgccjit.so: error: error invoking gcc driver
NULL result

Запуск под strace показывает, что собранный бинарник ищет:
libgcc.so и crtbeginS.o, crtend.o, crtendS.o  где угодно, только не в /usr/lib64/gcc/..., например в /usr/x86_64-alt-linux/lib64

access(&quot;../lib64/gcc/x86_64-alt-linux/9.3.1/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;../lib64/gcc/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;../x86_64-alt-linux/lib/x86_64-alt-linux/9.3.1/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;../x86_64-alt-linux/lib/../lib64/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;../lib64/x86_64-alt-linux/9.3.1/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;../lib64/../lib64/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;/lib/x86_64-alt-linux/9.3.1/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;/lib/../lib64/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;/usr/lib/x86_64-alt-linux/9.3.1/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;/usr/lib/../lib64/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;../x86_64-alt-linux/lib/crtbeginS.o&quot;, R_OK) = -1 ENOENT (No such file or directory)
access(&quot;../lib64/crtbeginS.o&quot;, R_OK)    = -1 ENOENT (No such file or directory)
access(&quot;/lib/crtbeginS.o&quot;, R_OK)        = -1 ENOENT (No such file or directory)
access(&quot;/usr/lib/crtbeginS.o&quot;, R_OK)    = -1 ENOENT (No such file or directory)

Обращаю внимание во-первых на использование полной версии в некоторых путях (9.3.1, а не 9), и на то, что используемые абсолютные пути имеют мало общего с реальным местположением этих каталогов у нас.

Работающий gccjit нужен для сборки gccemacs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>222085</commentid>
    <comment_count>1</comment_count>
    <who name="Denis Smirnov">mithraen</who>
    <bug_when>2023-02-24 10:40:12 +0300</bug_when>
    <thetext>Проверил со свежим gcc -- работает.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>