summary refs log tree commit diff
path: root/pkgs/development/libraries/libffi
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2022-06-02 11:27:18 +0100
committerSergei Trofimovich <slyich@gmail.com>2022-06-02 22:44:25 +0100
commit55886c3946b443fe23b3d1a17c1047d4e8f4a365 (patch)
tree323f2d130aa781311e73c34b2f0179e993ddc7fe /pkgs/development/libraries/libffi
parent1bd8058f666ca753e052846f6f553561f40b2664 (diff)
pkgsCross.ppc64.libffi: pull upstream patch to support gcc-12
Without the change `libffi` fails to build against `gcc-12` as:

    libtool: compile:  powerpc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude \
        -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -Wall -fexceptions -c ../src/tramp.c \
        -fPIC -DPIC -o src/.libs/tramp.o
    ../src/powerpc/linux64_closure.S: Assembler messages:
    ../src/powerpc/linux64_closure.S:363: Error: unrecognized opcode: `lvx'

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'pkgs/development/libraries/libffi')
-rw-r--r--pkgs/development/libraries/libffi/default.nix13
-rw-r--r--pkgs/development/libraries/libffi/libffi-powerpc64.patch23
2 files changed, 30 insertions, 6 deletions
diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix
index 7387a4a1f0628..0971091d8a105 100644
--- a/pkgs/development/libraries/libffi/default.nix
+++ b/pkgs/development/libraries/libffi/default.nix
@@ -7,11 +7,6 @@
 , dejagnu
 }:
 
-# Note: this package is used for bootstrapping fetchurl, and thus
-# cannot use fetchpatch! All mutable patches (generated by GitHub or
-# cgit) that are needed here should be included directly in Nixpkgs as
-# files.
-
 stdenv.mkDerivation rec {
   pname = "libffi";
   version = "3.4.2";
@@ -21,7 +16,13 @@ stdenv.mkDerivation rec {
     sha256 = "081nx7wpzds168jbr59m34n6s3lyiq6r8zggvqxvlslsc4hvf3sl";
   };
 
-  patches = [];
+  # Note: this package is used for bootstrapping fetchurl, and thus
+  # cannot use fetchpatch! All mutable patches (generated by GitHub or
+  # cgit) that are needed here should be included directly in Nixpkgs as
+  # files.
+  patches = [
+    ./libffi-powerpc64.patch
+  ];
 
   strictDeps = true;
   outputs = [ "out" "dev" "man" "info" ];
diff --git a/pkgs/development/libraries/libffi/libffi-powerpc64.patch b/pkgs/development/libraries/libffi/libffi-powerpc64.patch
new file mode 100644
index 0000000000000..5748ac0849829
--- /dev/null
+++ b/pkgs/development/libraries/libffi/libffi-powerpc64.patch
@@ -0,0 +1,23 @@
+https://github.com/libffi/libffi/issues/668
+--- a/src/powerpc/linux64.S
++++ b/src/powerpc/linux64.S
+@@ -29,6 +29,8 @@
+ #include <fficonfig.h>
+ #include <ffi.h>
+ 
++	.machine altivec
++
+ #ifdef POWERPC64
+ 	.hidden	ffi_call_LINUX64
+ 	.globl	ffi_call_LINUX64
+--- a/src/powerpc/linux64_closure.S
++++ b/src/powerpc/linux64_closure.S
+@@ -30,6 +30,8 @@
+ 
+ 	.file	"linux64_closure.S"
+ 
++	.machine altivec
++
+ #ifdef POWERPC64
+ 	FFI_HIDDEN (ffi_closure_LINUX64)
+ 	.globl  ffi_closure_LINUX64