[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#480208: libffi-dev: amd64 headers inconsistent with actual binaries



Package: libffi-dev
Version: 3.0.5-1.0
Severity: critical
Justification: causes serious data loss

Because all the builds (native and bi-/tri-arch) install headers into
/usr/include, /usr/include/ffi.h may wind up failing to correspond to
the actual architecture of interest.  In particular, on amd64,
/usr/include/ffi.h winds up #define-ing X86 rather than the correct
X86_64, breaking anything that builds against it.  (ctypes catches the
problem thanks to its test suite, but other reverse dependencies will
require binNMUs.)

The best way to fix this problem would arguably be to arrange for the
non-native versions of ffi.h to wind up in
/usr/include/$(host_triplet); however, that approach turns out to be
somewhat cumbersome, particularly given that the top-level makefile
neglects to propagate includedir or includesdir. :-/

Alternatively, it suffices to edit src/x86/ffitarget.h to honor
__x86_64__ unconditionally, either by flipping the target
specification (as it already does for the combination of X86_64 and
__i386__) or by deconditionalizing the existing check for __x86_64__
further down:

--- libffi-3.0.5.orig/src/x86/ffitarget.h
+++ libffi-3.0.5/src/x86/ffitarget.h
@@ -74,7 +74,7 @@
 #define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)
 #define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)
 
-#if defined (X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
+#if defined (X86_64) || (defined (__x86_64__) /* && defined (X86_DARWIN) */)
 #define FFI_TRAMPOLINE_SIZE 24
 #define FFI_NATIVE_RAW_API 0
 #else

In principle, this issue could also affect other architectures, but
AFAICT configure doesn't actually set different target names for any
of them at present.

(You could also simply install the native build last rather than
first, but that would break builds for amd64 on i386 in the same
fashion that native amd64 builds currently break unless you also fix
ffitarget.h as described above.)

At any rate, could you please fix the bug and (once a fixed build has
hit the archive) request binNMUs for libffi5's reverse dependencies on
amd64?

Thanks!

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25.0 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages libffi-dev depends on:
ii  libffi5                       3.0.5-1.0  Foreign Function Interface library

libffi-dev recommends no packages.

-- no debconf information



Reply to: