File: add-linker-flags.patch

package info (click to toggle)
libkolab 1.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,540 kB
  • ctags: 1,308
  • sloc: cpp: 11,600; php: 273; sh: 78; makefile: 35; xml: 20; ansic: 15
file content (19 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Add relro linker flag to SWIG
 * Lintian throws a hardening-no-relro warning, somehow
   the standard dpkg linker flags are not passed to
   the cmake build.
 * Also add as-needed flag because of dpkg-shlibdeps warnings.
Author: Paul Klos <kolab@klos2day.nl>
Last-Update: 2013-04-11

--- a/cmake/modules/SWIGUtils.cmake
+++ b/cmake/modules/SWIGUtils.cmake
@@ -16,7 +16,7 @@
 
     #Compile PHP Bindings
     # Since there is no php library we can't compile with -Wl,--no-undefined
-    set(CMAKE_SHARED_LINKER_FLAGS "")
+    set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-z,relro,--as-needed")
 
     if (APPLE)
         set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" )