[DRE-commits] [ruby-ffi] 01/01: Fix ppc64el
Antonio Terceiro
terceiro at moszumanska.debian.org
Wed Aug 27 02:57:07 UTC 2014
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository ruby-ffi.
commit e963c03845fa40c3761940ad9cc4ef620487d2c0
Author: Antonio Terceiro <terceiro at debian.org>
Date: Tue Aug 26 18:05:15 2014 -0700
Fix ppc64el
---
debian/changelog | 10 +++++--
.../fix-for-variadic-float-double-values.diff | 35 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 9af7c41..e99ffb2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
ruby-ffi (1.9.3debian-3) UNRELEASED; urgency=medium
- * debian/tests/control: also run test suite with
- gem2deb-test-runner --autopkgtest
- - needed to add './' to spec file glob in debian/ruby-tests.rb
+ * debian/tests/control: also run test suite with
+ gem2deb-test-runner --autopkgtest
+ - needed to add './' to spec file glob in debian/ruby-tests.rb
+ * Add patch by Anurag Gupta <anurag at linux.vnet.ibm.com> from Ubuntu that
+ fixes call to functions with float/double variadic arguments. This should
+ fix ruby-ffi on ppc64el, _and_ be harmless for other architectures.
+ (debian/patches/fix-for-variadic-float-double-values.diff)
-- Antonio Terceiro <terceiro at debian.org> Sun, 24 Aug 2014 10:40:11 -0300
diff --git a/debian/patches/fix-for-variadic-float-double-values.diff b/debian/patches/fix-for-variadic-float-double-values.diff
new file mode 100644
index 0000000..8b2b955
--- /dev/null
+++ b/debian/patches/fix-for-variadic-float-double-values.diff
@@ -0,0 +1,35 @@
+Description: Fix for failing float/double variadic args test cases in ruby-ffi package
+ This patch will fix the problem of passing float/double values as part of variadic
+ argument list from ruby-ffi package. All the test cases related to float/double arguments
+ passed as part of ruby variadic list were failing on ppc64le arch. Problem was due to
+ incorrect way to call C method ffi_prep_cif_var, where third argument was passed as total
+ number of arguments instead of fixed number of arguments
+Author: Anurag Gupta <anurag at linux.vnet.ibm.com>
+
+---
+
+--- ruby-ffi-1.9.3debian.orig/ext/ffi_c/Variadic.c
++++ ruby-ffi-1.9.3debian/ext/ffi_c/Variadic.c
+@@ -170,7 +170,7 @@ variadic_invoke(VALUE self, VALUE parame
+ ffi_type* ffiReturnType;
+ Type** paramTypes;
+ VALUE* argv;
+- int paramCount = 0, i;
++ int paramCount = 0, fixedCount = 0, i;
+ ffi_status ffiStatus;
+ rbffi_frame_t frame = { 0 };
+
+@@ -229,8 +229,12 @@ variadic_invoke(VALUE self, VALUE parame
+ if (ffiReturnType == NULL) {
+ rb_raise(rb_eArgError, "Invalid return type");
+ }
++
++ /*Get the number of fixed args from @fixed array*/
++ fixedCount = RARRAY_LEN(rb_iv_get(self, "@fixed"));
++
+ #ifdef HAVE_FFI_PREP_CIF_VAR
+- ffiStatus = ffi_prep_cif_var(&cif, invoker->abi, paramCount, paramCount, ffiReturnType, ffiParamTypes);
++ ffiStatus = ffi_prep_cif_var(&cif, invoker->abi, fixedCount, paramCount, ffiReturnType, ffiParamTypes);
+ #else
+ ffiStatus = ffi_prep_cif(&cif, invoker->abi, paramCount, ffiReturnType, ffiParamTypes);
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
index 32a9d9e..8f78806 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
disable-rake-compiler.patch
mip64el.patch
arm64.patch
+fix-for-variadic-float-double-values.diff
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-ffi.git
More information about the Pkg-ruby-extras-commits
mailing list