Bug 1198806 - can't compile against SDL2 using older gcc
Summary: can't compile against SDL2 using older gcc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: SDL2
Version: rawhide
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: 2015-03-04 20:48 UTC by Ozkan Sezer
Modified: 2015-06-21 00:11 UTC (History)
2 users (show)

Fixed In Version: SDL2-2.0.3-5.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-13 06:38:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
SDL Simple Directmedia Layer 2720 0 None None None Never

Description Ozkan Sezer 2015-03-04 20:48:15 UTC
Description of problem:

There is a leftover erroneous definition of DECLSPEC in
SDL2/begin_code.h, which makes it impossible to compile
against SDL2 using gcc < 4.x, e.g. compat-gcc-34.
The issue is reported to SDL bugzilla:
https://bugzilla.libsdl.org/show_bug.cgi?id=2720
The fix is trivial, removing two offending lines, as in
the following patch:
--- SDL2-2.0.3/include/begin_code.h~
+++ SDL2-2.0.3//include/begin_code.h
@@ -56,8 +56,7 @@
 # else
 #  if defined(__GNUC__) && __GNUC__ >= 4
 #   define DECLSPEC __attribute__ ((visibility("default")))
-#  elif defined(__GNUC__) && __GNUC__ >= 2
-#   define DECLSPEC __declspec(dllexport)
+/* FIXME: some distros have visibility attributes backported to gcc3.4 */
 #  else
 #   define DECLSPEC
 #  endif


Version-Release number of selected component (if applicable):
SDL2-2.0.3, Fedora 20 (any fedora or RHEL which ships SDL2.)


How reproducible:
Always.


Steps to Reproduce:

$ cat test.c
#include "SDL.h"
int main () {
 return 0;
}

$ gcc34 -c test.c `sdl2-config --cflags`
In file included from /usr/include/sys/types.h:29,
                 from /usr/include/SDL2/SDL_stdinc.h:34,
                 from /usr/include/SDL2/SDL_main.h:25,
                 from /usr/include/SDL2/SDL.h:67,
                 from 0.c:1:
/usr/include/bits/types.h: In function `__declspec':
/usr/include/bits/types.h:30: error: storage class specified for parameter `__u_char'
/usr/include/bits/types.h:31: error: storage class specified for parameter `__u_short'
......
[errors go on..]

Comment 1 Fedora End Of Life 2015-05-29 13:43:29 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Ozkan Sezer 2015-05-29 15:12:32 UTC
Changed fedora version from 20 to rawhide: the issue is there with all fedoras with sdl2.  Mainstream has the fix applied already.

Comment 3 Fedora Update System 2015-06-02 19:48:17 UTC
SDL2-2.0.3-5.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/SDL2-2.0.3-5.fc22

Comment 4 Fedora Update System 2015-06-02 19:48:23 UTC
SDL2-2.0.3-5.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/SDL2-2.0.3-5.fc21

Comment 5 Fedora Update System 2015-06-02 19:48:30 UTC
SDL2-2.0.3-5.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/SDL2-2.0.3-5.fc20

Comment 6 Ozkan Sezer 2015-06-03 05:43:50 UTC
(In reply to Fedora Update System from comment #5)
> SDL2-2.0.3-5.fc20 has been submitted as an update for Fedora 20.
> https://admin.fedoraproject.org/updates/SDL2-2.0.3-5.fc20

Tested on f20 (x86_64), works OK.

Comment 7 Fedora Update System 2015-06-05 23:50:04 UTC
Package SDL2-2.0.3-5.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing SDL2-2.0.3-5.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-9470/SDL2-2.0.3-5.fc22
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2015-06-13 06:38:30 UTC
SDL2-2.0.3-5.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2015-06-20 23:57:11 UTC
SDL2-2.0.3-5.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2015-06-21 00:11:04 UTC
SDL2-2.0.3-5.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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