[ Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File ]
|Status:||5 - New|
|Priority:||1 - Request for Enhancement, e.g. asking for a feature|
|Scope:||3 - Applies to all machines and operating systems|
|Summary:||FLTK is not taking advantage of compiler flags|
Trouble Report Files:
[ Post File ]
Trouble Report Comments:
[ Post Text ]
||FLTK is currently not taking proper advantage of compiler flags, and as such, the resulting DSO is bloated with unneeded symbolic information. |
makeinclude should be changed to use -fvisibility=hidden and -fvisibility-inlines-hidden.
CXXFLAGS = $(OPTIM) -I/usr/include/freetype2 -O2 -Wall -Wunused -fPIC -I/usr/include/freetype2 -Wno-non-virtual-dtor -Wno-non-virtual
-dtor -fvisibility-inlines-hidden # -fvisibility=hidden
-fvisibility-inlines-hidden can be used without modifying the source code.
-fvisibility=hidden cannot and requires that each function and class in fltk's source is properly exposed for export (like Windows' use of FL_API's macro of __declspec(dllexport) ).
This allows the .so to only expose the symbols for those functions that are to be public to the interface, while keeping all private symbols hidden. This also may have some slight benefit on performance.
For more information, refer to:
[ Return to Bugs & Features | Post Text | Post File ]