[Cmake-commits] [cmake-commits] king committed Linux-GNU.cmake 1.1 1.2 Linux-Intel.cmake 1.3 1.4

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jan 13 08:13:51 EST 2010


Update of /cvsroot/CMake/CMake/Modules/Platform
In directory public:/mounts/ram/cvs-serv11705/Modules/Platform

Modified Files:
	Linux-GNU.cmake Linux-Intel.cmake 
Log Message:
Restore -rdynamic in Linux build rules

The commit "Drop -rdynamic from Linux build rules" removed default use
of the flag on Linux.  It was expected to be compatible because any
project using plugins should set ENABLE_EXPORTS on its executables to
export their symbols for use by the plugins in a cross-platform way.
However, it is possible to build without ENABLE_EXPORTS and load plugins
that do not link to any symbols from the executable explicitly.  These
plugins may need to see RTTI and other executable symbols needed by the
language implementation.  Executables using such plugins were broken by
the change.

If we want to remove the -rdynamic flag in the future we should do so in
a compatible way.  At that time we should also remove equivalent flags
on other platforms (like -bexpall on AIX).  We will either need a policy
or an explicit API to disable symbol exports on executables.

The primary purpose of the above-mentioned commit was to avoid passing
the -rdynamic flag to compilers on Linux that do not support it.  In
this commit we restore the flag but only on GNU and Intel compilers
which are known to support it.

See issue #9985.


Index: Linux-Intel.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Linux-Intel.cmake,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** Linux-Intel.cmake	4 Dec 2009 14:20:24 -0000	1.3
--- Linux-Intel.cmake	13 Jan 2010 13:13:46 -0000	1.4
***************
*** 35,38 ****
--- 35,42 ----
    set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
  
+   # We pass this for historical reasons.  Projects may have
+   # executables that use dlopen but do not set ENABLE_EXPORTS.
+   set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
+ 
    if(XIAR)
      # INTERPROCEDURAL_OPTIMIZATION

Index: Linux-GNU.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/Linux-GNU.cmake,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** Linux-GNU.cmake	13 Jan 2010 13:13:19 -0000	1.1
--- Linux-GNU.cmake	13 Jan 2010 13:13:46 -0000	1.2
***************
*** 20,22 ****
--- 20,25 ----
  
  macro(__linux_compiler_gnu lang)
+   # We pass this for historical reasons.  Projects may have
+   # executables that use dlopen but do not set ENABLE_EXPORTS.
+   set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
  endmacro()



More information about the Cmake-commits mailing list