commit:     150f49cdb500318a543afebda095b3127fdc7f95
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  1 19:28:34 2019 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Oct  1 19:29:09 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=150f49cd

dev-libs/libffi-compat: new package, provides libffi.so.6

There are still a few binary-only packages out there that rely on
'libffi.so.6' presence. This package provides these libraries.
No development headers here. Thus this library can co-exist with
dev-libs/libffi:0/7 package.

Ebuild is based on dev-libs/libffi. We can fast-stabilize it if
in-tree stable packages do rely on libffi.so.6 (they should not).

The patch is almost entirely by Timo Rothenpieler.
I renamed a package and made a few minor tweaks.

Fix-by: Timo Rothenpieler
Reported-by: Timo Rothenpieler
Closes: https://bugs.gentoo.org/695964
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-libs/libffi-compat/Manifest                    |  1 +
 .../files/libffi-3.1-darwin-x32.patch              | 22 +++++++
 .../files/libffi-3.2.1-complex-ia64.patch          | 41 ++++++++++++
 .../files/libffi-3.2.1-complex_alpha.patch         | 20 ++++++
 .../files/libffi-3.2.1-ia64-small-struct.patch     | 74 ++++++++++++++++++++++
 .../files/libffi-3.2.1-include-path-autogen.patch  | 56 ++++++++++++++++
 .../files/libffi-3.2.1-include-path.patch          | 39 ++++++++++++
 .../files/libffi-3.2.1-musl-emutramp.patch         | 31 +++++++++
 .../files/libffi-3.2.1-o-tmpfile-eacces.patch      | 17 +++++
 .../libffi-compat/libffi-compat-3.2.1-r3.ebuild    | 52 +++++++++++++++
 dev-libs/libffi-compat/metadata.xml                | 42 ++++++++++++
 11 files changed, 395 insertions(+)

diff --git a/dev-libs/libffi-compat/Manifest b/dev-libs/libffi-compat/Manifest
new file mode 100644
index 00000000000..f77899f0229
--- /dev/null
+++ b/dev-libs/libffi-compat/Manifest
@@ -0,0 +1 @@
+DIST libffi-3.2.1.tar.gz 940837 BLAKE2B 
d202ccaa185acfd2476ed2a9b011891507cd8efbbda60f67c583268d1563853442ed829acecbf81c9b6b9a930345780bb7a4bd80e71e50ef544c7f4eab8cb01f
 SHA512 
980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a293440573f4294207e1bdd9fda80ad1e1cafb2ffb543df5a275bc3bd546483

diff --git a/dev-libs/libffi-compat/files/libffi-3.1-darwin-x32.patch 
b/dev-libs/libffi-compat/files/libffi-3.1-darwin-x32.patch
new file mode 100644
index 00000000000..e5f100e5672
--- /dev/null
+++ b/dev-libs/libffi-compat/files/libffi-3.1-darwin-x32.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/show_bug.cgi?id=513428
+https://bugs.gentoo.org/show_bug.cgi?id=536764
+https://trac.macports.org/ticket/44170
+
+--- libffi-3.2.1/src/x86/win32.S
++++ libffi-3.2.1/src/x86/win32.S
+@@ -1184,7 +1184,6 @@
+ 
+ #if defined(X86_WIN32) && !defined(__OS2__)
+         .section      .eh_frame,"w"
+-#endif
+ .Lframe1:
+ .LSCIE1:
+         .long .LECIE1-.LASCIE1  /* Length of Common Information Entry */
+@@ -1343,6 +1342,7 @@
+         /* End of DW_CFA_xxx CFI instructions.  */
+         .align 4
+ .LEFDE5:
++#endif /* defined(X86_WIN32) && !defined(__OS2__), for the eh_frame */
+ 
+ #endif /* !_MSC_VER */
+ 

