Bug 1305953

Summary: Fix build on MIPS
Product: [Fedora] Fedora Reporter: Michal Toman <michal.toman>
Component: m2cryptoAssignee: Miloslav Trmač <mitr>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: gholms, michal.toman, mitr
Target Milestone: ---   
Target Release: ---   
Hardware: mips64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 13:32:56 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:
Bug Depends On:    
Bug Blocks: 1242747    
Attachments:
Description Flags
Fix-build-on-MIPS.patch none

Description Michal Toman 2016-02-09 16:34:19 UTC
Created attachment 1122449 [details]
Fix-build-on-MIPS.patch

Description of problem:
We are trying to bring Fedora to MIPS platform and this requires 2 changes in m2crypto specfile:
1) skip __REGISTER_PREFIX__ macro, it expands to dollar sign '$' and confuses gcc
2) add MIPS to multilib_arches

Actual results:
Build fails, gcc fails parsing at a dollar sign. Also MIPS is not included in multilib_arches.

Expected results:
Build passes, MIPS is included in multilib_arches

Additional info:
Attaching dist-git patch

Comment 1 Miloslav Trmač 2016-02-09 17:38:11 UTC
Thanks for your report.

How does gcc fail with '$' exactly? Doing just a simple test
> $ cat > t.c
> #define foo $
> int main(void) { return 0; } 
> $ gcc t.c $(rpm --eval '%optflags')
seems to work fine, with x86_64 gcc-5.3.1-2.fc22.x86_64 at least. Same with the long flags which are actually used during m2crypto compilation.


I do see swig failing, though:
> swig -python … SWIG/_m2crypto.i
> /usr/include/openssl/opensslconf-x86_64.h:5: Warning 205: CPP #error ""Don't include this file directly, use <openssl/opensslconf.h> instead!"".
> SWIG/gcc_macros.h:496: Error: Illegal token '$'.
> SWIG/gcc_macros.h:496: Warning 305: Bad constant value (ignored).
Is that what you are running into?

Comment 2 Michal Toman 2016-02-09 17:57:26 UTC
(In reply to Miloslav Trmač from comment #1)
> I do see swig failing, though:
> > swig -python … SWIG/_m2crypto.i
> > /usr/include/openssl/opensslconf-x86_64.h:5: Warning 205: CPP #error ""Don't include this file directly, use <openssl/opensslconf.h> instead!"".
> > SWIG/gcc_macros.h:496: Error: Illegal token '$'.
> > SWIG/gcc_macros.h:496: Warning 305: Bad constant value (ignored).
> Is that what you are running into?

You are right, my bad. Where I wrote gcc I meant swig.

Comment 3 Miloslav Trmač 2016-02-09 19:24:44 UTC
Thanks for the confirmation,

I have just built m2crypto-0.23.0-1.fc24, which includes your __REGISTER_PREFIX__ change and should make the multilib_arches part unnecessary. Can you verify that it works for you, please?

Comment 4 Michal Toman 2016-02-09 19:48:11 UTC
It works fine, thanks.

Comment 5 Miloslav Trmač 2016-02-10 13:32:56 UTC
Thanks for the confirmation.