[Bug c++/43601] Enormous increase in DLL object files size in 4.5
--- Comment #16 from a14331990 at hotmail dot com 2010-05-15 06:01 --- (In reply to comment #8) > I think this is a bug the MingW maintainers should handle. > > While I understand Andrew's position, it seems to me that this is nevertheless > a definite regression from the user's perspective. > > W. > Yes, I think this is mostly a mingw bug, but I think developers of cygwin, a very similar project had already resolved this issue, they had enabled auto-import by default in ld, please follow this post [PATCH] Silence ld auto-import warnings for pe-i386. http://sourceware.org/ml/binutils/2009-02/msg00341.html for details. With auto-import enabled by default in ld, there is no need to emit exported inline functions in gcc code. See my workaround here: FYI: GCC 4.5.0 on Mingw.org http://forums.codeblocks.org/index.php/topic,12183.msg85066.html#msg85066 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601
[Bug c++/43601] Enormous increase in DLL object files size in 4.5
--- Comment #17 from a14331990 at hotmail dot com 2010-05-15 09:29 --- Created an attachment (id=20662) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20662&action=view) enable auto-import in ld This patch comes from a post by Dave Korn and is slightly modified by me [PATCH] Silence ld auto-import warnings for pe-i386. http://sourceware.org/ml/binutils/2009-02/msg00341.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601
[Bug c++/43601] Enormous increase in DLL object files size in 4.5
--- Comment #18 from a14331990 at hotmail dot com 2010-05-15 09:31 --- Created an attachment (id=20663) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20663&action=view) don't emit dllexport'd inline functions This patch is just a removal of nathan's code. See r147799 | nathan | 2009-05-22 22:57:15 +0800 (Fri, 22 May 2009) | 16 lines in gcc svn log -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601
[Bug c++/43601] Enormous increase in DLL object files size in 4.5
--- Comment #20 from a14331990 at hotmail dot com 2010-05-15 13:24 --- (In reply to comment #19) > Should not the options -fvisibility-inlines-hidden or -fvisibility=hidden fix > this problem? Option found on http://gcc.gnu.org/wiki/Visibility. > Note: The MinGW GCC 4.5.0-1 does not make smaller DLLs using above options. > > > > I don't think these option can undo the change by nathan at 2009-05-22 r147799 | nathan | 2009-05-22 22:57:15 +0800 (Fri, 22 May 2009) | 16 lines gcc/ * tree.c (handle_dll_attribute): Mark dllexport'd inlines as non-external. gcc/cp * decl2.c (decl_needed_p): Consider dllexport'd functions needed. * semantics.c (expand_or_defer_fn): Similarly. gcc/testsuite/ * gcc.dg/dll-6.c: New test. * gcc.dg/dll-6a.c: Likewise. * gcc.dg/dll-7.c: Likewise. * gcc.dg/dll-7a.c: Likewise. * g++.dg/ext/dllexport2.C: Likewise. * g++.dg/ext/dllexport2a.cc: Likewise. BTW, say SORRY to nathan, your change is indeed useful for building libstdc++ dll, but I have found an alternative approach. Indeed, the explanation page http://gcc.gnu.org/wiki/Visibility says "How to use the new C++ visibility support In your header files, wherever you want an interface or API made public outside the current DSO, place __attribute__((visibility("default"))) in struct, class and function declarations you wish to make public (it's easier if you define a macro as this). You don't need to specify it in the definition. Then, alter your make system to pass -fvisibility=hidden to each call of GCC compiling a source file.", this means to use these options, you should alter your header files first, but wxwidgets source code apparently don't contain anything like "__attribute__((visibility("default")))". Correct me if I'm wrong. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601