Horde3D
http://horde3d.org/forums/

GCC symbol visibility
http://horde3d.org/forums/viewtopic.php?f=8&t=1106
Page 1 of 1

Author:  marciano [ 21.02.2010, 22:34 ]
Post subject:  GCC symbol visibility

This is a question for our Linux guys ;)

We use the following code to export solely the public API functions (the some ones as for Win32):
Code:
#if defined( __GNUC__ ) && __GNUC__ >= 4
#   define DLLEXP extern "C" __attribute__ ((visibility("default")))
#else

However, from what I can see, the visibility of all other symbols is not hidden. Should we add the following to the Horde3D and Horde3DUtils CMake files or do I miss something?
Code:
# Hide all symbols except the ones which are explicitly marked as visible
if(CMAKE_COMPILER_IS_GNUCXX)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif(CMAKE_COMPILER_IS_GNUCXX)

Note: the GCC version is not checked

Author:  swiftcoder [ 21.02.2010, 22:49 ]
Post subject:  Re: GCC symbol visibility

Ja, that looks about right - current versions of GCC default to all symbols visible for backwards compatibility reasons.

Might want to add a version check though, so that older versions of GCC won't complain.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/