diff CMakeLists.txt @ 1142:148014db2f3b static-libc

(issue126) Commit WIP on static linking libc
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 18 Sep 2014 10:29:38 +0200
parents 6950f08342bb
children
line wrap: on
line diff
--- a/CMakeLists.txt	Wed Sep 17 16:23:33 2014 +0200
+++ b/CMakeLists.txt	Thu Sep 18 10:29:38 2014 +0200
@@ -86,7 +86,7 @@
 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security")
 
 # Hardening flags
-set(HARDENING_FLAGS " -Wall -fstack-protector-all -fno-exceptions")
+set(HARDENING_FLAGS " -fPIC -Wall -fstack-protector-all -fno-exceptions")
 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector")
 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4")
 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0")
@@ -103,8 +103,9 @@
 endif(WIN32)
 
 if(UNIX)
-   set(HARDENING_FLAGS " ${HARDENING_FLAGS} -pie -fPIE -ftrapv")
+   set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Bdynamic -ftrapv")
    set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,-z,relro,-z,now")
+   set(EXTRA_STATIC_FLAGS " -Wl,--undefined=__pthread_unwind -static -static-libstdc++ -static-libgcc")
 elseif(WIN32)
    set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat")
 endif()

http://wald.intevation.org/projects/trustbridge/