~ruther/guix-local

ref: 5e63c9bdb1bf7114d742ba4c07596932e0124188 guix-local/gnu/packages/patches/reduce-unbundle-libffi.patch -rw-r--r-- 3.8 KiB
5e63c9bd — Ashish SHUKLA gnu: hetzner: Fix deploy on hetzner 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
This patch unbundles libffi.

Index: autogen.sh
===================================================================
diff --git a/autogen.sh b/autogen.sh
--- a/autogen.sh	(revision 6860)
+++ b/autogen.sh	(working copy)
@@ -142,18 +142,6 @@
   ;;
 *--with-csl* | *--with-both*)
   L="$L ./csl ./csl/cslbase ./csl/cslbase-nothrow ./libraries/SoftFloat-3a/source"
-# On Apple m1 (ie arm64) I will want to build a universal version of the
-# libffi library and that is done in a way that differs from standrad builds.
-  case "`uname -s` `uname -m`" in
-  *Darwin*arm64*)
-    L="$L ./libraries/libffi-for-mac/libffi-3.3-arm64"
-    L="$L ./libraries/libffi-for-mac/libffi-3.3-x86_64"
-    L="$L ./libraries/libffi"
-    ;;
-  *)
-    L="$L ./libraries/libffi"
-    ;;
-  esac
   case $a in
   *--without-fox* | *with-fox=no* | \
   *--without-gui* | *with-gui=no*)
Index: configure.ac
===================================================================
diff --git a/configure.ac b/configure.ac
--- a/configure.ac	(revision 6860)
+++ b/configure.ac	(working copy)
@@ -1389,37 +1389,6 @@
   cd "$builddir"
 fi
 
-AC_MSG_NOTICE([About to configure libffi])
-mkdir -p libffi
-if test `uname` = "Darwin" && test "$enable_universal" != "no"
-then
-# This is a messy script that arranges to build a universal version of
-# the library on MacOS. It does this by building arm64 and an x86_64
-# separately and then merging the resulting libraries.
-  sed "s+@srcdir@+$abssrcdir+" \
-     < $abssrcdir/libraries/libffi-for-mac/Makefile \
-     > libffi/Makefile
-else
-  cd libffi
-  setpasscc
-  doconfig="$SHELL $abssrcdir/libraries/libffi/configure -C $filtered \
-          $pass_host \
-          CPPFLAGS=\"$CPPFLAGS\" \
-          CFLAGS=\"$CFLAGS\" \
-          CXXFLAGS=\"$CXXFLAGS\" \
-          LDFLAGS=\"$LDFLAGS\" \
-          $passcc \
-          --disable-multi-os-directory \
-          --disable-docs \
-          --prefix=\"$builddir\" \
-          --libdir=\"$builddir/lib\" \
-          --includedir=\"$builddir/include\""
-  AC_MSG_NOTICE([doconfig = $doconfig])
-  printf "\n\n+++ About to configure libffi +++\n\n"
-  eval "$doconfig"
-  cd "$builddir"
-fi
-
 AC_MSG_NOTICE([About to configure libsoftfloat])
 mkdir -p softfloat
 cd softfloat
Index: csl/cslbase/Makefile.am
===================================================================
diff --git a/csl/cslbase/Makefile.am b/csl/cslbase/Makefile.am
--- a/csl/cslbase/Makefile.am	(revision 6860)
+++ b/csl/cslbase/Makefile.am	(working copy)
@@ -807,35 +807,6 @@
 
 endif !crlibm
 
-LIBFFIDEPS=../lib/libffi.a ../include/ffi.h
-
-FFIDEP = ../include/ffi.h
-FFIINC = -I../include
-AM_CPPFLAGS     += $(FFINC)
-reduce_CPPFLAGS += $(FFINC)
-bootstrapreduce_CPPFLAGS += $(FFINC)
-csl_CPPFLAGS    += $(FFINC)
-flatcsl_CPPFLAGS    += $(FFINC)
-
-# The following ugly dependencies are here so that one can go, for
-# instance, "make csl.o" in a clean tree and libffi building will get
-# triggered.
-
-
-csl_LDADD += ../lib/libffi.a
-flatcsl_LDADD += ../lib/libffi.a
-bootstrapreduce_LDADD += ../lib/libffi.a
-reduce_LDADD += ../lib/libffi.a
-
-csl_DEPENDENCIES += $(LIBFFIDEPS)
-flatcsl_DEPENDENCIES += $(LIBFFIDEPS)
-bootstrapreduce_DEPENDENCIES += $(LIBFFIDEPS)
-reduce_DEPENDENCIES += $(LIBFFIDEPS)
-
-$(LIBFFIDEPS):
-	@printf "About to build libffi for %s ($@)\n" `pwd`
-	-$(TRACE)@$(MAKE) -C ../libffi install
-
 SOFTFLOATDEPS=../lib/libsoftfloat.a ../include/softfloat.h
 
 SOFTFLOATDEP = ../include/softfloat.h
Index: csl/cslbase/configure.ac
===================================================================
diff --git a/csl/cslbase/configure.ac b/csl/cslbase/configure.ac
--- a/csl/cslbase/configure.ac	(revision 6860)
+++ b/csl/cslbase/configure.ac	(working copy)
@@ -146,8 +146,8 @@
   AC_DEFINE(WITHOUT_FFI, [1], [remove the foreign function support])
 fi
 
+AC_SEARCH_LIBS([ffi_call], [ffi])
 
-
 # What host am I on?
 AC_CANONICAL_HOST()