diff --git a/dev-libs/libffi-compat/files/libffi-3.2.1-complex-ia64.patch 
b/dev-libs/libffi-compat/files/libffi-3.2.1-complex-ia64.patch
new file mode 100644
index 00000000000..fd5c1ea4b28
--- /dev/null
+++ b/dev-libs/libffi-compat/files/libffi-3.2.1-complex-ia64.patch
@@ -0,0 +1,41 @@
+ia64: fix small struct handling (missing complex type entry)
+
+commit 6e8a4460833594d5af1b4539178025da0077df19
+added FFI_TYPE_COMPLEX value type (comes after FFI_TYPE_POINTER)
+
+ia64 ffi_closure_unix reiles on the ordering of
+types as ia64 has ia64-specific FFI types:
+small struct and others.
+
+As a result all tests handling small structs broke.
+
+The change fixes dispatch table by ignoring FFI_TYPE_COMPLEX.
+This has positive effect of unbreaking most tests:
+
+                 === libffi Summary ===
+ 
+-# of expected passes            1595
+-# of unexpected failures        295
++# of expected passes            1930
++# of unexpected failures        10
+ # of unsupported tests          30
+
+Bug: https://bugs.gentoo.org/634190
+--- a/src/ia64/unix.S
++++ b/src/ia64/unix.S
+@@ -529,6 +529,7 @@ ffi_closure_unix:
+       data8   @pcrel(.Lst_int64)              // FFI_TYPE_SINT64
+       data8   @pcrel(.Lst_void)               // FFI_TYPE_STRUCT
+       data8   @pcrel(.Lst_int64)              // FFI_TYPE_POINTER
++      data8   @pcrel(.Lst_void)               // FFI_TYPE_COMPLEX (not 
implemented)
+       data8   @pcrel(.Lst_small_struct)       // FFI_IA64_TYPE_SMALL_STRUCT
+       data8   @pcrel(.Lst_hfa_float)          // FFI_IA64_TYPE_HFA_FLOAT
+       data8   @pcrel(.Lst_hfa_double)         // FFI_IA64_TYPE_HFA_DOUBLE
+@@ -550,6 +551,7 @@ ffi_closure_unix:
+       data8   @pcrel(.Lld_int)                // FFI_TYPE_SINT64
+       data8   @pcrel(.Lld_void)               // FFI_TYPE_STRUCT
+       data8   @pcrel(.Lld_int)                // FFI_TYPE_POINTER
++      data8   @pcrel(.Lld_void)               // FFI_TYPE_COMPLEX (not 
implemented)
+       data8   @pcrel(.Lld_small_struct)       // FFI_IA64_TYPE_SMALL_STRUCT
+       data8   @pcrel(.Lld_hfa_float)          // FFI_IA64_TYPE_HFA_FLOAT
+       data8   @pcrel(.Lld_hfa_double)         // FFI_IA64_TYPE_HFA_DOUBLE

diff --git a/dev-libs/libffi-compat/files/libffi-3.2.1-complex_alpha.patch 
b/dev-libs/libffi-compat/files/libffi-3.2.1-complex_alpha.patch
new file mode 100644
index 00000000000..5e8c943eee3
--- /dev/null
+++ b/dev-libs/libffi-compat/files/libffi-3.2.1-complex_alpha.patch
@@ -0,0 +1,20 @@
+--- a/src/alpha/osf.S.orig     2015-01-16 10:46:15.000000000 +0100
++++ b/src/alpha/osf.S  2015-01-16 10:46:24.000000000 +0100
+@@ -279,6 +279,7 @@
+       .gprel32 $load_64       # FFI_TYPE_SINT64
+       .gprel32 $load_none     # FFI_TYPE_STRUCT
+       .gprel32 $load_64       # FFI_TYPE_POINTER
++      .gprel32 $load_none     # FFI_TYPE_COMPLEX
+ 
+ /* Assert that the table above is in sync with ffi.h.  */
+ 
+@@ -294,7 +295,8 @@
+       || FFI_TYPE_SINT64 != 12        \
+       || FFI_TYPE_STRUCT != 13        \
+       || FFI_TYPE_POINTER != 14       \
+-      || FFI_TYPE_LAST != 14
++      || FFI_TYPE_COMPLEX != 15       \
++      || FFI_TYPE_LAST != 15
+ #error "osf.S out of sync with ffi.h"
+ #endif
+ 

