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

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

    <bug>
          <bug_id>34162</bug_id>
          
          <creation_ts>2017-11-09 14:08:06 +0300</creation_ts>
          <short_desc>check that things have been compiled with %optflags</short_desc>
          <delta_ts>2024-11-25 17:08:31 +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>rpm-build</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=40628</see_also>
    
    <see_also>http://bugzilla.altlinux.org/show_bug.cgi?id=15376</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>34161</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ivan Zakharyaschev">imz</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>aen</cc>
    
    <cc>arseny</cc>
    
    <cc>bircoph</cc>
    
    <cc>glebfm</cc>
    
    <cc>ilyakurdyukov</cc>
    
    <cc>imz</cc>
    
    <cc>lav</cc>
    
    <cc>ldv</cc>
    
    <cc>mike</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>167095</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Zakharyaschev">imz</who>
    <bug_when>2017-11-09 14:08:06 +0300</bug_when>
    <thetext>4.0.4-alt105

A BRP check that would check that the resulting files have been compiled with flags which include all %optflags would help to see which packages have problems with honoring %optflags.

This would warn the maintainers that their attention is needed to fix this before someone changes %optflags to rebuild packages differently en masse (on another platform or with a different mechanism for passing %optflags to the compiler as in https://bugzilla.altlinux.org/show_bug.cgi?id=34161 ).

bircoph@ had this idea and suggested to use a special GCC flag to record the actually used flags in the resulting files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>167845</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2017-12-12 00:07:03 +0300</bug_when>
    <thetext>(In reply to comment #0)
&gt; bircoph@ had this idea and suggested to use a special GCC flag to record the
&gt; actually used flags in the resulting files.

The option is called -frecord-gcc-switches; it adds .GCC.command.line section in each generated ELF file.  These sections have the same type (PROGBITS) and flags (MERGE, STRINGS) as .comment sections. Like .comment sections, .GCC.command.line sections are moved to .debug files by debugedit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>168347</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2018-01-07 20:11:19 +0300</bug_when>
    <thetext>rpm-build:

Sun Jan 07 2018 Dmitry V. Levin &lt;ldv@altlinux&gt; 4.0.4-alt107
- compare_deps: fixed a bug in handling epochs.
- platform.in:
  + %optflags_core: added -frecord-gcc-switches (see: #34162);
  + %make_build: implemented as a simple command (closes: #34237).
- genCpioListAndHeader: implemented remapping of device and inode numbers
  (by Vladimir D. Seleznev and me; closes: #34398).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171353</commentid>
    <comment_count>3</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2018-05-28 18:17:43 +0300</bug_when>
    <thetext>А как теперь поступать с такой ошибкой при сборке:

 &quot;/usr/bin/clang&quot;

 is not able to compile a simple test program.

 It fails with the following output:

  clang-6.0: error: unknown argument: &apos;-frecord-gcc-switches&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171354</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2018-05-28 18:26:14 +0300</bug_when>
    <thetext>(In reply to comment #3)
&gt; А как теперь поступать с такой ошибкой при сборке:
&gt; 
&gt;  &quot;/usr/bin/clang&quot;
&gt; 
&gt;  is not able to compile a simple test program.
&gt; 
&gt;  It fails with the following output:
&gt; 
&gt;   clang-6.0: error: unknown argument: &apos;-frecord-gcc-switches&apos;

не передавать -frecord-gcc-switches в clang?
не использовать clang?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171355</commentid>
    <comment_count>5</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2018-05-28 18:33:00 +0300</bug_when>
    <thetext>(В ответ на комментарий №4)
...
&gt; не передавать -frecord-gcc-switches в clang?
&gt; не использовать clang?
Хороший совет, но по строке changelog
  + %optflags_core: added -frecord-gcc-switches (see: #34162);
я ожидал хоть где-то найти его, чтобы не передавать, но
$ rpm --showrc | grep optflags_core
-14: optflags_core	-pipe

А... Ах вот оно что...
$ rpmbuild --showrc | grep optflags_core
-14: optflags_core	-pipe -frecord-gcc-switches

А точно нельзя, чтобы команда rpm --showrc выдавала те же макросы, или не работала бы вообще. А то я теперь даже не знаю, откуда она берёт свой вывод.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>171356</commentid>
    <comment_count>6</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2018-05-28 18:47:16 +0300</bug_when>
    <thetext>(В ответ на комментарий №4)
...
&gt; не передавать -frecord-gcc-switches в clang?
так и сделаю, спасибо:
%remove_optflags -frecord-gcc-switches</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201002</commentid>
    <comment_count>7</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2021-07-29 06:01:09 +0300</bug_when>
    <thetext>FYI: `%remove_optflags -frecord-gcc-switches` не нужен начиная с clang8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>255020</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Shigorin">mike</who>
    <bug_when>2024-11-25 17:05:20 +0300</bug_when>
    <thetext>Ещё стоит проверять _отсутствие_ -mtune=native при условии, что пакет собирается в репозиторий по умолчанию (см. тж. mcst#9169).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>