Opened 12 years ago

Closed 12 years ago

#8882 closed bug (fixed)

add gcc version check to gl.h to avoid warnings

Reported by: jstressman Owned by: kallisti5
Priority: normal Milestone: R1/beta1
Component: Kits/OpenGL Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Currently (hrev44524) when building things like SDL, we get thousands of warning messages about "warning: `visibility' attribute directive ignored"

A version check to not use this attribute unless we have a higher GCC version avoids this.

The attached patch fixes the problem for me, but I'd like for someone more knowledgeable to have a look. :)

Attachments (1)

gl.h.diff (668 bytes ) - added by jstressman 12 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by jstressman, 12 years ago

patch: 01

comment:2 by pulkomandy, 12 years ago

The patch looks fine (did you check the actual verson when the attribute was introduced in gcc ?)

Since this is an OpenGL header, it now lives in an optional package however. We may either want to patch it in our port or upstream the change to Mesa (if it's not already done there).

comment:3 by jstressman, 12 years ago

I've also added a check for ELF since I believe it only makes sense in that context.

I can't seem to find a clear note on exactly when the visibility attribute was added, but I see a number of discussions stating it as >= GCC 3.3 (I accidentally made it >= 3.2 instead of just > 3.2)

There is a discussion about it on the zlib mailing list for instance: http://mail.madler.net/pipermail/zlib-devel_madler.net/2012-February/002773.html

Updated the patch with these 2 changes.

by jstressman, 12 years ago

Attachment: gl.h.diff added

comment:4 by jstressman, 12 years ago

If it matters, Mesa 7.11.2 already has a check added.

#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))

and our line is currently as follows:

#elif defined(__GNUC__)	|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))

So you could say it's already been upstreamed. I guess I just took a more complicated/specific route?

comment:5 by korli, 12 years ago

Owner: changed from korli to kallisti5
Status: newassigned

comment:6 by kallisti5, 12 years ago

I commited an adjusted mesa 7.8.2 diff and a new bep to the ports site (hrev2276)... i still need to test it though before considering this resolved.

comment:7 by kallisti5, 12 years ago

should be solved in hrev45296.. but i need to start removing the "--f-no-warnings" stuff to have final verification.

comment:8 by kallisti5, 12 years ago

Milestone: R1R1/beta1
Resolution: fixed
Status: assignedclosed

resolved in hrev45297

Note: See TracTickets for help on using tickets.