about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2023-02-23 22:06:10 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-03-17 22:38:16 +0000
commit38b07e7a89f103dc3b690be5382b5a0d9f5aa7fe (patch)
tree4a7fc89d0976bd6af96540626dc4e8203a7f5342
parent03fa34c4e51351b357b84a27c705aac5e0a5e68b (diff)
downloadklee-38b07e7a89f103dc3b690be5382b5a0d9f5aa7fe.tar.gz
Fix building of runtime library and klee-replay
Former build system provided additional flags for building bitcode while
they were not required, e.g. under BSD or MacOS.
-rw-r--r--runtime/POSIX/fd.h7
-rw-r--r--tools/klee-replay/file-creator.c3
-rw-r--r--tools/klee-replay/klee-replay.h2
-rw-r--r--tools/klee-replay/klee_init_env.c1
4 files changed, 10 insertions, 3 deletions
diff --git a/runtime/POSIX/fd.h b/runtime/POSIX/fd.h
index 39307ceb..5fa42874 100644
--- a/runtime/POSIX/fd.h
+++ b/runtime/POSIX/fd.h
@@ -16,6 +16,13 @@
 #error "_LARGEFILE64_SOURCE should be defined"
 #endif
 
+#if defined(__APPLE__) || defined(__FreeBSD__)
+#else
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#endif
+
 #include <dirent.h>
 #include <sys/types.h>
 
diff --git a/tools/klee-replay/file-creator.c b/tools/klee-replay/file-creator.c
index e103a39f..a1685a02 100644
--- a/tools/klee-replay/file-creator.c
+++ b/tools/klee-replay/file-creator.c
@@ -290,7 +290,7 @@ static int create_pipe(const char *fname, exe_disk_file_t *dfile,
   }
 }
 
-
+int futimes(int fd, const struct timeval tv[2]);
 static int create_reg_file(const char *fname, exe_disk_file_t *dfile,
                            const char *tmpdir) {
   struct stat64 *s = dfile->stat;
@@ -395,6 +395,7 @@ static void create_file(int target_fd,
 
 char replay_dir[] = "/tmp/klee-replay-XXXXXX";
 
+char *mkdtemp(char *template);
 void replay_create_files(exe_file_system_t *exe_fs) {
   unsigned k;
 
diff --git a/tools/klee-replay/klee-replay.h b/tools/klee-replay/klee-replay.h
index 5701caa5..47d63a47 100644
--- a/tools/klee-replay/klee-replay.h
+++ b/tools/klee-replay/klee-replay.h
@@ -9,11 +9,9 @@
 
 #ifndef KLEE_REPLAY_H
 #define KLEE_REPLAY_H
-
 #define _LARGEFILE64_SOURCE
 #define _FILE_OFFSET_BITS 64
 
-#include "klee/Config/config.h"
 // FIXME: This is a hack.
 #include "../../runtime/POSIX/fd.h"
 #include <sys/time.h>
diff --git a/tools/klee-replay/klee_init_env.c b/tools/klee-replay/klee_init_env.c
index b0b6e912..c697975e 100644
--- a/tools/klee-replay/klee_init_env.c
+++ b/tools/klee-replay/klee_init_env.c
@@ -1,3 +1,4 @@
+#define _LARGEFILE64_SOURCE
 #include "../../runtime/POSIX/klee_init_env.c"
 
 int __klee_posix_wrapped_main(int argc, char **argv, char **envp) { return 0; }