diff --git a/dev-libs/libffi-compat/files/libffi-3.2.1-ia64-small-struct.patch 
b/dev-libs/libffi-compat/files/libffi-3.2.1-ia64-small-struct.patch
new file mode 100644
index 00000000000..6e21f3566bc
--- /dev/null
+++ b/dev-libs/libffi-compat/files/libffi-3.2.1-ia64-small-struct.patch
@@ -0,0 +1,74 @@
+From b58caef7fd620408be9239ac24ea89d5bc84f30b Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <sly...@gentoo.org>
+Date: Sat, 17 Feb 2018 19:00:40 +0000
+Subject: [PATCH 2/2] ia64: fix small struct return
+
+This change fixes libffi.call/struct10.c failure on ia64:
+FAIL: libffi.call/struct10.c -W -Wall -Wno-psabi -O0 execution test
+
+.Lst_small_struct handles returns for structs less than 32 bytes
+(following ia64 return value ABI [1]). Subroutine does roughly the
+following:
+
+```
+    mov [sp+0]  = r8
+    mov [sp+8]  = r9
+    mov [sp+16] = r10
+    mov [sp+24] = r11
+    memcpy(destination, source=sp, 12);
+```
+
+The problem: ia64 ABI guarantees that top 16 bytes of stack are
+scratch space for callee function. Thus it can clobber it. [1]
+says (7.1 Procedure Frames):
+"""
+* Scratch area. This 16-byte region is provided as scratch storage
+  for procedures that are called by the current procedure. Leaf
+  procedures do not need to allocate this region. A procedure may
+  use the 16 bytes at the top of its own frame as scratch memory,
+  but the contents of this area are not preserved by a procedure call.
+"""
+
+In our case 16 top bytes are clobbered by a PLT resolver when memcpy()
+is called for the first time. As a result memcpy implementation reads
+already clobbered data frop top of stack.
+
+The fix is simple: allocate 16 bytes of scrats space prior to memcpy()
+call.
+
+[1]: 
https://www.intel.com/content/dam/www/public/us/en/documents/guides/itanium-software-runtime-architecture-guide.pdf
+
+Bug: https://bugs.gentoo.org/634190
+Signed-off-by: Sergei Trofimovich <sly...@gentoo.org>
+---
+ src/ia64/unix.S | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/src/ia64/unix.S b/src/ia64/unix.S
+index 4733377..e2547e0 100644
+--- a/src/ia64/unix.S
++++ b/src/ia64/unix.S
+@@ -175,7 +175,6 @@ ffi_call_unix:
+       ;;
+ 
+ .Lst_small_struct:
+-      add     sp = -16, sp
+       cmp.lt  p6, p0 = 8, in3
+       cmp.lt  p7, p0 = 16, in3
+       cmp.lt  p8, p0 = 24, in3
+@@ -191,6 +190,12 @@ ffi_call_unix:
+ (p8)  st8     [r18] = r11
+       mov     out1 = sp
+       mov     out2 = in3
++      ;;
++      // ia64 software calling convention requires
++      // top 16 bytes of stack to be scratch space
++      // PLT resolver uses that scratch space at
++      // 'memcpy' symbol reolution time
++      add     sp = -16, sp
+       br.call.sptk.many b0 = memcpy#
+       ;;
+       mov     ar.pfs = loc0
+-- 
+2.16.1
+

