Bug 1551338 - SDL.h includes altivec.h, breaks c++ code
Summary: SDL.h includes altivec.h, breaks c++ code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: SDL2
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Igor Gnatenko
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-04 20:17 UTC by Miro Hrončok
Modified: 2018-07-29 16:13 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-29 16:13:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
ppc64le build.log for vcmi (176.80 KB, text/plain)
2018-03-04 20:17 UTC, Miro Hrončok
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Debian BTS 770670 0 None None None 2018-03-04 20:17:57 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.