Hello community, here is the log from the commit of package rubygem-ffi for openSUSE:Factory checked in at 2020-03-07 21:38:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-ffi (Old) and /work/SRC/openSUSE:Factory/.rubygem-ffi.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-ffi" Sat Mar 7 21:38:02 2020 rev:34 rq:773759 version:1.12.2 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-ffi/rubygem-ffi.changes 2020-02-11 22:17:13.319298974 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-ffi.new.26092/rubygem-ffi.changes 2020-03-07 21:38:03.500264848 +0100 @@ -1,0 +2,11 @@ +Mon Feb 10 14:34:08 UTC 2020 - Stephan Kulow <[email protected]> + +- updated to version 1.12.2 + see installed CHANGELOG.md + + 1.12.2 / 2020-02-01 + ------------------- + + * Fix possible segfault at FFI::Struct#[] and []= after GC.compact . #742 + +------------------------------------------------------------------- Old: ---- ffi-1.12.1.gem New: ---- ffi-1.12.2.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-ffi.spec ++++++ --- /var/tmp/diff_new_pack.4CEJjO/_old 2020-03-07 21:38:05.212266004 +0100 +++ /var/tmp/diff_new_pack.4CEJjO/_new 2020-03-07 21:38:05.216266007 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-ffi # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -24,7 +24,7 @@ # Name: rubygem-ffi -Version: 1.12.1 +Version: 1.12.2 Release: 0 %define mod_name ffi %define mod_full_name %{mod_name}-%{version} @@ -32,11 +32,11 @@ BuildRequires: libffi-devel # /MANUAL BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: ruby-macros >= 5 BuildRequires: %{rubydevel >= 2.0} BuildRequires: %{rubygem gem2rpm} BuildRequires: %{rubygem rdoc > 3.10} -Url: https://github.com/ffi/ffi/wiki +BuildRequires: ruby-macros >= 5 +URL: https://github.com/ffi/ffi/wiki Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: rubygem-ffi-rpmlintrc Source2: gem2rpm.yml ++++++ ffi-1.12.1.gem -> ffi-1.12.2.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2020-01-14 22:28:04.000000000 +0100 +++ new/CHANGELOG.md 2020-02-01 15:02:12.000000000 +0100 @@ -1,3 +1,9 @@ +1.12.2 / 2020-02-01 +------------------- + +* Fix possible segfault at FFI::Struct#[] and []= after GC.compact . #742 + + 1.12.1 / 2020-01-14 ------------------- Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/ffi_c/Struct.c new/ext/ffi_c/Struct.c --- old/ext/ffi_c/Struct.c 2020-01-14 22:28:04.000000000 +0100 +++ new/ext/ffi_c/Struct.c 2020-02-01 15:02:12.000000000 +0100 @@ -90,7 +90,7 @@ { Struct* s; VALUE obj = Data_Make_Struct(klass, Struct, struct_mark, struct_free, s); - + s->rbPointer = Qnil; s->rbLayout = Qnil; @@ -112,7 +112,7 @@ int nargs; Data_Get_Struct(self, Struct, s); - + nargs = rb_scan_args(argc, argv, "01*", &rbPointer, &rest); /* Call up into ruby code to adjust the layout */ @@ -127,7 +127,7 @@ } Data_Get_Struct(s->rbLayout, StructLayout, s->layout); - + if (rbPointer != Qnil) { s->pointer = MEMORY(rbPointer); s->rbPointer = rbPointer; @@ -148,16 +148,16 @@ { Struct* src; Struct* dst; - + Data_Get_Struct(self, Struct, dst); Data_Get_Struct(other, Struct, src); if (dst == src) { return self; } - + dst->rbLayout = src->rbLayout; dst->layout = src->layout; - + /* * A new MemoryPointer instance is allocated here instead of just calling * #dup on rbPointer, since the Pointer may not know its length, or may @@ -176,7 +176,7 @@ dst->rbReferences = ALLOC_N(VALUE, dst->layout->referenceFieldCount); memcpy(dst->rbReferences, src->rbReferences, dst->layout->referenceFieldCount * sizeof(VALUE)); } - + return self; } @@ -279,24 +279,25 @@ } -static VALUE +static StructField * struct_field(Struct* s, VALUE fieldName) { StructLayout* layout = s->layout; - VALUE rbField; + struct field_cache_entry *p_ce = FIELD_CACHE_LOOKUP(layout, fieldName); - if (likely(SYMBOL_P(fieldName) && st_lookup(layout->fieldSymbolTable, fieldName, (st_data_t *) &rbField))) { - return rbField; - } - - // TODO does this ever return anything? - rbField = rb_hash_aref(layout->rbFieldMap, fieldName); - if (rbField == Qnil) { - VALUE str = rb_funcall2(fieldName, id_to_s, 0, NULL); - rb_raise(rb_eArgError, "No such field '%s'", StringValuePtr(str)); + /* Do a hash lookup only if cache entry is empty or fieldName is unexpected? */ + if (unlikely(!SYMBOL_P(fieldName) || !p_ce->fieldName || p_ce->fieldName != fieldName)) { + VALUE rbField = rb_hash_aref(layout->rbFieldMap, fieldName); + if (unlikely(NIL_P(rbField))) { + VALUE str = rb_funcall2(fieldName, id_to_s, 0, NULL); + rb_raise(rb_eArgError, "No such field '%s'", StringValuePtr(str)); + } + /* Write the retrieved coder to the cache */ + p_ce->fieldName = fieldName; + p_ce->field = (StructField *) DATA_PTR(rbField); } - return rbField; + return p_ce->field; } /* @@ -308,22 +309,19 @@ struct_aref(VALUE self, VALUE fieldName) { Struct* s; - VALUE rbField; StructField* f; s = struct_validate(self); - rbField = struct_field(s, fieldName); - f = (StructField *) DATA_PTR(rbField); - + f = struct_field(s, fieldName); if (f->get != NULL) { return (*f->get)(f, s); - + } else if (f->memoryOp != NULL) { return (*f->memoryOp->get)(s->pointer, f->offset); } else { - + VALUE rbField = rb_hash_aref(s->layout->rbFieldMap, fieldName); /* call up to the ruby code to fetch the value */ return rb_funcall2(rbField, id_get, 1, &s->rbPointer); } @@ -340,22 +338,20 @@ struct_aset(VALUE self, VALUE fieldName, VALUE value) { Struct* s; - VALUE rbField; StructField* f; - s = struct_validate(self); - rbField = struct_field(s, fieldName); - f = (StructField *) DATA_PTR(rbField); + f = struct_field(s, fieldName); if (f->put != NULL) { (*f->put)(f, s, value); } else if (f->memoryOp != NULL) { (*f->memoryOp->put)(s->pointer, f->offset, value); - + } else { + VALUE rbField = rb_hash_aref(s->layout->rbFieldMap, fieldName); /* call up to the ruby code to set the value */ VALUE argv[2]; argv[0] = s->rbPointer; @@ -366,7 +362,7 @@ if (f->referenceRequired) { store_reference_value(f, s, value); } - + return value; } @@ -389,7 +385,7 @@ return Qnil; } - + Data_Get_Struct(self, Struct, s); Data_Get_Struct(pointer, AbstractMemory, memory); layout = struct_layout(self); @@ -398,7 +394,7 @@ rb_raise(rb_eArgError, "memory of %ld bytes too small for struct %s (expected at least %ld)", memory->size, rb_obj_classname(self), (long) layout->base.ffiType->size); } - + s->pointer = MEMORY(pointer); s->rbPointer = pointer; rb_ivar_set(self, id_pointer_ivar, pointer); @@ -491,7 +487,7 @@ VALUE retval = rb_obj_dup(self); VALUE rbPointer = rb_funcall2(s->rbPointer, rb_intern("order"), argc, argv); struct_set_pointer(retval, rbPointer); - + return retval; } } @@ -527,7 +523,7 @@ inline_array_initialize(VALUE self, VALUE rbMemory, VALUE rbField) { InlineArray* array; - + Data_Get_Struct(self, InlineArray, array); array->rbMemory = rbMemory; array->rbField = rbField; @@ -536,12 +532,12 @@ Data_Get_Struct(rbField, StructField, array->field); Data_Get_Struct(array->field->rbType, ArrayType, array->arrayType); Data_Get_Struct(array->arrayType->rbComponentType, Type, array->componentType); - + array->op = get_memory_op(array->componentType); if (array->op == NULL && array->componentType->nativeType == NATIVE_MAPPED) { array->op = get_memory_op(((MappedType *) array->componentType)->type); } - + array->length = array->arrayType->length; return self; @@ -585,15 +581,15 @@ Data_Get_Struct(self, InlineArray, array); if (array->op != NULL) { - VALUE rbNativeValue = array->op->get(array->memory, + VALUE rbNativeValue = array->op->get(array->memory, inline_array_offset(array, NUM2INT(rbIndex))); if (unlikely(array->componentType->nativeType == NATIVE_MAPPED)) { - return rb_funcall(((MappedType *) array->componentType)->rbConverter, + return rb_funcall(((MappedType *) array->componentType)->rbConverter, rb_intern("from_native"), 2, rbNativeValue, Qnil); } else { - return rbNativeValue; + return rbNativeValue; } - + } else if (array->componentType->nativeType == NATIVE_STRUCT) { VALUE rbOffset = INT2NUM(inline_array_offset(array, NUM2INT(rbIndex))); VALUE rbLength = INT2NUM(array->componentType->ffiType->size); @@ -622,12 +618,12 @@ if (array->op != NULL) { if (unlikely(array->componentType->nativeType == NATIVE_MAPPED)) { - rbValue = rb_funcall(((MappedType *) array->componentType)->rbConverter, + rbValue = rb_funcall(((MappedType *) array->componentType)->rbConverter, rb_intern("to_native"), 2, rbValue, Qnil); } array->op->put(array->memory, inline_array_offset(array, NUM2INT(rbIndex)), rbValue); - + } else if (array->componentType->nativeType == NATIVE_STRUCT) { int offset = inline_array_offset(array, NUM2INT(rbIndex)); Struct* s; @@ -665,11 +661,11 @@ inline_array_each(VALUE self) { InlineArray* array; - + int i; Data_Get_Struct(self, InlineArray, array); - + for (i = 0; i < array->length; ++i) { rb_yield(inline_array_aref(self, INT2FIX(i))); } @@ -692,7 +688,7 @@ Data_Get_Struct(self, InlineArray, array); obj = rb_ary_new2(array->length); - + for (i = 0; i < array->length; ++i) { rb_ary_push(obj, inline_array_aref(self, INT2FIX(i))); } @@ -713,7 +709,7 @@ VALUE argv[2]; Data_Get_Struct(self, InlineArray, array); - + if (array->componentType->nativeType != NATIVE_INT8 && array->componentType->nativeType != NATIVE_UINT8) { VALUE dummy = Qnil; return rb_call_super(0, &dummy); @@ -734,7 +730,7 @@ inline_array_to_ptr(VALUE self) { InlineArray* array; - + Data_Get_Struct(self, InlineArray, array); return rb_funcall(array->rbMemory, rb_intern("slice"), 2, @@ -778,7 +774,7 @@ /* * Document-class: FFI::StructLayout::CharArray < FFI::Struct::InlineArray */ - rbffi_StructLayoutCharArrayClass = rb_define_class_under(rbffi_StructLayoutClass, "CharArray", + rbffi_StructLayoutCharArrayClass = rb_define_class_under(rbffi_StructLayoutClass, "CharArray", rbffi_StructInlineArrayClass); rb_global_variable(&rbffi_StructLayoutCharArrayClass); @@ -787,7 +783,7 @@ rb_define_method(StructClass, "initialize", struct_initialize, -1); rb_define_method(StructClass, "initialize_copy", struct_initialize_copy, 1); rb_define_method(StructClass, "order", struct_order, -1); - + rb_define_alias(rb_singleton_class(StructClass), "alloc_in", "new"); rb_define_alias(rb_singleton_class(StructClass), "alloc_out", "new"); rb_define_alias(rb_singleton_class(StructClass), "alloc_inout", "new"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/ffi_c/Struct.h new/ext/ffi_c/Struct.h --- old/ext/ffi_c/Struct.h 2020-01-14 22:28:04.000000000 +0100 +++ new/ext/ffi_c/Struct.h 2020-02-01 15:02:12.000000000 +0100 @@ -34,11 +34,7 @@ #include "extconf.h" #include "AbstractMemory.h" #include "Type.h" -#ifdef RUBY_1_9 #include <ruby/st.h> -#else -#include <st.h> -#endif #ifdef __cplusplus extern "C" { @@ -73,11 +69,21 @@ int size; int align; ffi_type** ffiTypes; - struct st_table* fieldSymbolTable; + + /* + * We use the fieldName's minor 8 Bits as index to a 256 entry cache. + * This avoids full ruby hash lookups for repeated lookups. + */ + #define FIELD_CACHE_LOOKUP(this, sym) ( &(this)->cache_row[((sym) >> 8) & 0xff] ) + + struct field_cache_entry { + VALUE fieldName; + StructField *field; + } cache_row[0x100]; /** The number of reference tracking fields in this struct */ int referenceFieldCount; - + VALUE rbFieldNames; VALUE rbFieldMap; VALUE rbFields; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/ffi_c/StructLayout.c new/ext/ffi_c/StructLayout.c --- old/ext/ffi_c/StructLayout.c 2020-01-14 22:28:04.000000000 +0100 +++ new/ext/ffi_c/StructLayout.c 2020-02-01 15:02:12.000000000 +0100 @@ -138,7 +138,7 @@ && RTEST(rb_funcall2(rbType, rb_intern("reference_required?"), 0, NULL))); break; } - + return self; } @@ -239,7 +239,7 @@ struct_field_put(VALUE self, VALUE pointer, VALUE value) { StructField* f; - + Data_Get_Struct(self, StructField, f); if (f->memoryOp == NULL) { rb_raise(rb_eArgError, "put not supported for %s", rb_obj_classname(f->rbType)); @@ -261,7 +261,7 @@ function_field_get(VALUE self, VALUE pointer) { StructField* f; - + Data_Get_Struct(self, StructField, f); return rbffi_Function_NewInstance(f->rbType, (*rbffi_AbstractMemoryOps.pointer->get)(MEMORY(pointer), f->offset)); @@ -272,7 +272,7 @@ * @param [AbstractMemory] pointer pointer to a {Struct} * @param [Function, Proc] proc * @return [Function] - * Set a {Function} to memory pointed by +pointer+ as a function. + * Set a {Function} to memory pointed by +pointer+ as a function. * * If a Proc is submitted as +proc+, it is automatically transformed to a {Function}. */ @@ -339,11 +339,11 @@ { StructField* f; ArrayType* array; - + Data_Get_Struct(self, StructField, f); Data_Get_Struct(f->rbType, ArrayType, array); - + if (isCharArray(array) && rb_obj_is_instance_of(value, rb_cString)) { VALUE argv[2]; @@ -419,7 +419,6 @@ layout->rbFieldMap = Qnil; layout->rbFieldNames = Qnil; layout->rbFields = Qnil; - layout->fieldSymbolTable = st_init_numtable(); layout->base.ffiType = xcalloc(1, sizeof(*layout->base.ffiType)); layout->base.ffiType->size = 0; layout->base.ffiType->alignment = 0; @@ -488,7 +487,6 @@ layout->ffiTypes[i] = ftype->size > 0 ? ftype : NULL; - st_insert(layout->fieldSymbolTable, rbName, rbField); rb_hash_aset(layout->rbFieldMap, rbName, rbField); rb_ary_push(layout->rbFields, rbField); rb_ary_push(layout->rbFieldNames, rbName); @@ -501,14 +499,14 @@ return self; } -/* +/* * call-seq: [](field) * @param [Symbol] field * @return [StructLayout::Field] * Get a field from the layout. */ static VALUE -struct_layout_union_bang(VALUE self) +struct_layout_union_bang(VALUE self) { const ffi_type *alignment_types[] = { &ffi_type_sint8, &ffi_type_sint16, &ffi_type_sint32, &ffi_type_sint64, &ffi_type_float, &ffi_type_double, &ffi_type_longdouble, NULL }; @@ -602,6 +600,10 @@ rb_gc_mark(layout->rbFieldMap); rb_gc_mark(layout->rbFieldNames); rb_gc_mark(layout->rbFields); + /* Clear the cache, to be safe from changes of fieldName VALUE by GC.compact. + * TODO: Move cache clearing to compactation callback provided by Ruby-2.7+. + */ + memset(&layout->cache_row, 0, sizeof(layout->cache_row)); } static void @@ -610,7 +612,6 @@ xfree(layout->ffiTypes); xfree(layout->base.ffiType); xfree(layout->fields); - st_free_table(layout->fieldSymbolTable); xfree(layout); } @@ -627,7 +628,7 @@ */ rbffi_StructLayoutClass = rb_define_class_under(moduleFFI, "StructLayout", ffi_Type); rb_global_variable(&rbffi_StructLayoutClass); - + /* * Document-class: FFI::StructLayout::Field * A field in a {StructLayout}. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/ffi_c/extconf.rb new/ext/ffi_c/extconf.rb --- old/ext/ffi_c/extconf.rb 2020-01-14 22:28:04.000000000 +0100 +++ new/ext/ffi_c/extconf.rb 2020-02-01 15:02:12.000000000 +0100 @@ -53,7 +53,6 @@ end $defs << "-DHAVE_EXTCONF_H" if $defs.empty? # needed so create_header works - $defs << "-DRUBY_1_9" if RUBY_VERSION >= "1.9.0" $defs << "-DFFI_BUILDING" if RbConfig::CONFIG['host_os'] =~ /mswin/ # for compatibility with newer libffi create_header diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/ffi_c/libffi/configure new/ext/ffi_c/libffi/configure --- old/ext/ffi_c/libffi/configure 2020-01-14 22:28:04.000000000 +0100 +++ new/ext/ffi_c/libffi/configure 2020-02-01 15:02:12.000000000 +0100 @@ -7174,11 +7174,8 @@ test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -9538,6 +9535,12 @@ lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -13480,7 +13483,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no @@ -13972,7 +13975,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -14037,7 +14040,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -14376,7 +14379,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support @@ -14460,7 +14463,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -14471,7 +14474,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/ffi_c/libffi/install-sh new/ext/ffi_c/libffi/install-sh --- old/ext/ffi_c/libffi/install-sh 2020-01-14 22:28:04.000000000 +0100 +++ new/ext/ffi_c/libffi/install-sh 2020-02-01 15:02:12.000000000 +0100 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2014-09-12.12; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -271,15 +271,18 @@ fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else dstdir=`dirname "$dst"` @@ -288,6 +291,11 @@ fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then @@ -324,14 +332,16 @@ # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) - # $RANDOM is not portable (e.g. dash); use it when possible to - # lower collision chance + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - # As "mkdir -p" follows symlinks and we work in /tmp possibly; so - # create the $tmpdir first (and fail if unsuccessful) to make sure - # that nobody tries to guess the $tmpdir name. + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 @@ -434,8 +444,8 @@ else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 @@ -500,9 +510,9 @@ done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/ffi_c/libffi/ltmain.sh new/ext/ffi_c/libffi/ltmain.sh --- old/ext/ffi_c/libffi/ltmain.sh 2020-01-14 22:28:04.000000000 +0100 +++ new/ext/ffi_c/libffi/ltmain.sh 2020-02-01 15:02:12.000000000 +0100 @@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-2" +VERSION="2.4.6 Debian-2.4.6-11" package_revision=2.4.6 @@ -1370,7 +1370,7 @@ #! /bin/sh # Set a version string for this script. -scriptversion=2014-01-07.03; # UTC +scriptversion=2015-10-07.11; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 @@ -1530,6 +1530,8 @@ { $debug_cmd + _G_rc_run_hooks=false + case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; @@ -1538,16 +1540,16 @@ eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + if eval $_G_hook '"$@"'; then + # store returned options list back into positional + # parameters for next 'cmd' execution. + eval _G_hook_result=\$${_G_hook}_result + eval set dummy "$_G_hook_result"; shift + _G_rc_run_hooks=: + fi done - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result + $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } @@ -1557,10 +1559,16 @@ ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed +# full positional parameter list in your hook function, you may remove/edit +# any options that you action, and then pass back the remaining unprocessed # options in '<hooked_function_name>_result', escaped suitably for -# 'eval'. Like this: +# 'eval'. In this case you also must return $EXIT_SUCCESS to let the +# hook's caller know that it should pay attention to +# '<hooked_function_name>_result'. Returning $EXIT_FAILURE signalizes that +# arguments are left untouched by the hook and therefore caller will ignore the +# result variable. +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1578,11 @@ # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). There is +# # no need to do the equivalent (but slower) action: +# # func_quote_for_eval ${1+"$@"} +# # my_options_prep_result=$func_quote_for_eval_result +# false # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1591,37 @@ # { # $debug_cmd # +# args_changed=false +# # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@", we could need that later +# # if $args_changed is true. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# if $args_changed; then +# func_quote_for_eval ${1+"$@"} +# my_silent_option_result=$func_quote_for_eval_result +# fi +# +# $args_changed # } # func_add_hook func_parse_options my_silent_option # @@ -1611,16 +1633,32 @@ # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result +# false # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + _G_func_options_finish_exit=false + if func_run_hooks func_options ${1+"$@"}; then + func_options_finish_result=$func_run_hooks_result + _G_func_options_finish_exit=: + fi + + $_G_func_options_finish_exit +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1668,28 @@ { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_rc_options=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + if eval func_$my_func '${1+"$@"}'; then + eval _G_res_var='$'"func_${my_func}_result" + eval set dummy "$_G_res_var" ; shift + _G_rc_options=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + # Save modified positional parameters for caller. As a top-level + # options-parser function we always need to set the 'func_options_result' + # variable (regardless the $_G_rc_options value). + if $_G_rc_options; then + func_options_result=$_G_res_var + else + func_quote_for_eval ${1+"$@"} + func_options_result=$func_quote_for_eval_result + fi + + $_G_rc_options } @@ -1649,9 +1698,9 @@ # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete +# needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before -# returning. +# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). func_hookable func_options_prep func_options_prep () { @@ -1661,10 +1710,14 @@ opt_verbose=false opt_warning_types= - func_run_hooks func_options_prep ${1+"$@"} + _G_rc_options_prep=false + if func_run_hooks func_options_prep ${1+"$@"}; then + _G_rc_options_prep=: + # save modified positional parameters for caller + func_options_prep_result=$func_run_hooks_result + fi - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + $_G_rc_options_prep } @@ -1678,18 +1731,20 @@ func_parse_options_result= + _G_rc_parse_options=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. - func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + if func_run_hooks func_parse_options ${1+"$@"}; then + eval set dummy "$func_run_hooks_result"; shift + _G_rc_parse_options=: + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -1704,7 +1759,10 @@ ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_rc_parse_options=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1815,25 @@ shift ;; - --) break ;; + --) _G_rc_parse_options=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + $_G_match_parse_options && _G_rc_parse_options=: done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + + if $_G_rc_parse_options; then + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + func_parse_options_result=$func_quote_for_eval_result + fi + + $_G_rc_parse_options } @@ -1778,16 +1846,21 @@ { $debug_cmd + _G_rc_validate_options=false + # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - func_run_hooks func_validate_options ${1+"$@"} + if func_run_hooks func_validate_options ${1+"$@"}; then + # save modified positional parameters for caller + func_validate_options_result=$func_run_hooks_result + _G_rc_validate_options=: + fi # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result + $_G_rc_validate_options } @@ -2068,7 +2141,7 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion Debian-2.4.6-2 + version: $progname $scriptversion Debian-2.4.6-11 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2270,6 +2343,8 @@ nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2368,18 @@ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote_for_eval ${1+"$@"} + libtool_options_prep_result=$func_quote_for_eval_result + fi + + $_G_rc_lt_options_prep } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2391,12 @@ { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2471,22 @@ func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote_for_eval ${1+"$@"} + libtool_parse_options_result=$func_quote_for_eval_result + fi - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + $_G_rc_lt_parse_options } func_add_hook func_parse_options libtool_parse_options @@ -7275,10 +7367,11 @@ # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*) + -specs=*|-fsanitize=*|-fuse-ld=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/ffi_c/libffi/missing new/ext/ffi_c/libffi/missing --- old/ext/ffi_c/libffi/missing 2020-01-14 22:28:04.000000000 +0100 +++ new/ext/ffi_c/libffi/missing 2020-02-01 15:02:12.000000000 +0100 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/ffi/struct.rb new/lib/ffi/struct.rb --- old/lib/ffi/struct.rb 2020-01-14 22:28:04.000000000 +0100 +++ new/lib/ffi/struct.rb 2020-02-01 15:02:12.000000000 +0100 @@ -190,7 +190,7 @@ # :field2, :pointer, 6, # set offset to 6 for this field # :field3, :string # end - # @example Creating a layout from a hash +spec+ (Ruby 1.9 only) + # @example Creating a layout from a hash +spec+ # class MyStructFromHash < Struct # layout :field1 => :int, # :field2 => :pointer, @@ -202,7 +202,6 @@ # :function2, callback([:pointer], :void), # :field3, :string # end - # @note Creating a layout from a hash +spec+ is supported only for Ruby 1.9. def layout(*spec) warn "[DEPRECATION] Struct layout is already defined for class #{self.inspect}. Redefinition as in #{caller[0]} will be disallowed in ffi-2.0." if defined?(@layout) return @layout if spec.size == 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/ffi/version.rb new/lib/ffi/version.rb --- old/lib/ffi/version.rb 2020-01-14 22:28:04.000000000 +0100 +++ new/lib/ffi/version.rb 2020-02-01 15:02:12.000000000 +0100 @@ -1,3 +1,3 @@ module FFI - VERSION = '1.12.1' + VERSION = '1.12.2' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2020-01-14 22:28:04.000000000 +0100 +++ new/metadata 2020-02-01 15:02:12.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: ffi version: !ruby/object:Gem::Version - version: 1.12.1 + version: 1.12.2 platform: ruby authors: - Wayne Meissner autorequire: bindir: bin cert_chain: [] -date: 2020-01-14 00:00:00.000000000 Z +date: 2020-02-01 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake
