FS#40497 - [wxgtk] [gcc] --disable-visibility required for wxgtk with GCC 4.9

Attached to Project: Arch Linux
Opened by Pierre Bourdon (delroth) - Thursday, 22 May 2014, 21:48 GMT
Last edited by Allan McRae (Allan) - Tuesday, 11 November 2014, 07:28 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Eric Belanger (Snowman)
Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Since GCC was updated to 4.9, some programs that use the wxgtk library cannot be built anymore on ArchLinux. The main example I can give is aur/dolphin-emu-git.

I'm part of the dolphin-emu development team, our current understanding of the issue is that this is a GCC regression, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61214 that we reported. Basically, GCC is not instantiating some inline functions when it should, and since the definitions in the wxgtk .so are hidden by -fvisibility-inlines-hidden, building programs that use wxgtk might fail at the link stage.

Rebuilding wxgtk from ABS with --disable-visibility passed to the ./configure script fixes the issue.

Additional info:
* wxgtk 3.0.0-3

Steps to reproduce:
$ cat >testcase.cpp <<EOF
#include <wx/event.h>

int main()
{
wxEvent* evt = new wxNotifyEvent();
evt->Clone();
return 0;
}
EOF
$ g++ -std=c++11 -O3 $(wx-config --cxxflags --libs) testcase.cpp

This fails with the current extra/wxgtk package, succeeds with my custom version built with --disable-visibility.
This task depends upon

Closed by  Allan McRae (Allan)
Tuesday, 11 November 2014, 07:28 GMT
Reason for closing:  Fixed
Additional comments about closing:  gcc-4.9.2
Comment by Loïc BLOT (Nerzhul) - Tuesday, 26 August 2014, 18:19 GMT
Hi,
to resolve this compilation problem on GCC 4.9 you need to pass -fno-devirtualize to CXX_FLAGS and C_FLAGS. The compilation will proper works (tested myself, i use dolphin github directly.
Comment by Allan McRae (Allan) - Wednesday, 10 September 2014, 00:33 GMT
This is partially fixed in gcc-4.9.1-2. I see a second fix just landed...

Loading...