From d08592d323e254faacd13a13db69638b4c6bd074 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 21 Sep 2014 19:21:10 +0200 Subject: [PATCH] libffi: gcc2 fix. * gcc2 does not support __builtin_expect, and ends up defining a reference to it. #define it to a no-op instead so things actually work. --- dev-libs/libffi/libffi-3.0.13.recipe | 10 +++++---- .../libffi/patches/libffi-3.0.13.patchset | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 dev-libs/libffi/patches/libffi-3.0.13.patchset diff --git a/dev-libs/libffi/libffi-3.0.13.recipe b/dev-libs/libffi/libffi-3.0.13.recipe index 70a9c5b17..811077300 100644 --- a/dev-libs/libffi/libffi-3.0.13.recipe +++ b/dev-libs/libffi/libffi-3.0.13.recipe @@ -3,15 +3,17 @@ DESCRIPTION=" A portable, high level programming interface to various calling conventions. " HOMEPAGE="http://sourceware.org/libffi" -SRC_URI="ftp://sourceware.org/pub/libffi/libffi-3.0.13.tar.gz" -CHECKSUM_SHA256="1dddde1400c3bcb7749d398071af88c3e4754058d2d4c0b3696c2f82dc5cf11c" -COPYRIGHT="1996-2013 Anthony Green, Red Hat, Inc and others." LICENSE="MIT" -REVISION="1" +REVISION="2" ARCHITECTURES="x86_gcc2 x86 x86_64" SECONDARY_ARCHITECTURES="x86_gcc2 x86" +SRC_URI="ftp://sourceware.org/pub/libffi/libffi-3.0.13.tar.gz" +CHECKSUM_SHA256="1dddde1400c3bcb7749d398071af88c3e4754058d2d4c0b3696c2f82dc5cf11c" +COPYRIGHT="1996-2013 Anthony Green, Red Hat, Inc and others." +PATCHES="libffi-$portVersion.patchset" + PROVIDES=" libffi$secondaryArchSuffix = $portVersion compat >= 3 lib:libffi$secondaryArchSuffix = 6.0.1 compat >= 6 diff --git a/dev-libs/libffi/patches/libffi-3.0.13.patchset b/dev-libs/libffi/patches/libffi-3.0.13.patchset new file mode 100644 index 000000000..406538986 --- /dev/null +++ b/dev-libs/libffi/patches/libffi-3.0.13.patchset @@ -0,0 +1,22 @@ +From 7346bc44a1d1f47b38d556b0cc291fc948725042 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 21 Sep 2014 18:59:06 +0200 +Subject: gcc2 fix. + + +diff --git a/include/ffi_common.h b/include/ffi_common.h +index 650ca69..02a1913 100644 +--- a/include/ffi_common.h ++++ b/include/ffi_common.h +@@ -115,7 +115,7 @@ typedef signed int SINT64 __attribute__((__mode__(__DI__))); + + typedef float FLOAT32; + +-#ifndef __GNUC__ ++#if !defined(__GNUC__) || __GNUC__ < 3 + #define __builtin_expect(x, expected_value) (x) + #endif + #define LIKELY(x) __builtin_expect(!!(x),1) +-- +1.8.3.4 +