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

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

    <bug>
          <bug_id>39284</bug_id>
          
          <creation_ts>2020-11-13 14:59:04 +0300</creation_ts>
          <short_desc>debugedit testsuite fails on mipsel</short_desc>
          <delta_ts>2021-07-30 10:28:14 +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>mipsel</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="Ivan A. Melnikov">iv</reporter>
          <assigned_to name="Ivan A. Melnikov">iv</assigned_to>
          <cc>arseny</cc>
    
    <cc>glebfm</cc>
    
    <cc>imz</cc>
    
    <cc>sin</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>194193</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2020-11-13 14:59:04 +0300</bug_when>
    <thetext>$ ssh gyle.sec task show 53635
id=53635 locked=no shared=no fail_early=yes test_only=no repo=sisyphus_mipsel owner=recycler state=FAILED try=1 iter=1
 100:srpm=rpm-build-4.0.4-alt155.src.rpm
 100:userid=recycler

From the logs:

## --------------------- ##
## rpm 4.0.4 test suite. ##
## --------------------- ##

RPM debugedit

  1: debugedit help                                  ok
  2: debugedit executable                            ok
  3: debugedit .debug_str objects                    FAILED (debugedit.at:101)
  4: debugedit .debug_str partial                    FAILED (debugedit.at:132)
  5: debugedit .debug_str exe                        FAILED (debugedit.at:162)
  6: debugedit .debug_info objects                   FAILED (debugedit.at:201)
  7: debugedit .debug_info partial                   FAILED (debugedit.at:224)
  8: debugedit .debug_info exe                       FAILED (debugedit.at:247)
  9: debugedit .debug_types objects                  ok
 10: debugedit .debug_types partial                  ok
 11: debugedit .debug_types exe                      ok
 12: debugedit .debug_line objects                   FAILED (debugedit.at:367)
 13: debugedit .debug_line partial                   FAILED (debugedit.at:389)
 14: debugedit .debug_line exe                       FAILED (debugedit.at:411)
 15: debugedit .debug_macro objects                  ok
 16: debugedit .debug_macro partial                  ok
 17: debugedit .debug_macro exe                      ok

## ------------- ##
## Test results. ##
## ------------- ##

ERROR: All 17 tests were run,
9 failed unexpectedly.
## ------------------------- ##
## rpmtests.log was created. ##
## ------------------------- ##</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>194194</commentid>
    <comment_count>1</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2020-11-13 15:13:54 +0300</bug_when>
    <thetext>Actually, saving sources into debuginfo packages never worked properly (or at all?) on mipsel.

The thing is that on MIPS, traditionally, the debug information is stored in a bit different way. For starters, debugedit should handle .debug_info section even if it has MIPS-specific SHT_MIPS_DWARF type:

http://git.altlinux.org/people/iv/packages/?p=rpm-build.git;a=commit;h=1d7d10edd03c2bc6557086eca22a115aa8f9dd00

That, at least, makes rpm-build testsuite pass, but there may be more to it. More testing is surely needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>194198</commentid>
    <comment_count>2</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2020-11-13 16:49:04 +0300</bug_when>
    <thetext>Btw, possible, you also need commit like this
http://git.altlinux.org/people/vt/packages/?p=rpm-build.git;a=commitdiff;h=bb0b76e75998641fdb94469e381688bcc74e3c8a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>194245</commentid>
    <comment_count>3</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2020-11-16 15:07:20 +0300</bug_when>
    <thetext>(In reply to Vitaly Chikunov from comment #2)
&gt; Btw, possible, you also need commit like this
&gt; http://git.altlinux.org/people/vt/packages/?p=rpm-build.git;a=commitdiff;
&gt; h=bb0b76e75998641fdb94469e381688bcc74e3c8a

Thank you for pointing this out. I would expect that something like that is needed, and it&apos;s easy to imagine what exectly (R_MIPS_32 reolcation for EM_MIPS and EM_MIPS_RS3_LE machines).

But for all the binaries I&apos;ve seen the relocations for .debug_info section are stored in .rel.debug_info (of type REL) and have value zero, so are &quot;uninteresting&quot;:

http://git.altlinux.org/people/iv/packages/?p=rpm-build.git;a=blob;f=tools/debugedit.c;h=051eea1227d1411887aef8a02d8d00ff22b834e6#l543

During this weekend, quite a few packages were build with rpm-build with my patch from comment #1, and &quot;Unhandled relocation&quot; error was not triggered in any of them.

Is there a way to make our current toolchain to produce a relocation against .debug_info section that would be &quot;interesting&quot; for setup_relbuf?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>194252</commentid>
    <comment_count>4</comment_count>
    <who name="Vitaly Chikunov">vt</who>
    <bug_when>2020-11-16 17:14:01 +0300</bug_when>
    <thetext>That bug was only triggered on kernel modules objects (ko).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>197153</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-03-23 01:01:07 +0300</bug_when>
    <thetext>(In reply to Ivan A. Melnikov from comment #3)
&gt; http://git.altlinux.org/people/iv/packages/?p=rpm-build.git;a=blob;f=tools/
&gt; debugedit.c;h=051eea1227d1411887aef8a02d8d00ff22b834e6#l543

Is this commit ready to be merged?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>197157</commentid>
    <comment_count>6</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2021-03-23 12:26:52 +0300</bug_when>
    <thetext>&gt; Is this commit ready to be merged?

Yes. It fixes debuginfo generation on mipsel, and makes the tests pass. rpm-build with this commit applied already works in sisyphus_mipsel and p9_mipsel for quite some time, so it&apos;s also well tested.

I don&apos;t seem to need another part Vitaly mentioned in comment #2, even to build debuginfo-enabled kernels, but I still don&apos;t now why mipsel is different from other platforms here and how exactly. That&apos;s the only thing that was holding me from pushing this change into the Sisyphus rpm-build more eagerly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>201059</commentid>
    <comment_count>7</comment_count>
    <who name="Ivan A. Melnikov">iv</who>
    <bug_when>2021-07-30 10:28:14 +0300</bug_when>
    <thetext>This is fixed in debugedit upstream. With the transition to separately-packaged debugedit, this is fixed in Sisyphus and p10, too.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>