diff -Nru orc-0.4.31/debian/changelog orc-0.4.32/debian/changelog --- orc-0.4.31/debian/changelog 2019-11-02 09:26:50.000000000 +0000 +++ orc-0.4.32/debian/changelog 2020-09-11 17:37:02.000000000 +0000 @@ -1,3 +1,17 @@ +orc (1:0.4.32-1) unstable; urgency=medium + + [ Debian Janitor ] + * Trim trailing whitespace. + * Transition to automatic debug package (from: liborc-0.4-0-dbg). + * Bump debhelper from old 9 to 12. + * Set debhelper-compat version in Build-Depends. + * Drop unnecessary dh arguments: --parallel + + [ Sebastian Dröge ] + * New upstream bugfix release. + + -- Sebastian Dröge Fri, 11 Sep 2020 20:37:02 +0300 + orc (1:0.4.31-1) unstable; urgency=medium * New upstream bugfix release (Closes: #940979). @@ -422,4 +436,3 @@ * Initial version (Closes: #531407). -- Sebastian Dröge Mon, 01 Jun 2009 12:14:57 +0200 - diff -Nru orc-0.4.31/debian/compat orc-0.4.32/debian/compat --- orc-0.4.31/debian/compat 2019-11-02 09:26:26.000000000 +0000 +++ orc-0.4.32/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru orc-0.4.31/debian/control orc-0.4.32/debian/control --- orc-0.4.31/debian/control 2019-11-02 09:26:26.000000000 +0000 +++ orc-0.4.32/debian/control 2020-09-11 17:37:02.000000000 +0000 @@ -4,12 +4,12 @@ Maintainer: Maintainers of GStreamer packages Uploaders: Sebastian Dröge , Sjoerd Simons -Build-Depends: debhelper (>= 9), +Build-Depends: debhelper-compat (= 13), meson (>= 0.47.0), pkg-config, gtk-doc-tools Rules-Requires-Root: no -Standards-Version: 3.9.3 +Standards-Version: 4.5.0 Homepage: https://cgit.freedesktop.org/gstreamer/orc Vcs-Git: https://salsa.debian.org/gstreamer-team/orc.git Vcs-Browser: https://salsa.debian.org/gstreamer-team/orc/ @@ -69,23 +69,6 @@ This package contains the development tools, and should not be installed directly. -Package: liborc-0.4-0-dbg -Section: debug -Architecture: any -Multi-Arch: same -Depends: liborc-0.4-0 (= ${binary:Version}), - ${misc:Depends}, - ${shlibs:Depends} -Description: Library of Optimized Inner Loops Runtime Compiler (debug package) - Orc is a library and set of tools for compiling and executing - very simple programs that operate on arrays of data. The "language" - is a generic assembly language that represents many of the features - available in SIMD architectures, including saturated addition and - subtraction, and many arithmetic operations. - . - This package contains the debugging symbols for the orc library. - Users should install it if they want to debug software that uses orc. - Package: liborc-0.4-doc Section: doc Architecture: all diff -Nru orc-0.4.31/debian/liborc-0.4-dev.install orc-0.4.32/debian/liborc-0.4-dev.install --- orc-0.4.31/debian/liborc-0.4-dev.install 2019-11-02 09:26:26.000000000 +0000 +++ orc-0.4.32/debian/liborc-0.4-dev.install 2020-09-11 17:37:02.000000000 +0000 @@ -1,4 +1,5 @@ debian/tmp/usr/include/orc-0.4 debian/tmp/usr/lib/*/liborc*-0.4.a debian/tmp/usr/lib/*/liborc*-0.4.so -debian/tmp/usr/lib/*/pkgconfig/orc-0.4.pc +debian/tmp/usr/lib/*/pkgconfig/orc*-0.4.pc +debian/tmp/usr/share/aclocal/orc.m4 diff -Nru orc-0.4.31/debian/rules orc-0.4.32/debian/rules --- orc-0.4.31/debian/rules 2019-11-02 09:26:26.000000000 +0000 +++ orc-0.4.32/debian/rules 2020-09-11 17:37:02.000000000 +0000 @@ -5,7 +5,7 @@ LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed %: - dh $@ --buildsystem=meson --parallel + dh $@ --buildsystem=meson override_dh_auto_configure: if test -r /proc/cpuinfo; then \ @@ -30,9 +30,8 @@ dh_auto_test --builddirectory=test || true override_dh_strip: - dh_strip -pliborc-0.4-0 --dbg-package=liborc-0.4-0-dbg + dh_strip -pliborc-0.4-0 --dbgsym-migration='liborc-0.4-0-dbg (<< 1:0.4.32-1~)' dh_strip --remaining-packages override_dh_makeshlibs: dh_makeshlibs -pliborc-0.4-0 -V 'liborc-0.4-0 (>= 1:0.4.25)' -- -c4 - diff -Nru orc-0.4.31/debian/watch orc-0.4.32/debian/watch --- orc-0.4.31/debian/watch 2019-11-02 09:26:26.000000000 +0000 +++ orc-0.4.32/debian/watch 2020-09-11 17:37:02.000000000 +0000 @@ -1,2 +1,2 @@ -version=2 -http://code.entropywave.com/download/orc/orc-([0-9.]*).tar.gz +version=3 +http://gstreamer.freedesktop.org/src/orc/orc-([\d]+\.[\d]+\.[\d]+)\.tar\.xz diff -Nru orc-0.4.31/doc/meson.build orc-0.4.32/doc/meson.build --- orc-0.4.31/doc/meson.build 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/doc/meson.build 2020-09-11 17:18:44.158056500 +0000 @@ -29,6 +29,6 @@ # FIXME: there should be a way to specify the gtk-doc requirement # html_args : '--path=' + meson.current_build_dir() + ':' + meson.current_source_dir(), gnome.gtkdoc('orc', - src_dir : join_paths(meson.current_source_dir(), '..', 'orc'), + src_dir : meson.current_source_dir() / '..' / 'orc', main_sgml : 'orc-docs.sgml', install : true) diff -Nru orc-0.4.31/examples/example2.c orc-0.4.32/examples/example2.c --- orc-0.4.31/examples/example2.c 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/examples/example2.c 2020-09-11 17:18:44.162056400 +0000 @@ -21,7 +21,7 @@ } /* Call a function that uses Orc */ - audio_add_mono_to_stereo_scaled_s16 (c, a, b, volume*4096, N); + audio_add_mono_to_stereo_scaled_s16 (c, a, b, (int) (volume*4096), N); /* Print the results */ for(i=0;i= 0.47.0', +project ('orc', 'c', version : '0.4.32', + meson_version : '>= 0.49.0', default_options : ['buildtype=debugoptimized', 'warning_level=1', 'c_std=gnu99'] ) @@ -22,7 +22,8 @@ cc = meson.get_compiler('c') cdata = configuration_data() # config.h -pc_conf = configuration_data() # orc.pc + +pkg = import('pkgconfig') # -Bsymbolic-functions if meson.version().version_compare('>= 0.46.0') @@ -44,11 +45,13 @@ cdata.set('ORC_API_EXPORT', export_define) all_backends = ['sse', 'mmx', 'altivec', 'neon', 'mips', 'c64x'] # 'arm' +enabled_backends = [] backend = get_option('orc-backend') foreach b : all_backends if backend == 'all' or backend == b cdata.set('ENABLE_BACKEND_' + b.to_upper(), 1) + enabled_backends += [b] endif endforeach @@ -67,18 +70,16 @@ warning(cpu_family + ' isn\'t a supported cpu family for optimization') endif +threads = dependency('threads') + libm = cc.find_library('m', required : false) librt = [] -pc_conf.set('LIBRT', '') if cc.has_function('clock_gettime') cdata.set('HAVE_CLOCK_GETTIME', true) else # On glibc older than 2.17, clock_gettime is provided by time.h and -lrt librt = cc.find_library('rt', required : false) - if librt.found() and cc.has_function('clock_gettime', dependencies : librt) - pc_conf.set('LIBRT', '-lrt') - endif endif liblog = [] @@ -92,18 +93,19 @@ cdata.set('HAVE_CODEMEM_VIRTUALALLOC', true) cdata.set('HAVE_OS_WIN32', true) cdata.set('HAVE_THREAD_WIN32', true) - pc_conf.set('EXEEXT', '.exe') - pc_conf.set('PTHREAD_LIBS', '') + + code = ''' + #include + #if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) + #error "Not building for UWP" + #endif''' + if cc.compiles(code, name : 'building for UWP') + cdata.set('ORC_WINAPI_ONLY_APP', true) + endif else # If it is not windows, we just assume it is a unix of sorts for now. cdata.set('HAVE_CODEMEM_MMAP', true) cdata.set('HAVE_THREAD_PTHREAD', true) - pc_conf.set('EXEEXT', '') - if host_os == 'android' - pc_conf.set('PTHREAD_LIBS', '') - else - pc_conf.set('PTHREAD_LIBS', '-lpthread') - endif endif monotonic_test = ''' @@ -130,6 +132,7 @@ subdir('orc') +opt_benchmarks = get_option('benchmarks') opt_examples = get_option('examples') opt_orctest = get_option('orc-test') opt_tests = get_option('tests') @@ -148,6 +151,7 @@ subdir('tools') else orcc = disabler() # for testsuite/orcc/ + tools_variables = [] endif if not opt_examples.disabled() @@ -158,32 +162,60 @@ subdir('testsuite') endif +have_docs = false if build_machine.system() == 'windows' message('Disabling gtk-doc while building on Windows') + gtk_doc_disabled_reason = 'disabled on windows' else if find_program('gtkdoc-scan', required : get_option('gtk_doc')).found() subdir('doc') + have_docs = true + gtk_doc_disabled_reason = '' + elif get_option('gtk_doc').disabled() + message('Not building documentation (disabled)') + gtk_doc_disabled_reason = 'disabled' else message('Not building documentation as gtk-doc was not found') + gtk_doc_disabled_reason = 'gtk-doc not found' endif endif -# FIXME: use pkg-config module -pc_conf.set('prefix', get_option('prefix')) -pc_conf.set('exec_prefix', get_option('prefix')) -pc_conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir'))) -pc_conf.set('includedir', join_paths(get_option('prefix'), 'include')) -pc_conf.set('VERSION', meson.project_version()) -pc_conf.set('ORC_MAJORMINOR', orc_api) -pc_conf.set('LIBM', libm.found() ? '-lm' : '') - -pkgconfigdir = join_paths (get_option('libdir'), 'pkgconfig') -configure_file(input : 'orc.pc.in', - output : 'orc-' + orc_api + '.pc', - configuration : pc_conf, - install_dir : pkgconfigdir) +pkg.generate (orc_lib, + subdirs : 'orc-' + orc_api, + description : 'Library of Optimized Inner Loops Runtime Compiler', + variables : tools_variables, + libraries_private : orc_dependencies) # Install m4 macro that other projects use install_data('orc.m4', install_dir : 'share/aclocal') configure_file(output : 'config.h', configuration : cdata) + +# summary +if meson.version().version_compare('>= 0.53') + summary({ + 'SSE': 'sse' in enabled_backends, + 'MMX': 'mmx' in enabled_backends, + 'NEON': 'neon' in enabled_backends, + 'MIPS': 'mips' in enabled_backends, + 'c64x': 'c64x' in enabled_backends, + 'Altivec': 'altivec' in enabled_backends, + }, section: 'Backends', bool_yn: true) + + # meson 0.53 will print two lines for two args (and warn about list_sep kwarg) + # meson 0.54 will print one line if list_sep is specified + if not have_docs + doc_summary = [have_docs, gtk_doc_disabled_reason] + else + doc_summary = have_docs + endif + + summary({ + 'Tools': not opt_tools.disabled(), + 'Tests': not opt_tests.disabled(), + 'Examples': not opt_examples.disabled(), + 'Benchmarks': not opt_benchmarks.disabled(), + 'Documentation': doc_summary, + 'Orc-test library': not opt_orctest.disabled(), + }, section: 'Build options', bool_yn: true, list_sep: ' ') +endif diff -Nru orc-0.4.31/orc/meson.build orc-0.4.32/orc/meson.build --- orc-0.4.31/orc/meson.build 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc/meson.build 2020-09-11 17:18:44.166056400 +0000 @@ -99,7 +99,7 @@ orc_c_args = ['-DORC_ENABLE_UNSTABLE_API', '-D_GNU_SOURCE'] -orc_dependencies = [libm, librt, liblog] +orc_dependencies = [libm, librt, liblog, threads] orc_lib = library ('orc-' + orc_api, orc_sources, diff -Nru orc-0.4.31/orc/orc.c orc-0.4.32/orc/orc.c --- orc-0.4.31/orc/orc.c 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc/orc.c 2020-09-11 17:18:44.166056400 +0000 @@ -5,6 +5,11 @@ #include #include +#ifdef _WIN32 +#include +#include +#endif + #include #include #include @@ -83,3 +88,40 @@ { return (const char *) VERSION; } + +/* getenv() is deprecated on Windows and always returns NULL on UWP */ +#ifdef _WIN32 +char* +_orc_getenv (const char *key) +{ + int len; + char check[1], *value; + + /* Get the len */ + len = GetEnvironmentVariableA (key, check, 1); + if (len == 0) + /* env var is not set or is "" (empty string) */ + return NULL; + + /* max size of len is 32767, cannot overflow */ + value = malloc (sizeof (value) * len); + + if (GetEnvironmentVariableA (key, value, len) != (len - 1)) { + free (value); + return NULL; + } + + return value; +} +#else +char* +_orc_getenv (const char *key) +{ + char *value = getenv (key); + + if (value) + value = strdup (value); + + return value; +} +#endif diff -Nru orc-0.4.31/orc/orccodemem.c orc-0.4.32/orc/orccodemem.c --- orc-0.4.31/orc/orccodemem.c 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc/orccodemem.c 2020-09-11 17:18:44.170056300 +0000 @@ -11,11 +11,18 @@ #include #include #include + #ifdef HAVE_CODEMEM_MMAP #include #endif + #ifdef HAVE_CODEMEM_VIRTUALALLOC #include + #ifdef ORC_WINAPI_ONLY_APP + #define _virtualalloc VirtualAllocFromApp + #else + #define _virtualalloc VirtualAlloc + #endif #endif #include @@ -25,6 +32,9 @@ #define SIZE 65536 +/* See _orc_compiler_init() */ +extern int _orc_codemem_alignment; + typedef struct _OrcCodeRegion OrcCodeRegion; struct _OrcCodeRegion { @@ -156,7 +166,8 @@ { OrcCodeRegion *region; OrcCodeChunk *chunk; - int aligned_size = (size + 15) & (~15); + int aligned_size = + (size + _orc_codemem_alignment) & (~_orc_codemem_alignment); chunk = orc_code_region_get_free_chunk (aligned_size); region = chunk->region; @@ -287,7 +298,7 @@ "/tmp", FALSE)) return; if (orc_code_region_allocate_codemem_anon_map (region)) return; - + ORC_ERROR("Failed to create write and exec mmap regions. This " "is probably because SELinux execmem check is enabled (good) " "and $TMPDIR and $HOME are mounted noexec (bad)."); @@ -299,7 +310,10 @@ void orc_code_region_allocate_codemem (OrcCodeRegion *region) { - region->write_ptr = VirtualAlloc(NULL, SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE); + /* On UWP, we can't allocate memory as executable from the start. We can only + * set that later after compiling and copying the code over. This is a good + * idea in general to avoid security issues, so we do it on win32 too. */ + region->write_ptr = _virtualalloc (NULL, SIZE, MEM_COMMIT, PAGE_READWRITE); region->exec_ptr = region->write_ptr; region->size = SIZE; } diff -Nru orc-0.4.31/orc/orccompiler.c orc-0.4.32/orc/orccompiler.c --- orc-0.4.31/orc/orccompiler.c 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc/orccompiler.c 2020-09-11 17:18:44.170056300 +0000 @@ -6,6 +6,15 @@ #include #include +#if defined(HAVE_CODEMEM_VIRTUALALLOC) +#include + #ifdef ORC_WINAPI_ONLY_APP + #define _virtualprotect VirtualProtectFromApp + #else + #define _virtualprotect VirtualProtect + #endif +#endif + #include #include #include @@ -48,20 +57,71 @@ int _orc_compiler_flag_debug; int _orc_compiler_flag_randomize; +/* For Windows */ +int _orc_codemem_alignment; + void _orc_compiler_init (void) { - const char *envvar; + char *envvar; +#ifdef HAVE_CODEMEM_VIRTUALALLOC + size_t page_size; + SYSTEM_INFO info; +#endif - envvar = getenv ("ORC_CODE"); + envvar = _orc_getenv ("ORC_CODE"); if (envvar != NULL) { _orc_compiler_flag_list = strsplit (envvar, ','); + free (envvar); } _orc_compiler_flag_backup = orc_compiler_flag_check ("backup"); _orc_compiler_flag_emulate = orc_compiler_flag_check ("emulate"); _orc_compiler_flag_debug = orc_compiler_flag_check ("debug"); _orc_compiler_flag_randomize = orc_compiler_flag_check ("randomize"); + + /* 16 bytes alignment by default */ + _orc_codemem_alignment = 15; + +#ifdef HAVE_CODEMEM_VIRTUALALLOC + GetNativeSystemInfo(&info); + page_size = info.dwPageSize; + + /* Protection attribute change via VirtualProtect will be applied per + * page memory unit. So we should split code memory with page aligned range. + * Otherwise the protection attribute of previously generated executable code + * memory can be affected by later generated one. + */ + _orc_codemem_alignment = info.dwPageSize - 1; +#endif + +#ifdef ORC_WINAPI_ONLY_APP + if (!_orc_compiler_flag_backup && !_orc_compiler_flag_emulate) { + int can_jit = FALSE; + + /* If backup code is not enabled and emulation is not enabled, that means + * we will do JIT compilation and call orc_code_region_allocate_codemem(). + * When targeting Windows Store apps, the codeGeneration capability must + * be enabled in the app manifest, or passing PAGE_EXECUTE to + * VirtualProtectFromApp will return NULL. In this case, we must force + * backup C code, and if that's not available, we must emulate. */ + void *mem = VirtualAllocFromApp (NULL, page_size, MEM_COMMIT, + PAGE_READWRITE); + if (mem) { + int old_protect; + if (VirtualProtectFromApp (mem, page_size, PAGE_EXECUTE, &old_protect) > 0) + can_jit = TRUE; + VirtualFree (mem, 0, MEM_RELEASE); + } + + if (!can_jit) { + ORC_WARNING ("Unable to allocate executable pages: using backup code or " + "emulation: codeGeneration capability isn't set in the app manifest?"); + _orc_compiler_flag_backup = TRUE; + _orc_compiler_flag_emulate = TRUE; + } + } +#endif } int @@ -174,6 +234,34 @@ return orc_program_compile_full (program, target, flags); } +#if defined(HAVE_CODEMEM_VIRTUALALLOC) +static orc_bool +_set_virtual_protect (void * mem, size_t size, int code_protect) +{ + char *msg; + DWORD old_protect; + + /* No code, so we 'succeed' */ + if (size == 0) + return TRUE; + + if (!mem) + return FALSE; + + if (_virtualprotect (mem, size, code_protect, &old_protect) > 0) + return TRUE; + + FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, NULL, + GetLastError (), 0, (LPTSTR) &msg, 0, NULL); + ORC_ERROR ("Couldn't set memory protect on %p from %x to %x: %s", mem, + old_protect, code_protect, msg); + LocalFree (msg); + + return FALSE; +} +#endif + /** * orc_program_compile_full: * @program: the OrcProgram to compile @@ -359,6 +447,11 @@ program->orccode->code_size = compiler->codeptr - compiler->code; orc_code_allocate_codemem (program->orccode, program->orccode->code_size); +#if defined(HAVE_CODEMEM_VIRTUALALLOC) + /* Ensure that code region is writable before memcpy */ + _set_virtual_protect (program->orccode->code, program->orccode->code_size, + PAGE_READWRITE); +#endif memcpy (program->orccode->code, compiler->code, program->orccode->code_size); #ifdef VALGRIND_DISCARD_TRANSLATIONS @@ -370,6 +463,13 @@ compiler->target->flush_cache (program->orccode); } +#if defined(HAVE_CODEMEM_VIRTUALALLOC) + /* Code region is now ready for execution */ + if (!_set_virtual_protect (program->orccode->exec, program->orccode->code_size, + PAGE_EXECUTE)) + /* Can't set code as executable, force emulation */ + program->orccode->exec = (void *)orc_executor_emulate; +#endif program->code_exec = program->orccode->exec; program->asm_code = compiler->asm_code; @@ -637,7 +737,7 @@ var = compiler->vars + insn.dest_args[i]; if (var->vartype == ORC_VAR_TYPE_DEST) { OrcInstruction *cinsn; - + cinsn = compiler->insns + compiler->n_insns; compiler->n_insns++; diff -Nru orc-0.4.31/orc/orcdebug.c orc-0.4.32/orc/orcdebug.c --- orc-0.4.31/orc/orcdebug.c 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc/orcdebug.c 2020-09-11 17:18:44.174056300 +0000 @@ -29,6 +29,7 @@ #include "config.h" #endif #include +#include #include #include @@ -55,9 +56,9 @@ void _orc_debug_init(void) { - const char *envvar; + char *envvar; - envvar = getenv ("ORC_DEBUG"); + envvar = _orc_getenv ("ORC_DEBUG"); if (envvar != NULL) { char *end = NULL; int level; @@ -65,6 +66,7 @@ if (end > envvar) { _orc_debug_level = level; } + free (envvar); } ORC_INFO ("orc-" VERSION " debug init"); diff -Nru orc-0.4.31/orc/orcemulateopcodes.c orc-0.4.32/orc/orcemulateopcodes.c --- orc-0.4.31/orc/orcemulateopcodes.c 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc/orcemulateopcodes.c 2020-09-11 17:18:44.178056500 +0000 @@ -4896,7 +4896,7 @@ /* 0: loadl */ var32 = ptr4[i]; /* 1: convlf */ - var33.f = var32.i; + var33.f = (float) var32.i; /* 2: storel */ ptr0[i] = var33; } @@ -5279,7 +5279,7 @@ /* 1: convdl */ { int tmp; - tmp = var32.f; + tmp = (int) var32.f; if (tmp == 0x80000000 && !(var32.i & ORC_UINT64_C(0x8000000000000000))) tmp = 0x7fffffff; var33.i = tmp; } diff -Nru orc-0.4.31/orc/orcinternal.h orc-0.4.32/orc/orcinternal.h --- orc-0.4.31/orc/orcinternal.h 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc/orcinternal.h 2020-09-11 17:18:44.182056400 +0000 @@ -36,6 +36,8 @@ void orc_compiler_emit_invariants (OrcCompiler *compiler); int orc_program_has_float (OrcCompiler *compiler); + +char* _orc_getenv (const char *var); #endif ORC_END_DECLS diff -Nru orc-0.4.31/orc.pc.in orc-0.4.32/orc.pc.in --- orc-0.4.31/orc.pc.in 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/orc-@ORC_MAJORMINOR@ -toolsdir=${exec_prefix}/bin - - -Name: orc-@ORC_MAJORMINOR@ -Description: Library of Optimized Inner Loops Runtime Compiler -Version: @VERSION@ -Libs: -L${libdir} -lorc-@ORC_MAJORMINOR@ -Libs.private: @LIBM@ @LIBRT@ @PTHREAD_LIBS@ -Cflags: -I${includedir} - -orcc=${toolsdir}/orcc@EXEEXT@ - diff -Nru orc-0.4.31/orc-test/meson.build orc-0.4.32/orc-test/meson.build --- orc-0.4.31/orc-test/meson.build 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc-test/meson.build 2020-09-11 17:18:44.166056400 +0000 @@ -27,7 +27,6 @@ endif # pkg-config file -pkg = import('pkgconfig') pkg.generate(orc_test_lib, name: 'orc-test', filebase: 'orc-test-' + orc_api, diff -Nru orc-0.4.31/orc-test.pc.in orc-0.4.32/orc-test.pc.in --- orc-0.4.31/orc-test.pc.in 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/orc-test.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/orc-@ORC_MAJORMINOR@ - -Name: orc-test-@ORC_MAJORMINOR@ -Description: Test Library of Optimized Inner Loops Runtime Compiler -Version: @VERSION@ -Requires: orc-@ORC_MAJORMINOR@ -Libs: -L${libdir} -lorc-test-@ORC_MAJORMINOR@ -Libs.private: @LIBM@ @LIBRT@ @PTHREAD_LIBS@ -Cflags: -I${includedir} diff -Nru orc-0.4.31/RELEASE orc-0.4.32/RELEASE --- orc-0.4.31/RELEASE 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/RELEASE 2020-09-11 17:18:44.158056500 +0000 @@ -1,3 +1,11 @@ +0.4.32 +====== + + - Add support for JIT code generation in Universal Windows Platform apps + (Nirbheek Chauhan, Seungha Yang) + - Minor Meson build system fixes and improvements + (Jan Alexander Steffens, Tim-Philipp Müller) + 0.4.31 ====== diff -Nru orc-0.4.31/testsuite/benchmorc/meson.build orc-0.4.32/testsuite/benchmorc/meson.build --- orc-0.4.31/testsuite/benchmorc/meson.build 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/testsuite/benchmorc/meson.build 2020-09-11 17:18:44.206056400 +0000 @@ -1,6 +1,8 @@ -bench10_orc_path = meson.current_source_dir() + '/bench10.orc' +bench10_orc_path = meson.current_source_dir() / 'bench10.orc' -executable ('benchmorc', 'benchmorc.c', +exe = executable ('benchmorc', 'benchmorc.c', c_args : ['-DORC_TEST_FILENAME="' + bench10_orc_path + '"'], dependencies: [libm, orc_dep, orc_test_dep], install: false) + +benchmark('bench10', exe) diff -Nru orc-0.4.31/testsuite/memcpy_speed.c orc-0.4.32/testsuite/memcpy_speed.c --- orc-0.4.31/testsuite/memcpy_speed.c 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/testsuite/memcpy_speed.c 2020-09-11 17:18:44.214056300 +0000 @@ -95,16 +95,16 @@ #endif orc_get_data_cache_sizes (&level1, &level2, &level3); if (level3 > 0) { - max = (log(level3)/M_LN2 - 6.0) * 10 + 20; + max = (int) ((log(level3)/M_LN2 - 6.0) * 10 + 20); } else if (level2 > 0) { - max = (log(level2)/M_LN2 - 6.0) * 10 + 20; + max = (int) ((log(level2)/M_LN2 - 6.0) * 10 + 20); } else { max = 140; } for(i=0;i MAX_SIZE_TO_CHECK) { printf ("Stopping test, exceeding maximum size to check (%d, could do above %d)\n", diff -Nru orc-0.4.31/testsuite/meson.build orc-0.4.32/testsuite/meson.build --- orc-0.4.31/testsuite/meson.build 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/testsuite/meson.build 2020-09-11 17:18:44.214056300 +0000 @@ -41,6 +41,7 @@ subdir('orcc') -if not get_option('benchmarks').disabled() +opt_benchmarks = get_option('benchmarks') +if not opt_benchmarks.disabled() subdir('benchmorc') endif diff -Nru orc-0.4.31/tools/meson.build orc-0.4.32/tools/meson.build --- orc-0.4.31/tools/meson.build 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/tools/meson.build 2020-09-11 17:18:44.222056400 +0000 @@ -10,3 +10,14 @@ orc_bugreport = executable ('orc-bugreport', 'orc-bugreport.c', install: true, dependencies : [orc_dep, orc_test_dep]) + +if host_os == 'windows' + orcc_filename = 'orcc.exe' +else + orcc_filename = 'orcc' +endif + +tools_variables = [ + 'toolsdir=' + ('${prefix}' / get_option('bindir')), + 'orcc=' + ('${toolsdir}' / orcc_filename), +] diff -Nru orc-0.4.31/tools/orcc.c orc-0.4.32/tools/orcc.c --- orc-0.4.31/tools/orcc.c 2019-11-02 09:24:52.000000000 +0000 +++ orc-0.4.32/tools/orcc.c 2020-09-11 17:18:44.222056400 +0000 @@ -22,7 +22,6 @@ void output_code_execute (OrcProgram *p, FILE *output, int is_inline); void output_program_generation (OrcProgram *p, FILE *output, int is_inline); void output_init_function (FILE *output); -static char * get_barrier (const char *s); static const char * my_basename (const char *s); int verbose = 0; @@ -319,11 +318,7 @@ fprintf(output, "\n"); } } else if (mode == MODE_HEADER) { - char *barrier = get_barrier (output_file); - - fprintf(output, "#ifndef _%s_\n", barrier); - fprintf(output, "#define _%s_\n", barrier); - free (barrier); + fprintf(output, "#pragma once\n"); fprintf(output, "\n"); if (include_file) { fprintf(output, "#include <%s>\n", include_file); @@ -357,8 +352,6 @@ fprintf(output, "}\n"); fprintf(output, "#endif\n"); fprintf(output, "\n"); - fprintf(output, "#endif\n"); - fprintf(output, "\n"); } else if (mode == MODE_TEST) { fprintf(output, "#include \n"); fprintf(output, "#include \n"); @@ -450,28 +443,6 @@ return 0; } - -static char * -get_barrier (const char *s) -{ - char *barrier; - int n; - int i; - - n = strlen(s); - barrier = malloc (n + 1); - for(i=0;i