about summary refs log tree commit diff homepage
path: root/runtime/Fortify/CMakeLists.txt
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2020-11-06 16:23:31 +0000
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2020-11-09 19:39:13 +0000
commit0d705e4aef74f22e80ad84112c9e85268b1d2f7d (patch)
tree53a476c3aedcae8546ce69d1e9a61c51d2caacba /runtime/Fortify/CMakeLists.txt
parent4547882135af886e002d134d6bb5b510f7c73a06 (diff)
downloadklee-0d705e4aef74f22e80ad84112c9e85268b1d2f7d.tar.gz
Added fortified library (for -D_FORTIFY_SOURCE), to be linked when uclibc is used.
Diffstat (limited to 'runtime/Fortify/CMakeLists.txt')
-rw-r--r--runtime/Fortify/CMakeLists.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/runtime/Fortify/CMakeLists.txt b/runtime/Fortify/CMakeLists.txt
new file mode 100644
index 00000000..8e751f66
--- /dev/null
+++ b/runtime/Fortify/CMakeLists.txt
@@ -0,0 +1,28 @@
+#===------------------------------------------------------------------------===#
+#
+#                     The KLEE Symbolic Virtual Machine
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+#===------------------------------------------------------------------------===#
+
+set(LIB_PREFIX "RuntimeFortify")
+set(SRC_FILES
+        fortify.c
+        ../Freestanding/fortify-fs.c
+        ../klee-libc/fortify-klibc.c
+        )
+
+# Add __NO_INLINE__ to prevent glibc from using inline definitions of some
+# builtins (i.e. putchar and atoi).
+set(ADDITIONAL_CC_FLAGS
+        -D__NO_INLINE__
+        -std=gnu89
+        )
+
+# Build it
+include("${CMAKE_SOURCE_DIR}/cmake/compile_bitcode_library.cmake")
+prefix_with_path("${SRC_FILES}" "${CMAKE_CURRENT_SOURCE_DIR}/" prefixed_files)
+
+add_bitcode_library_targets("${LIB_PREFIX}" "${prefixed_files}" "${ADDITIONAL_CC_FLAGS}" "")