Skip to content

Commit 0406cc8

Browse files
committed
Fix bootstrap under Ubuntu 24.04 or higher
Signed-off-by: falkTX <[email protected]>
1 parent 2cf2bdd commit 0406cc8

6 files changed

+183
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
From 580f46a7bc6e9fea3a2227b5268cc3aed1d60e3b Mon Sep 17 00:00:00 2001
2+
From: Thomas Petazzoni <[email protected]>
3+
Date: Thu, 7 Feb 2013 22:26:56 +0100
4+
Subject: [PATCH] Fix installation location of libffi
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
The libffi is currently declared as toolexeclib_LTLIBRARIES. In many
10+
cases, toolexeclib libraries will be installed in /usr/lib, so it
11+
doesn't make any difference.
12+
13+
However, with multilib toolchains, they get installed in a
14+
subdirectory of /usr/lib/. For example, with a Sourcery CodeBench
15+
PowerPC toolchain, if the e500mc multilib variant is used, the libffi
16+
library gets installed in /usr/lib/te500mc/. This is due to the
17+
following code in the configure script:
18+
19+
multi_os_directory=`$CC -print-multi-os-directory`
20+
case $multi_os_directory in
21+
.) ;; # Avoid trailing /.
22+
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
23+
esac
24+
25+
Once the library is installed in /usr/lib/te500mc/, nothing works
26+
because this installation location is inconsistent with the
27+
installation location declared in libffi.pc.
28+
29+
So, instead of using this bizarre toolexeclib_LTLIBRARIES, simply use
30+
the more standard lib_LTLIBRARIES, which ensures that the libffi
31+
library is always installed in /usr/lib.
32+
33+
Signed-off-by: Thomas Petazzoni <[email protected]>
34+
[unfuzz for 3.2.1]
35+
Signed-off-by: Jörg Krause <[email protected]>
36+
---
37+
Makefile.am | 2 +-
38+
1 file changed, 1 insertion(+), 1 deletion(-)
39+
40+
diff --git a/Makefile.am b/Makefile.am
41+
index 0e40451..309474c 100644
42+
--- a/Makefile.am
43+
+++ b/Makefile.am
44+
@@ -104,7 +104,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
45+
46+
MAKEOVERRIDES=
47+
48+
-toolexeclib_LTLIBRARIES = libffi.la
49+
+lib_LTLIBRARIES = libffi.la
50+
noinst_LTLIBRARIES = libffi_convenience.la
51+
52+
libffi_la_SOURCES = src/prep_cif.c src/types.c \
53+
--
54+
2.5.3
55+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From 31b6b6bc14197cd4183bdbd311fddeb36b5ae100 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?J=C3=B6rg=20Krause?= <[email protected]>
3+
Date: Sat, 19 Sep 2015 22:53:29 +0200
4+
Subject: [PATCH] Fix use of compact eh frames on MIPS
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
Newer MIPS toolchains use a different (compact) eh_frame format.
10+
libffi don't like them, so we have to switch to the older format.
11+
12+
This patch add -mno-compact-eh to CFLAGS when compiling for
13+
Mips and compiler support it.
14+
15+
Signed-off-by: Jérôme Pouiller <[email protected]>
16+
[unfuzz for 3.2.1]
17+
Signed-off-by: Jörg Krause <[email protected]>
18+
---
19+
configure.ac | 10 ++++++++++
20+
1 file changed, 10 insertions(+)
21+
22+
diff --git a/configure.ac b/configure.ac
23+
index a7bf5ee..36cd0d4 100644
24+
--- a/configure.ac
25+
+++ b/configure.ac
26+
@@ -469,6 +469,16 @@ esac
27+
AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
28+
AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
29+
30+
+if test x$TARGET = xMIPS; then
31+
+ save_CFLAGS="$CFLAGS"
32+
+ CFLAGS=-mno-compact-eh
33+
+ AC_MSG_CHECKING([whether the C compiler needs -mno-compact-eh])
34+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
35+
+ [AC_MSG_RESULT([yes])]; [save_CFLAGS="$save_CFLAGS -mno-compact-eh"],
36+
+ [AC_MSG_RESULT([no])])
37+
+ CFLAGS="$save_CFLAGS"
38+
+fi
39+
+
40+
if test x$TARGET = xX86_64; then
41+
AC_CACHE_CHECK([toolchain supports unwind section type],
42+
libffi_cv_as_x86_64_unwind_section_type, [
43+
--
44+
2.5.3
45+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 48bc37fabbc685b1e3293055bd33ca66c619305e Mon Sep 17 00:00:00 2001
2+
From: Vicente Olivert Riera <[email protected]>
3+
Date: Wed, 13 Jan 2016 14:49:59 +0000
4+
Subject: [PATCH] libffi: enable hardfloat in the MIPS assembly code
5+
6+
This way it will be possible to build it for soft-float. This is only a
7+
temporary fix. The package needs to be fixed properly.
8+
9+
Signed-off-by: Vicente Olivert Riera <[email protected]>
10+
[Update for 3.3-rc0]
11+
Signed-off-by: Fabrice Fontaine <[email protected]>
12+
---
13+
src/mips/n32.S | 1 +
14+
src/mips/o32.S | 1 +
15+
2 files changed, 2 insertions(+)
16+
17+
diff --git a/src/mips/n32.S b/src/mips/n32.S
18+
index c6985d3..dc842d5 100644
19+
--- a/src/mips/n32.S
20+
+++ b/src/mips/n32.S
21+
@@ -44,6 +44,7 @@
22+
#endif
23+
#if !defined(__mips_isa_rev) || (__mips_isa_rev<6)
24+
.set mips4
25+
#endif
26+
+ .set hardfloat
27+
.text
28+
.align 2
29+
.globl ffi_call_N32
30+
diff --git a/src/mips/o32.S b/src/mips/o32.S
31+
index eb27981..b653daf 100644
32+
--- a/src/mips/o32.S
33+
+++ b/src/mips/o32.S
34+
@@ -42,6 +42,7 @@
35+
#define RA_OFF (SIZEOF_FRAME - 1 * FFI_SIZEOF_ARG)
36+
37+
.abicalls
38+
+ .set hardfloat
39+
.text
40+
.align 2
41+
.globl ffi_call_O32
42+
--
43+
2.4.10
44+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
config BR2_PACKAGE_LIBFFI
2+
bool "libffi"
3+
depends on BR2_TOOLCHAIN_HAS_THREADS
4+
help
5+
The libffi library provides a portable, high level
6+
programming interface to various calling conventions. This
7+
allows a programmer to call any function specified by a call
8+
interface description at run-time.
9+
10+
http://sourceware.org/libffi/
11+
12+
comment "libffi needs a toolchain w/ threads"
13+
depends on !BR2_TOOLCHAIN_HAS_THREADS
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Locally calculated
2+
sha256 b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e libffi-3.4.6.tar.gz
3+
# License files, locally calculated
4+
sha256 2c9c2acb9743e6b007b91350475308aee44691d96aa20eacef8e199988c8c388 LICENSE
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
################################################################################
2+
#
3+
# libffi
4+
#
5+
################################################################################
6+
7+
LIBFFI_VERSION = 3.4.6
8+
LIBFFI_SITE = \
9+
https://github.com/libffi/libffi/releases/download/v$(LIBFFI_VERSION)
10+
LIBFFI_LICENSE = MIT
11+
LIBFFI_LICENSE_FILES = LICENSE
12+
LIBFFI_CPE_ID_VENDOR = libffi_project
13+
LIBFFI_INSTALL_STAGING = YES
14+
# We're patching Makefile.am
15+
LIBFFI_AUTORECONF = YES
16+
17+
# The static exec trampolines is enabled by default since
18+
# libffi 3.4.2. However it doesn't work with gobject-introspection.
19+
LIBFFI_CONF_OPTS = --disable-exec-static-tramp
20+
21+
$(eval $(autotools-package))
22+
$(eval $(host-autotools-package))

0 commit comments

Comments
 (0)