diff --git a/.gitignore b/.gitignore index 0a67b77..2e46a98 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/orc-0.4.17.tar.gz +SOURCES/orc-0.4.22.tar.xz diff --git a/.orc.metadata b/.orc.metadata index 0c9ca77..4c7902c 100644 --- a/.orc.metadata +++ b/.orc.metadata @@ -1 +1 @@ -5cb7b3225a23bc4a5771a62e9c94a90d21609632 SOURCES/orc-0.4.17.tar.gz +c50cf2f2a9a7e4ab400fd79f706e831ace1936bc SOURCES/orc-0.4.22.tar.xz diff --git a/SOURCES/0001-Use-a-subdirectory-for-temporary-files.patch b/SOURCES/0001-Use-a-subdirectory-for-temporary-files.patch deleted file mode 100644 index f8fc235..0000000 --- a/SOURCES/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/SOURCES/0001-compiler-also-prefer-the-backup-function-when-no-tar.patch b/SOURCES/0001-compiler-also-prefer-the-backup-function-when-no-tar.patch new file mode 100644 index 0000000..51b2ea6 --- /dev/null +++ b/SOURCES/0001-compiler-also-prefer-the-backup-function-when-no-tar.patch @@ -0,0 +1,27 @@ +From ce99e244faff3cae27b2e3511febd8bdc5bd0e03 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Mon, 7 Sep 2015 13:43:55 +0200 +Subject: [PATCH] compiler: also prefer the backup function when no target + +If we don't have a compiler target (like for ppc64), prefer to use the +backup function instead of doing full emulation. +--- + orc/orccompiler.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/orc/orccompiler.c b/orc/orccompiler.c +index 0086f77..0c2ff23 100644 +--- a/orc/orccompiler.c ++++ b/orc/orccompiler.c +@@ -318,7 +318,7 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target, + program->orccode->vars[i].value = compiler->vars[i].value; + } + +- if (program->backup_func && _orc_compiler_flag_backup) { ++ if (program->backup_func && (_orc_compiler_flag_backup || target == NULL)) { + orc_compiler_error (compiler, "Compilation disabled, using backup"); + compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; + goto error; +-- +2.4.3 + diff --git a/SOURCES/0001-executor-fix-load-of-parameters-smaller-than-64-bits.patch b/SOURCES/0001-executor-fix-load-of-parameters-smaller-than-64-bits.patch new file mode 100644 index 0000000..90bb37b --- /dev/null +++ b/SOURCES/0001-executor-fix-load-of-parameters-smaller-than-64-bits.patch @@ -0,0 +1,38 @@ +From e2b4dd77dec4e3f471b59336ef99b1151638ad38 Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Mon, 7 Sep 2015 15:30:36 +0200 +Subject: [PATCH] executor: fix load of parameters smaller than 64 bits + +Parameters less than 64 bits are passed in just one param register. +Fixes crashes on ldresnearb and friends in emulated code. +--- + orc/orcexecutor.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/orc/orcexecutor.c b/orc/orcexecutor.c +index 6fe296d..6306d34 100644 +--- a/orc/orcexecutor.c ++++ b/orc/orcexecutor.c +@@ -295,10 +295,15 @@ orc_executor_emulate (OrcExecutor *ex) + } else if (var->vartype == ORC_VAR_TYPE_PARAM) { + opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]]; + /* FIXME hack */ +- load_constant (tmpspace[insn->src_args[k]], 8, +- (orc_uint64)(orc_uint32)ex->params[insn->src_args[k]] | +- (((orc_uint64)(orc_uint32)ex->params[insn->src_args[k] + +- (ORC_VAR_T1 - ORC_VAR_P1)])<<32)); ++ if (var->size == 8) { ++ load_constant (tmpspace[insn->src_args[k]], 8, ++ (orc_uint64)(orc_uint32)ex->params[insn->src_args[k]] | ++ (((orc_uint64)(orc_uint32)ex->params[insn->src_args[k] + ++ (ORC_VAR_T1 - ORC_VAR_P1)])<<32)); ++ } else { ++ load_constant (tmpspace[insn->src_args[k]], 8, ++ ex->params[insn->src_args[k]]); ++ } + } else if (var->vartype == ORC_VAR_TYPE_TEMP) { + opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]]; + } else if (var->vartype == ORC_VAR_TYPE_SRC) { +-- +2.4.3 + diff --git a/SOURCES/0001-orcc-program-c-fix-64-bit-parameter-loading-loadpq-o.patch b/SOURCES/0001-orcc-program-c-fix-64-bit-parameter-loading-loadpq-o.patch new file mode 100644 index 0000000..8171ba1 --- /dev/null +++ b/SOURCES/0001-orcc-program-c-fix-64-bit-parameter-loading-loadpq-o.patch @@ -0,0 +1,57 @@ +From 29486d8c98655a6e14ec2af9f71489cbdda41a53 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= +Date: Sat, 8 Nov 2014 13:23:12 +0000 +Subject: [PATCH] orcc: program-c: fix 64-bit parameter loading (loadpq) on + big-endian systems + +When passing 64-bit parameters through OrcExecutor, we +have to split them up into two 32-bit parameters for +backwards compatibility reasons. When generating C code, +make sure that we split up 64-bit parameters in the same +way as loadpq will read them back later. The lower 32 bits +should end up in params[ORC_VAR_D1+i] and the higher bits +should end up in params[ORC_VAR_T1+i]. The way it was done +so far, the higher/lower bits ended up swapped on big endian +systems, and then got deserialised in swapped order by loadpq. +This resulted in bogus parameters being used. + +In particular, this broke the gstreamer volume element and +its unit tests on big endian systems when handling samples +in F64 format (i.e. doubles). + +https://bugzilla.gnome.org/show_bug.cgi?id=739354 +--- + tools/orcc.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tools/orcc.c b/tools/orcc.c +index d25b548..fdab530 100644 +--- a/tools/orcc.c ++++ b/tools/orcc.c +@@ -843,9 +843,9 @@ output_code_execute (OrcProgram *p, FILE *output, int is_inline) + fprintf(output, " {\n"); + fprintf(output, " orc_union64 tmp;\n"); + fprintf(output, " tmp.i = %s;\n", varnames[ORC_VAR_P1 + i]); +- fprintf(output, " ex->params[%s] = tmp.x2[0];\n", ++ fprintf(output, " ex->params[%s] = ((orc_uint64) tmp.i) & 0xffffffff;\n", + enumnames[ORC_VAR_P1 + i]); +- fprintf(output, " ex->params[%s] = tmp.x2[1];\n", ++ fprintf(output, " ex->params[%s] = ((orc_uint64) tmp.i) >> 32;\n", + enumnames[ORC_VAR_T1 + i]); + fprintf(output, " }\n"); + break; +@@ -854,9 +854,9 @@ output_code_execute (OrcProgram *p, FILE *output, int is_inline) + fprintf(output, " {\n"); + fprintf(output, " orc_union64 tmp;\n"); + fprintf(output, " tmp.f = %s;\n", varnames[ORC_VAR_P1 + i]); +- fprintf(output, " ex->params[%s] = tmp.x2[0];\n", ++ fprintf(output, " ex->params[%s] = ((orc_uint64) tmp.i) & 0xffffffff;\n", + enumnames[ORC_VAR_P1 + i]); +- fprintf(output, " ex->params[%s] = tmp.x2[1];\n", ++ fprintf(output, " ex->params[%s] = ((orc_uint64) tmp.i) >> 32;\n", + enumnames[ORC_VAR_T1 + i]); + fprintf(output, " }\n"); + break; +-- +2.4.3 + diff --git a/SOURCES/0001-test-limits-improve-test-without-target.patch b/SOURCES/0001-test-limits-improve-test-without-target.patch new file mode 100644 index 0000000..b3662e1 --- /dev/null +++ b/SOURCES/0001-test-limits-improve-test-without-target.patch @@ -0,0 +1,37 @@ +From 3298a5520d5ac4ec331b0b3b7a2211d4d94172cf Mon Sep 17 00:00:00 2001 +From: Wim Taymans +Date: Wed, 12 Aug 2015 13:16:28 +0200 +Subject: [PATCH] test-limits: improve test without target + +When there is no target available, the unit test would fail with a +non-fatal error (because emulation would be done). The non-fatal error +would however not be overwritten by the real error when we exceed the +limits. + +First relax the first compilation test to check for FATAL errors. Then +reset the program (and clear any non-fatal errors) before triggering +the next error. +--- + testsuite/test-limits.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/testsuite/test-limits.c b/testsuite/test-limits.c +index ed19d8a..0e43924 100644 +--- a/testsuite/test-limits.c ++++ b/testsuite/test-limits.c +@@ -35,9 +35,11 @@ test_simple (int max, int (*adder) (OrcProgram *, int, const char *)) + for (v = 0; v < max; v++) + (*adder) (p, 2, names + v); + result = orc_program_compile (p); +- if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL (result)) ++ if (ORC_COMPILE_RESULT_IS_FATAL (result)) + error = TRUE; + ++ orc_program_reset (p); ++ + /* Check we can not add one more */ + (*adder) (p, 2, names + v); + result = orc_program_compile (p); +-- +2.4.3 + diff --git a/SOURCES/0002-Add-compiler-option-for-ENABLE_USER_CODEMEM.patch b/SOURCES/0002-Add-compiler-option-for-ENABLE_USER_CODEMEM.patch deleted file mode 100644 index c6b1487..0000000 --- a/SOURCES/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 - diff --git a/SOURCES/orc-selinux-tmplocation.patch b/SOURCES/orc-selinux-tmplocation.patch new file mode 100644 index 0000000..228bbc1 --- /dev/null +++ b/SOURCES/orc-selinux-tmplocation.patch @@ -0,0 +1,45 @@ +commit 0e31d7fc6a03faf1076dfd51b49401539c3ebed9 +Author: Fabian Deutsch +Date: Tue Sep 2 10:38:17 2014 +0200 + + TMPDIR becomes the last option + + Previously $TMPDIR and /tmp were the first options to try to use for + intermediate files. To prevent name collisions, now user specific dirs ($HOME + and $XDG_RUNTIME_DIR) are prefered over the user unspecific dirs ($TMP and + /tmp). + + https://bugzilla.gnome.org/show_bug.cgi?id=735871 + +diff --git a/orc/orccodemem.c b/orc/orccodemem.c +index 7bb78d2..8bc2a48 100644 +--- a/orc/orccodemem.c ++++ b/orc/orccodemem.c +@@ -266,21 +266,21 @@ orc_code_region_allocate_codemem (OrcCodeRegion *region) + { + const char *tmpdir; + +- tmpdir = getenv ("TMPDIR"); ++ tmpdir = getenv ("XDG_RUNTIME_DIR"); + 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; +- +- tmpdir = getenv ("XDG_RUNTIME_DIR"); ++ tmpdir = getenv ("HOME"); + if (tmpdir && orc_code_region_allocate_codemem_dual_map (region, + tmpdir, FALSE)) return; + +- tmpdir = getenv ("HOME"); ++ 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; ++ + if (orc_code_region_allocate_codemem_anon_map (region)) return; + + ORC_ERROR("Failed to create write and exec mmap regions. This " diff --git a/SPECS/orc.spec b/SPECS/orc.spec index c0df3be..d34ae7f 100644 --- a/SPECS/orc.spec +++ b/SPECS/orc.spec @@ -1,20 +1,20 @@ Name: orc -Version: 0.4.17 +Version: 0.4.22 Release: 5%{?dist} Summary: The Oil Run-time Compiler Group: System Environment/Libraries License: BSD URL: http://cgit.freedesktop.org/gstreamer/orc/ -Source0: http://code.entropywave.com/download/orc/orc-%{version}.tar.gz -BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +Source0: http://gstreamer.freedesktop.org/src/orc/%{name}-%{version}.tar.xz +Patch0: orc-selinux-tmplocation.patch +Patch1: 0001-orcc-program-c-fix-64-bit-parameter-loading-loadpq-o.patch +Patch2: 0001-test-limits-improve-test-without-target.patch +Patch3: 0001-compiler-also-prefer-the-backup-function-when-no-tar.patch +Patch4: 0001-executor-fix-load-of-parameters-smaller-than-64-bits.patch BuildRequires: gtk-doc, libtool -# Upstream bugs: https://bugs.freedesktop.org/show_bug.cgi?id=41446 -Patch1: 0001-Use-a-subdirectory-for-temporary-files.patch -Patch2: 0002-Add-compiler-option-for-ENABLE_USER_CODEMEM.patch - %description Orc is a library and set of tools for compiling and executing very simple programs that operate on arrays of data. The "language" @@ -52,23 +52,23 @@ Requires: pkgconfig The Orc compiler, to produce optimized code. - %prep %setup -q -%patch1 -p1 -b .subdir -%patch2 -p1 -b .condtmp - -autoreconf -vif +%patch0 -p1 -b .selinux +%patch1 -p1 -b .orc +%patch2 -p1 -b .orc2 +%patch3 -p1 -b .orc3 +%patch4 -p1 -b .orc4 +NOCONFIGURE=1 autoreconf -vif %build -%configure --disable-static --enable-gtk-doc --enable-user-codemem +%configure --disable-static --enable-gtk-doc -make %{?_smp_mflags} +make %{?_smp_mflags} V=1 %install -rm -rf %{buildroot} make install DESTDIR=%{buildroot} INSTALL="install -p" # Remove unneeded files. @@ -78,29 +78,21 @@ rm -rf %{buildroot}/%{_libdir}/orc touch -r stamp-h1 %{buildroot}%{_includedir}/%{name}-0.4/orc/orc-stdint.h -%clean -rm -rf %{buildroot} - - %post -p /sbin/ldconfig %postun -p /sbin/ldconfig - %files -%defattr(-,root,root,-) %doc COPYING README %{_libdir}/liborc-*.so.* %{_bindir}/orc-bugreport %files doc -%defattr(-,root,root,-) %doc %{_datadir}/gtk-doc/html/orc/ %files devel -%defattr(-,root,root,-) %doc examples/*.c %{_includedir}/%{name}-0.4/ %{_libdir}/liborc-*.so @@ -108,12 +100,33 @@ rm -rf %{buildroot} %{_datadir}/aclocal/orc.m4 %files compiler -%defattr(-,root,root,-) %{_bindir}/orcc - %changelog +* Thu Aug 13 2015 Wim Taymans - 0.4.22-5 +- Run backup functions on s390x instead of emulation +- Fix load of parameters smaller than 64 bits +- Related: rhbz#1249506 + +* Thu Aug 13 2015 Wim Taymans - 0.4.22-4 +- Fix unit test on ppc64le +- Resolves: rhbz#1252498 + +* Wed Jul 8 2015 Wim Taymans - 0.4.22-3 +- Fix loading of 64bit parameters on big endian +- Related: #1234325 + +* Wed Mar 25 2015 Wim Taymans - 0.4.22-2 +- Don't run tests during build +- add new source +- remove old patches, add new patch +- Resolves: #1174391 + +* Fri Aug 29 2014 Peter Robinson 0.4.22-1 +- Update to 0.4.22 +- Resolves: #1174391 + * Fri Jan 24 2014 Daniel Mach - 0.4.17-5 - Mass rebuild 2014-01-24