Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1366735

Summary: Add support for MIPS
Product: [Fedora] Fedora Reporter: Michal Toman <michal.toman>
Component: redhat-rpm-configAssignee: Florian Festi <ffesti>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: ffesti, jakub, jonathan, pmatilai, praiskup
Target Milestone: ---   
Target Release: ---   
Hardware: mips64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-15 09:41:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1242747    
Attachments:
Description Flags
Add-support-for-MIPS.patch none

Description Michal Toman 2016-08-12 16:18:40 UTC
Created attachment 1190501 [details]
Add-support-for-MIPS.patch

Description of problem:
We are trying to bring Fedora to MIPS platform and this requires adding MIPS build flags to redhat rpmrc. We also need to disable hardened ld on 32-bit MIPS.

Actual results:
Build fails because valgrind is required.

Expected results:
Build passes.

Additional info:
After a chat with GCC/binutils developer at Imagination Technologies, I have learned that -pie has been broken on 32-bit MIPS for several years and is unlikely to get fixed. It enables optimizations that are always unavailable without -fPIC:

$ cat test.c 
#include <stdio.h>

int main()
{
  FILE *f = fopen("/dev/null", "w");
  if (f) fclose(f);
  return 0;
}
$ gcc test.c -pie
/usr/bin/ld: /tmp/ccOsCFfR.o: relocation R_MIPS_HI16 against `__gnu_local_gp' can not be used when making a shared object; recompile with -fPIC
/tmp/ccOsCFfR.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

An explicit -fPIC fixes the problem but adding it to build flags breaks some static libraries. Disabling -pie is the most suitable solution I was able to find.


Attaching dist-git patch. It would be nice to have this in F25 as well.

Comment 1 Panu Matilainen 2016-11-08 13:41:32 UTC
No problem adding the rpmrc changes, but piling arch specific exceptions into the default gcc specs which next to nobody knows about much less properly understands to begin with makes me feel a bit uneasy.

My initial feeling would be to leave the defaults alone and arrange (one way or the other) for a possibility of arch-specific override spec file(s) instead. 

Jakub (cc'd), thoughts/comments/guidancefrom gcc perspective would be welcome.

Comment 2 Panu Matilainen 2016-11-08 14:44:56 UTC
FWIW, the rpmrc part added as of redhat-rpm-config-55-1.fc26

Comment 3 Fedora End Of Life 2017-02-28 10:06:22 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.