cmake/debian/patches/executables-dont-need-fpic.diff
Modestas Vainius b152287dce Update patches.
- FindQt4.cmake2.6.diff - remove, no longer needed as original bug has been
  fixed since 2.6;
- FindQt3.cmake.diff - refresh, add DEP-3 headers;
- findmpeg2-addpath.diff - remove, bug fixed upstream (in other way);
- kfreebsd-Platform.diff - refresh, add DEP-3 headers;
- executables-dont-need-fpic.diff - refresh, app DEP-3 headers;
- manpage_friendly_docs.diff - remove, merged upstream;
- FindPerlLibs.cmake-perl-5.10.diff - remove, fixed upstream differently;
- FindJNI.cmake-more-arches.diff - remove, was taken from upstream;
- FindVTK.cmake-vtk-5.4.diff - remove, was taken from upstream.
2009-10-04 14:38:08 +03:00

30 lines
1.2 KiB
Diff

From: Ben Hutchings <ben@decadent.org.uk>
Subject: Do not use -fPIC when linking executables
cmake includes ${CMAKE_SHARED_LIBRARY_C_FLAGS} in the command line to
link an executable, and by default this is -fPIC. Either the use or
the definition of this variable is wrong, because executables should
not be linked with this option by default.
.
It's not entirely obvious how this variable gets into the command
line, but you can verify that it does by changing its value to e.g. -D
SHARED and running make VERBOSE=1.
.
Any special options needed for linking with shared libraries can be put
in CMAKE_SHARED_LIBRARY_LINK_C_FLAGS.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=478404
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -199,11 +199,6 @@
std::string flags;
std::string linkFlags;
- // Add flags to deal with shared libraries. Any library being
- // linked in might be shared, so always use shared flags for an
- // executable.
- this->LocalGenerator->AddSharedFlags(linkFlags, linkLanguage, true);
-
// Add flags to create an executable.
this->LocalGenerator->
AddConfigVariableFlags(linkFlags, "CMAKE_EXE_LINKER_FLAGS",