diff --git 
a/dev-libs/libffi-compat/files/libffi-3.2.1-include-path-autogen.patch 
b/dev-libs/libffi-compat/files/libffi-3.2.1-include-path-autogen.patch
new file mode 100644
index 00000000000..522e1fa9c48
--- /dev/null
+++ b/dev-libs/libffi-compat/files/libffi-3.2.1-include-path-autogen.patch
@@ -0,0 +1,56 @@
+Autogenerated part of libffi-3.2.1-include-path.patch
+
+https://bugs.gentoo.org/643582
+diff --git a/include/Makefile.in b/include/Makefile.in
+index 9d747e8..99ecfd7 100644
+--- a/include/Makefile.in
++++ b/include/Makefile.in
+@@ -152,2 +152,2 @@ am__uninstall_files_from_dir = { \
+-am__installdirs = "$(DESTDIR)$(includesdir)"
+-HEADERS = $(nodist_includes_HEADERS)
++am__installdirs = "$(DESTDIR)$(includedir)"
++HEADERS = $(nodist_include_HEADERS)
+@@ -317,2 +317 @@ EXTRA_DIST = ffi.h.in ffi_common.h
+-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+-nodist_includes_HEADERS = ffi.h ffitarget.h
++nodist_include_HEADERS = ffi.h ffitarget.h
+@@ -360 +359 @@ clean-libtool:
+-install-nodist_includesHEADERS: $(nodist_includes_HEADERS)
++install-nodist_includeHEADERS: $(nodist_include_HEADERS)
+@@ -362 +361 @@ install-nodist_includesHEADERS: $(nodist_includes_HEADERS)
+-      @list='$(nodist_includes_HEADERS)'; test -n "$(includesdir)" || list=; \
++      @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+@@ -364,2 +363,2 @@ install-nodist_includesHEADERS: $(nodist_includes_HEADERS)
+-        echo " $(MKDIR_P) '$(DESTDIR)$(includesdir)'"; \
+-        $(MKDIR_P) "$(DESTDIR)$(includesdir)" || exit 1; \
++        echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
++        $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+@@ -372,2 +371,2 @@ install-nodist_includesHEADERS: $(nodist_includes_HEADERS)
+-        echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
+-        $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
++        echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
++        $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+@@ -376 +375 @@ install-nodist_includesHEADERS: $(nodist_includes_HEADERS)
+-uninstall-nodist_includesHEADERS:
++uninstall-nodist_includeHEADERS:
+@@ -378 +377 @@ uninstall-nodist_includesHEADERS:
+-      @list='$(nodist_includes_HEADERS)'; test -n "$(includesdir)" || list=; \
++      @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
+@@ -380 +379 @@ uninstall-nodist_includesHEADERS:
+-      dir='$(DESTDIR)$(includesdir)'; $(am__uninstall_files_from_dir)
++      dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+@@ -468 +467 @@ installdirs:
+-      for dir in "$(DESTDIR)$(includesdir)"; do \
++      for dir in "$(DESTDIR)$(includedir)"; do \
+@@ -522 +521 @@ info-am:
+-install-data-am: install-nodist_includesHEADERS
++install-data-am: install-nodist_includeHEADERS
+@@ -566 +565 @@ ps-am:
+-uninstall-am: uninstall-nodist_includesHEADERS
++uninstall-am: uninstall-nodist_includeHEADERS
+@@ -577 +576 @@ uninstall-am: uninstall-nodist_includesHEADERS
+-      install-nodist_includesHEADERS install-pdf install-pdf-am \
++      install-nodist_includeHEADERS install-pdf install-pdf-am \
+@@ -582 +581 @@ uninstall-am: uninstall-nodist_includesHEADERS
+-      uninstall-am uninstall-nodist_includesHEADERS
++      uninstall-am uninstall-nodist_includeHEADERS

diff --git a/dev-libs/libffi-compat/files/libffi-3.2.1-include-path.patch 
b/dev-libs/libffi-compat/files/libffi-3.2.1-include-path.patch
new file mode 100644
index 00000000000..e1269b2398a
--- /dev/null
+++ b/dev-libs/libffi-compat/files/libffi-3.2.1-include-path.patch
@@ -0,0 +1,39 @@
+https://bugs.gentoo.org/643582
+
+From 982b89c01aca99c7bc229914fc1521f96930919b Mon Sep 17 00:00:00 2001
+From: Yen Chi Hsuan <yan12...@gmail.com>
+Date: Sun, 13 Nov 2016 19:17:19 +0800
+Subject: [PATCH] Install public headers in the standard path
+
+---
+ include/Makefile.am | 3 +--
+ libffi.pc.in        | 2 +-
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/include/Makefile.am b/include/Makefile.am
+index bb241e8..c59df9f 100644
+--- a/include/Makefile.am
++++ b/include/Makefile.am
+@@ -6,5 +6,4 @@ DISTCLEANFILES=ffitarget.h
+ noinst_HEADERS=ffi_common.h ffi_cfi.h
+ EXTRA_DIST=ffi.h.in
+ 
+-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+-nodist_includes_HEADERS = ffi.h ffitarget.h
++nodist_include_HEADERS = ffi.h ffitarget.h
+diff --git a/libffi.pc.in b/libffi.pc.in
+index edf6fde..6fad83b 100644
+--- a/libffi.pc.in
++++ b/libffi.pc.in
+@@ -2,7 +2,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+ toolexeclibdir=@toolexeclibdir@
+-includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
++includedir=@includedir@
+ 
+ Name: @PACKAGE_NAME@
+ Description: Library supporting Foreign Function Interfaces
+-- 
+2.15.1
+

diff --git a/dev-libs/libffi-compat/files/libffi-3.2.1-musl-emutramp.patch 
b/dev-libs/libffi-compat/files/libffi-3.2.1-musl-emutramp.patch
new file mode 100644
index 00000000000..7c011d2b6d0
--- /dev/null
+++ b/dev-libs/libffi-compat/files/libffi-3.2.1-musl-emutramp.patch
@@ -0,0 +1,31 @@
+https://github.com/libffi/libffi/commit/e169ba2b83c780058fe626856cfdb5903a85cb97.patch
+https://bugs.gentoo.org/694916
+
+From e169ba2b83c780058fe626856cfdb5903a85cb97 Mon Sep 17 00:00:00 2001
+From: Kylie McClain <soma...@exherbo.org>
+Date: Fri, 29 Apr 2016 21:04:07 -0400
+Subject: [PATCH] Fix usage on musl libc
+
+A gcc compiled on musl does not define __gnu_linux__, it defines __linux__.
+Only on glibc does __gnu_linux__ get defined, but both define __linux__, so
+we should check for that instead.
+
+With this patch, libffi works perfectly, and passes its testsuite entirely
+on musl libc systems.
+---
+ src/closures.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/closures.c b/src/closures.c
+index 3dec0e31..05849e06 100644
+--- a/src/closures.c
++++ b/src/closures.c
+@@ -35,7 +35,7 @@
+ #include <ffi_common.h>
+ 
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it

diff --git a/dev-libs/libffi-compat/files/libffi-3.2.1-o-tmpfile-eacces.patch 
b/dev-libs/libffi-compat/files/libffi-3.2.1-o-tmpfile-eacces.patch
new file mode 100644
index 00000000000..92a733cbe82
--- /dev/null
+++ b/dev-libs/libffi-compat/files/libffi-3.2.1-o-tmpfile-eacces.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/529044
+
+deploy this workaround until newer versions of the kernel/C library/libsandbox
+are rolled out into general circulation
+
+--- a/src/closures.c
++++ b/src/closures.c
+@@ -301,7 +301,8 @@ open_temp_exec_file_dir (const char *dir)
+ #ifdef O_TMPFILE
+   fd = open (dir, flags | O_RDWR | O_EXCL | O_TMPFILE, 0700);
+   /* If the running system does not support the O_TMPFILE flag then retry 
without it. */
+-  if (fd != -1 || (errno != EINVAL && errno != EISDIR && errno != 
EOPNOTSUPP)) {
++  if (fd != -1 || (errno != EINVAL && errno != EISDIR && errno != EOPNOTSUPP 
&&
++                 errno != EACCES)) {
+     return fd;
+   } else {
+     errno = 0;

diff --git a/dev-libs/libffi-compat/libffi-compat-3.2.1-r3.ebuild 
b/dev-libs/libffi-compat/libffi-compat-3.2.1-r3.ebuild
new file mode 100644
index 00000000000..f8eebf3461e
--- /dev/null
+++ b/dev-libs/libffi-compat/libffi-compat-3.2.1-r3.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit eutils libtool multilib multilib-minimal toolchain-funcs
+
+DESCRIPTION="a portable, high level programming interface to various calling 
conventions"
+HOMEPAGE="https://sourceware.org/libffi/";
+SRC_URI="ftp://sourceware.org/pub/libffi/libffi-${PV}.tar.gz";
+
+LICENSE="MIT"
+SLOT="6" # libffi.so.6
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 
~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux 
~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris 
~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug pax_kernel test"
+
+RDEPEND="!dev-libs/libffi:0/0" # conflicts on libffi.so.6
+DEPEND="test? ( dev-util/dejagnu )"
+
+DOCS="ChangeLog* README"
+
+PATCHES=(
+       "${FILESDIR}"/libffi-3.2.1-o-tmpfile-eacces.patch #529044
+       "${FILESDIR}"/libffi-3.2.1-complex_alpha.patch
+       "${FILESDIR}"/libffi-3.1-darwin-x32.patch
+       "${FILESDIR}"/libffi-3.2.1-complex-ia64.patch
+       "${FILESDIR}"/libffi-3.2.1-include-path.patch
+       "${FILESDIR}"/libffi-3.2.1-include-path-autogen.patch
+       "${FILESDIR}"/libffi-3.2.1-ia64-small-struct.patch #634190
+       "${FILESDIR}"/libffi-3.2.1-musl-emutramp.patch #694916
+)
+
+S=${WORKDIR}/libffi-${PV}
+ECONF_SOURCE=${S}
+
+src_prepare() {
+       default
+
+       sed -i -e 's:@toolexeclibdir@:$(libdir):g' Makefile.in || die #462814
+       elibtoolize
+}
+
+multilib_src_configure() {
+       use userland_BSD && export HOST="${CHOST}"
+       econf \
+               --disable-static \
+               $(use_enable pax_kernel pax_emutramp) \
+               $(use_enable debug)
+}
+
+multilib_src_install() {
+       dolib.so .libs/libffi.so.${SLOT}*
+}

diff --git a/dev-libs/libffi-compat/metadata.xml 
b/dev-libs/libffi-compat/metadata.xml
new file mode 100644
index 00000000000..6e9a28c5ac8
--- /dev/null
+++ b/dev-libs/libffi-compat/metadata.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>toolch...@gentoo.org</email>
+               <name>Gentoo Toolchain Project</name>
+       </maintainer>
+       <longdescription lang="en">
+               Compilers for high level languages generate code that follow 
certain
+               conventions. These conventions are necessary, in part, for 
separate
+               compilation to work. One such convention is the "calling
+               convention". The "calling convention" is essentially a set of
+               assumptions made by the compiler about where function arguments 
will
+               be found on entry to a function. A "calling convention" also 
specifies
+               where the return value for a function is found.
+
+               Some programs may not know at the time of compilation what 
arguments
+               are to be passed to a function. For instance, an interpreter 
may be
+               told at run-time about the number and types of arguments used 
to call
+               a given function. Libffi can be used in such programs to 
provide a
+               bridge from the interpreter program to compiled code.
+
+               The libffi library provides a portable, high level programming
+               interface to various calling conventions. This allows a 
programmer to
+               call any function specified by a call interface description at 
run
+               time.
+
+               Ffi stands for Foreign Function Interface. A foreign function
+               interface is the popular name for the interface that allows code
+               written in one language to call code written in another 
language. The
+               libffi library really only provides the lowest, machine 
dependent
+               layer of a fully featured foreign function interface. A layer 
must
+               exist above libffi that handles type conversions for values 
passed
+               between the two languages.
+       </longdescription>
+       <use>
+               <flag name="pax_kernel">Use PaX emulated trampolines, for we 
can't use PROT_EXEC</flag>
+       </use>
+       <upstream>
+               <remote-id type="cpe">cpe:/a:libffi_project:libffi</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to