Bug 1551338

Summary: SDL.h includes altivec.h, breaks c++ code
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: SDL2Assignee: Igor Gnatenko <ignatenko>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: dchen, ignatenko, igor.raits, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-29 16:13:16 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:
Attachments:
Description Flags
ppc64le build.log for vcmi none

Description Miro Hrončok 2018-03-04 20:17:58 UTC
Created attachment 1403990 [details]
ppc64le build.log for vcmi

I'm trying to build https://vcmi.eu/ in rpmfusion.

http://koji.rpmfusion.org/koji/taskinfo?taskID=205588

On ppc64le, the build fails with:


/builddir/build/BUILD/vcmi-0.99/client/mapHandler.h:85:7: error: expected unqualified-id before '__attribute__'
  std::vector<TerrainTileObject> objects; //pointers to objects being on this tile with rects to be easier to blit this tile on screen
       ^

Apparently, they had the very same problem in Debian in 2014, a simpler reproducer is available there as well:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770670

> The problem lies within SDL_cpuinfo.h.  It includes altivec.h, which by
> definition[1] provides an unconditional vector, pixel and bool define in
> standard-c++ mode.  In GNU-c++ mode this names are only defined
> context-sensitive by cpp.  SDL_cpuinfo.h is included by SDL.h.
> 
> None of the SDL headers actually use vector or any of the vec_*
> functions, so this include looks unused.


The fix shall be to pass --disable-altivec to configure on ppc64le.


Heres a PR for master, yet I need this in Fedora 27 as well. Not usre if you plan to update to 2.0.8 there or if I need to backport this.

https://src.fedoraproject.org/rpms/SDL2/pull-request/1

Comment 1 Igor Gnatenko 2018-03-04 22:12:39 UTC
Yeah, I want to update to 2.0.8. I will perform update and apply your patch tomorrow. Thanks!

Comment 2 Miro Hrončok 2018-03-21 12:34:37 UTC
This has been fixed on f29 and 28. Still waiting for the backport. Thanks.

Comment 3 Miro Hrončok 2018-03-28 09:06:33 UTC
May I update it on F27 to 2.0.8 or shall I backport the fix?

Comment 4 Igor Raits 2018-07-29 16:13:16 UTC
(In reply to Miro Hrončok from comment #3)
> May I update it on F27 to 2.0.8 or shall I backport the fix?

F27 is dead. But if you insist, feel free to backport or update.