eprover: fix cross compilation (#504298)

This commit is contained in:
7c6f434c
2026-04-02 10:03:34 +00:00
committed by GitHub
2 changed files with 38 additions and 3 deletions
@@ -0,0 +1,25 @@
--- a/CONTRIB/picosat-965/makefile.in
+++ b/CONTRIB/picosat-965/makefile.in
@@ -49,8 +49,7 @@ config.h: makefile VERSION mkconfig.sh # and actually picosat.c
rm -f $@; ./mkconfig.sh > $@
libpicosat.a: picosat.o version.o
- ar rc $@ picosat.o version.o
- ranlib $@
+ $(AR) $@ picosat.o version.o
SONAME=-Xlinker -soname -Xlinker libpicosat.so
libpicosat.so: picosat.o version.o
--- a/Makefile.vars
+++ b/Makefile.vars
@@ -160,8 +160,8 @@ LD = $(CC) $(LDFLAGS)
# Generic
# AR = sleep 1;ar rcs
- AR = ar rcs
- CC = gcc
+# AR = ar rcs
+# CC = gcc
# Builds with link time optimization
#
+13 -3
View File
@@ -17,9 +17,11 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ which ];
preConfigure = ''
sed -e 's/ *CC *= *gcc$//' -i Makefile.vars
'';
patches = [
./fix-cross-toolchains.patch
];
configurePlatforms = [ ];
configureFlags = [
"--exec-prefix=$(out)"
@@ -29,6 +31,14 @@ stdenv.mkDerivation (finalAttrs: {
"--enable-ho"
];
# need to directly insert into makeFlagsArray as the makefile expects the binary
# in the AR variable to already be passed the `rcs` flags, which requires us to
# specify them. As this requires spaces, we need makeFlagsArray, as makeFlags
# will just make the make script see the `rcs` as a target
preBuild = ''
makeFlagsArray+=(CC="${stdenv.cc.targetPrefix}cc" AR="${stdenv.cc.targetPrefix}ar rcs")
'';
meta = {
description = "Automated theorem prover for full first-order logic with equality";
homepage = "http://www.eprover.org/";