Skip to content

Commit

Permalink
hardening
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdelisle committed Feb 11, 2012
1 parent 37b27ee commit 02de592
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
9 changes: 3 additions & 6 deletions CMakeLists.txt
Expand Up @@ -21,9 +21,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}

# validation
add_definitions(-Wall -Wextra -std=c99 -Werror -pedantic)

# hardening
add_definitions(
-pie
-fPIE

# Broken GCC patch makes -fstack-protector-all not work
Expand All @@ -33,13 +33,10 @@ add_definitions(
-fstack-protector-all

-Wstack-protector
-D_FORTIFY_SOURCE=2
-Wa,--noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,-z,noexecstack
)

set(CMAKE_EXE_LINKER_FLAGS "-pie -z relro -z now")

# debugging
add_definitions(-g)

Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/FindNACL.cmake
Expand Up @@ -19,7 +19,7 @@ if (NOT NACL_INCLUDE_DIRS)

ExternalProject_Add(NACL
GIT_REPOSITORY git://github.com/cjdelisle/nacl.git
GIT_TAG 96761dcce8227ec130b6db395fcaae2c3d3eb166
GIT_TAG 4e44b37b89aa69356d713d27b4273e01b56d739c
SOURCE_DIR "${CMAKE_BINARY_DIR}/nacl"
BINARY_DIR "${CMAKE_BINARY_DIR}/nacl"
INSTALL_COMMAND ""
Expand Down
4 changes: 2 additions & 2 deletions util/test/CMakeLists.txt
Expand Up @@ -17,7 +17,7 @@ message("-- Tests to run for " ${this_dir})
add_definitions(-g)

# Anything in this dir which ends with "test.c" is considered a test.
file(GLOB tests "*test.c")
file(GLOB tests "*_test.c")
foreach(test_source_fullpath ${tests})
string(REGEX REPLACE "^.*/" "" test_source ${test_source_fullpath})
string(REPLACE "test.c" "test" test_bin ${test_source})
Expand All @@ -36,6 +36,6 @@ foreach(test_source_fullpath ${tests})
string(REPLACE "benchmark.c" "benchmark" test_bin ${test_source})
message(" " ${test_source})
add_executable(${test_bin} ${test_source})
target_link_libraries(${test_bin} cjdmemory util crypto)
target_link_libraries(${test_bin} ${LIBEVENT2_LIBRARIES})
add_test(${test_bin} ${test_bin})
endforeach()
1 change: 0 additions & 1 deletion util/test/Endian_test.c
Expand Up @@ -11,7 +11,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "crypto/Crypto.h"
#include "util/Endian.h"

#include <stdio.h>
Expand Down

0 comments on commit 02de592

Please sign in to comment.