Bug 1294882

Summary: Add support for MIPS architecture
Product: [Fedora] Fedora Reporter: Michal Toman <michal.toman>
Component: opensslAssignee: Tomas Mraz <tmraz>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: mips64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-28 16:12:39 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
openssl-mipsel.log
none
openssl-mips64el.log none

Description Michal Toman 2015-12-30 19:45:11 UTC
Created attachment 1110600 [details]
Add-support-for-MIPS.patch

Description of problem:
We are trying to bring Fedora to MIPS platform and this requires adding support for MIPS to openssl specfile and opensslconf-new.h

Actual results:
No MIPS support in openssl package

Expected results:
openssl package builds and works on MIPS

Additional info:
Attaching a dist-git patch.

Comment 1 Tomas Mraz 2015-12-30 20:19:32 UTC
Comment on attachment 1110600 [details]
Add-support-for-MIPS.patch

Note that enable-ec_nistp_64_gcc_128 does not work properly on big endian architectures. I do not know whether mips is big or little endian though.

Also what you're trying to achieve with the -mips32/64r2 option? Shouldn't that be rather handled via the RPM_OPT_FLAGS?

Comment 2 Michal Toman 2015-12-31 08:48:02 UTC
(In reply to Tomas Mraz from comment #1)
> Note that enable-ec_nistp_64_gcc_128 does not work properly on big endian
> architectures. I do not know whether mips is big or little endian though.

MIPS can do both, we are using mips/mips64 for BE and mipsel/mips64el for LE. You are right though, there is a missing ifarch.

> Also what you're trying to achieve with the -mips32/64r2 option? Shouldn't
> that be rather handled via the RPM_OPT_FLAGS?

This is somewhat strange to me as well. RPM_OPT_FLAGS has -march=mips32r2 / -march=mips64r2 but openssl does not pick that up and adds its default (-mips2 / -mips3) to the command line. This results into a conflict. Specifying -mips32r2 / -mips64r2 explicitly fixes the problem or well... it is a workaround. We should probably make the toolchain recognize -march=*. Attaching logs.

Comment 3 Michal Toman 2015-12-31 08:48:33 UTC
Created attachment 1110718 [details]
openssl-mipsel.log

Comment 4 Michal Toman 2015-12-31 08:49:00 UTC
Created attachment 1110719 [details]
openssl-mips64el.log