There are still some symbol visibility problems with 4.0.2-r1. Libusb and subversion fails with link errors when using -fvisibility-inlines-hidden in the CXXFLAGS while it works with gcc 3.4. These problems can be fixed with patches from the gcc bugzilla. These are the patches i propose for inclusion in the patchset: The other patch from pr 19664: Don't change visibility if set by user: http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00180.html It's already included in the gcc 3.4 patchset so I think it would be a good idea to add it to 4.0 too. pr 20297: #pragma GCC visibility isn't properly handled for builtin functions: http://gcc.gnu.org/bugzilla/attachment.cgi?id=9035&action=view This one is needed to build firefox 1.5 with visibility support.
Apparently the patch for 20297 doesn't completely solve the problem. Firefox still fails to build on amd64. Check my comment in that bug for more info.
Ignore the patch for #20297, it doesn't work.
Once the patches are accepted upstream, I'll add them. Last time I took some of these visibility fixes, they introduced ICEs, so I'd rather avoid that just to fix -fvisibility.
This patch is already accepted upstream for 4.1 and it's included in the 3.4 patchset (23_all_gcc34-visibility4.patch). Here is the commit: Subject: Bug 19664 CVSROOT: /cvs/gcc Module name: gcc Changes by: hjl@gcc.gnu.org 2005-05-17 21:47:13 Modified files: gcc/cp : ChangeLog decl2.c Log message: 2005-05-17 H.J. Lu <hongjiu.lu@intel.com> PR C++/19664 * decl2.c (determine_visibility): Don't set visibility to hidden if it has been set explicitly by user. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4745&r2=1.4746 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.781&r2=1.782
That patch will be included in the next patch tarball. Thanks.