<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11159</bug_id>
          
          <creation_ts>2017-03-14 23:33:09 +0000</creation_ts>
          <short_desc>Using RPM4, it is not possible to control a multiarch MIPS64 system w/o error</short_desc>
          <delta_ts>2025-06-26 14:58:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>deployment</component>
          <version>2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>  </status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>alex.kanavin</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71293</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-03-14 23:33:09 +0000</bug_when>
    <thetext>Adding the following configuration to the default local.conf file:

MACHINE = &quot;qemumips64&quot;
MULTILIBS ?= &quot;multilib:lib32 multilib:lib64&quot;
DEFAULTTUNE = &quot;mips64-n32&quot;
DEFAULTTUNE_virtclass-multilib-lib32 ?= &quot;mips32r2&quot;
DEFAULTTUNE_virtclass-multilib-lib64 ?= &quot;mips64&quot;
IMAGE_INSTALL_append = &quot; lib64-bash lib32-bash bash&quot;

will produce a working image.  However, if you add the following to select a specific
&apos;preferred&apos; package (see the comments), rpm4 is not able to distinguish between MIPS64 and MIPS64 n32.

# Set RPM_PREFER_ELF_ARCH to configure preferred ABI when using rpm packaging
# backend to generate a rootfs, choices are:
# 1: ELF32 wins
# 2: ELF64 wins
# 4: ELF64 N32 wins (for mips64 or mips64el only)
RPM_PREFER_ELF_ARCH ?= &quot;1&quot;


When added this results in:

...
Install  429 Packages

Total size: 36 M
Installed size: 94 M
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction check error:
  file /sbin/ldconfig conflicts between attempted installs of lib64-libc6-2.25-r0.mips64 and libc6-2.25-r0.mips64_n32
  file /bin/bash.bash conflicts between attempted installs of bash-4.3.30-r0.mips64_n32 and lib64-bash-4.3.30-r0.mips64

Error Summary
-------------

ERROR: core-image-base-1.0-r0 do_rootfs: Function failed: do_rootfs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71294</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-03-14 23:36:41 +0000</bug_when>
    <thetext>We should be able to use rpm5&apos;s model of processing MIPS64 n32, and the necessary changes to the ELF resolution processing (make it 3-way not 2-way).

rpm.org headers already have the MIPS64_n32 &apos;file color&apos; defined, but the rest of the system is lacking in the processing for this.

The same processing is likely needed for IA32 x32 ABI as well.

Since this is a deficiency in rpm4, the code should be created and submitted back to that organization as part of this work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71295</commentid>
    <comment_count>2</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2017-03-15 09:07:04 +0000</bug_when>
    <thetext>Can you find the code in rpm5 source tree where this is happening?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71297</commentid>
    <comment_count>3</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2017-03-15 09:22:49 +0000</bug_when>
    <thetext>Also note that rpm4 people arent&apos;t particularly fond even of two-way ELF resolution (from lib/transaction.c):

/*
 * Elf files can be &quot;colored&quot;, and if enabled in the transaction, the
 * color can be used to resolve conflicts between elf-64bit and elf-32bit
 * files to the hosts preferred type, by default 64bit. The non-preferred
 * type is overwritten or never installed at all and thus the conflict
 * magically disappears. This is infamously nasty &quot;rpm magic&quot; and entirely
 * unnecessary with careful packaging.
 */

They may have a point. Why do you want to install three bash packages even though only one actual executable binary will be available?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71309</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-03-15 16:18:12 +0000</bug_when>
    <thetext>&gt; Can you find the code in rpm5 source tree where this is happening?

yes, I will try to track these down

&gt; Why do you want to install three bash packages even though only one actual executable binary will be available?

bash is just an example to illustrate the problem.  The more typical case is with something like python.

The typical case is you have the need for a large database on your RISC based system.  So you want the main system to be 32-bit (or in a MIPS64 case, MIPS64-n32) while having the database and the associated programs that use the database as being 64-bit.

By choosing the 64-bit DB, you&apos;ve now introduced dependencies on 64-bit glibc and other components as well.  Some of these components will most often include both executables and libraries.  The libraries by their nature will not conflict by filename, however standard binaries (such as ldconfig) very well may.  (Often the database engine comes with libraries as well, as you may need both the 32-bit and 64-bit installed at the same time.)

In addition, you often need to define the system so that a particular class of binaries, when requested, take precedence or you run into the situation where things might not even work.  (again, take ldconfig as an example -- the 64-bit version is capable of parsing both 64-bit and 32-bit.  However the 32-bit version usually can not parse the 64-bit libraries.)

Add to this the complication that MIPS64 has (depending on how you look at it) two 32-bit ELF ABIs or two 64-bit ELF ABIs.  (In this case, RPM4 is treating MIPS64-n32 and MIPS64 as both 64-bit.)

The other complication on MIPS (and even CISC architectures like arm and ia), they often was their primary binaries to be 64-bit for performance, but may need 32-bit binaries for compatibility sake.  So in the MIPS case, you can end up with a valid system that has:

MIPS64 64-bit select binaries/libraries
MIPS64 32-bit primary use on the system
MIPS32 32-bit select binaries/libraries for compatibility with old software</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71508</commentid>
    <comment_count>5</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-03-21 07:41:48 +0000</bug_when>
    <thetext>The code in the transaction.c is currently two state either new file or old file matches the preferred color.  However in the tri-lib system there is a third state that neither the old nor new match the preferred color.  In that case RPM 5 simply installs both files and rpm ignores the conflict itself.

I will try to implement this behavior on rpm4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73614</commentid>
    <comment_count>6</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-06-01 15:50:01 +0000</bug_when>
    <thetext>The code supports dual-arch, but tri-arch is not working.

This issue is open in the rpm.org issue tracker:

https://github.com/rpm-software-management/rpm/issues/193

Unfortunately we do not yet have a solution to the issue, and I am no longer working on it.  I&apos;ve been unable to resolve the problem in a consistent way.

I&apos;ve asked for help from the upstream, but so far they have not been interested in this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74901</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2017-07-10 17:19:39 +0000</bug_when>
    <thetext>No further progress to report on this issue.  I&apos;ve not been able to determine the flow to implement a tri-lib resolution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102351</commentid>
    <comment_count>8</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-06-26 14:58:32 +0000</bug_when>
    <thetext>MIPS support is deprecate and is no longer being tested.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>