diff --git a/0001-Use-a-subdirectory-for-temporary-files.patch b/0001-Use-a-subdirectory-for-temporary-files.patch deleted file mode 100644 index f8fc235..0000000 --- a/0001-Use-a-subdirectory-for-temporary-files.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 048ecb97881ad2763c34458eb705fedf09dcc5ff Mon Sep 17 00:00:00 2001 -From: Fabian Deutsch -Date: Tue, 4 Oct 2011 13:28:38 +0200 -Subject: [PATCH 1/2] Use a subdirectory for temporary files. - -This allows the a better integration with selinux, as the rule can use the path name and doesn't need globbing. - -Signed-off-by: Fabian Deutsch ---- - orc/orccodemem.c | 19 ++++++++++++++++++- - 1 files changed, 18 insertions(+), 1 deletions(-) - -diff --git a/orc/orccodemem.c b/orc/orccodemem.c -index f470be5..295a880 100644 ---- a/orc/orccodemem.c -+++ b/orc/orccodemem.c -@@ -193,11 +193,27 @@ orc_code_chunk_free (OrcCodeChunk *chunk) - #ifdef HAVE_CODEMEM_MMAP - int - orc_code_region_allocate_codemem_dual_map (OrcCodeRegion *region, -- const char *dir, int force_unlink) -+ const char *basedir, int force_unlink) - { - int fd; - int n; - char *filename; -+ char *dir; -+ struct stat stat_p; -+ -+ dir = malloc (strlen (basedir) + strlen ("/.orc") + 1); -+ sprintf (dir, "%s/.orc", basedir); -+ -+ if (stat (dir, &stat_p) == -1 || -+ !S_ISDIR (stat_p.st_mode)) -+ { -+ n = mkdir (dir, S_IRWXU); -+ if (n < 0) -+ { -+ ORC_WARNING ("failed to create subdir"); -+ return FALSE; -+ } -+ } - - filename = malloc (strlen ("/orcexec..") + - strlen (dir) + 6 + 1); -@@ -211,6 +227,7 @@ orc_code_region_allocate_codemem_dual_map (OrcCodeRegion *region, - if (force_unlink || !_orc_compiler_flag_debug) { - unlink (filename); - } -+ free (dir); - free (filename); - - n = ftruncate (fd, SIZE); --- -1.7.7.6 - diff --git a/0002-Add-compiler-option-for-ENABLE_USER_CODEMEM.patch b/0002-Add-compiler-option-for-ENABLE_USER_CODEMEM.patch deleted file mode 100644 index c6b1487..0000000 --- a/0002-Add-compiler-option-for-ENABLE_USER_CODEMEM.patch +++ /dev/null @@ -1,65 +0,0 @@ -From bded311d32daa2339055341a7f1c1782ff39d047 Mon Sep 17 00:00:00 2001 -From: Fabian Deutsch -Date: Sun, 1 Jan 2012 21:41:04 +0100 -Subject: [PATCH 2/2] Add compiler option for ENABLE_USER_CODEMEM. - -This option disbales non-user-dependent path checking at compile time. If enabled, only paths corresponding to a user are checked. - -Signed-off-by: Fabian Deutsch ---- - configure.ac | 4 ++++ - orc/Makefile.am | 3 +++ - orc/orccodemem.c | 2 ++ - 3 files changed, 9 insertions(+), 0 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 00e1916..4daee88 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -176,6 +176,10 @@ AM_CONDITIONAL(ENABLE_BACKEND_ARM, test "x$ENABLE_BACKEND_ARM" = "xyes") - AM_CONDITIONAL(ENABLE_BACKEND_C64X, test "x$ENABLE_BACKEND_C64X" = "xyes") - AM_CONDITIONAL(ENABLE_BACKEND_MIPS, test "x$ENABLE_BACKEND_MIPS" = "xyes") - -+AC_ARG_ENABLE(user-codemem, -+ AC_HELP_STRING([--enable-user-codemem],[Force codemem allocation to be user dependent (default is no)]), -+ [], [enable_user_codemem=no]) -+AM_CONDITIONAL(ENABLE_USER_CODEMEM, test "x$enable_user_codemem" = "xyes") - - AC_DEFINE(ORC_EXPORTS, 1, [Defined for compiling internal code]) - -diff --git a/orc/Makefile.am b/orc/Makefile.am -index 26263e0..887d36b 100644 ---- a/orc/Makefile.am -+++ b/orc/Makefile.am -@@ -9,6 +9,9 @@ liborc_@ORC_MAJORMINOR@_la_LDFLAGS = \ - -no-undefined -export-symbols-regex 'orc_' - liborc_@ORC_MAJORMINOR@_la_CFLAGS = $(ORC_CFLAGS) \ - -DORC_ENABLE_UNSTABLE_API -+if ENABLE_USER_CODEMEM -+liborc_@ORC_MAJORMINOR@_la_CFLAGS += -DORC_FORCE_USER_CODEMEM -+endif - - liborc_@ORC_MAJORMINOR@_la_SOURCES = \ - orc.c \ -diff --git a/orc/orccodemem.c b/orc/orccodemem.c -index 295a880..4a91e3e 100644 ---- a/orc/orccodemem.c -+++ b/orc/orccodemem.c -@@ -280,12 +280,14 @@ orc_code_region_allocate_codemem (OrcCodeRegion *region) - { - const char *tmpdir; - -+#ifndef ORC_FORCE_USER_CODEMEM - tmpdir = getenv ("TMPDIR"); - if (tmpdir && orc_code_region_allocate_codemem_dual_map (region, - tmpdir, FALSE)) return; - - if (orc_code_region_allocate_codemem_dual_map (region, - "/tmp", FALSE)) return; -+#endif - - tmpdir = getenv ("XDG_RUNTIME_DIR"); - if (tmpdir && orc_code_region_allocate_codemem_dual_map (region, --- -1.7.7.6 -