New upstream version 1.7.3

- Use upstream make install target.
- Build and install documentation.
- Run test suite.
- Fix perl-related Provides and Requires for -cilly.
- Enable on arm and ppc (fixed by upstream ./configure).
- Apply two upstream patches to test suite.
This commit is contained in:
Gabriel Kerneis 2013-09-03 10:43:53 +01:00 committed by Richard W.M. Jones
parent 10d527af37
commit bba9fbd600
5 changed files with 117 additions and 64 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
cil-1.3.7.tar.gz
/cil-1.4.0.tar.gz
/cil-*.tar.gz

View File

@ -0,0 +1,33 @@
From: Gabriel Kerneis <gabriel@kerneis.info>
Date: Thu, 29 Aug 2013 09:30:23 +0100
Subject: Fix testsuite on 32-bit machines
---
test/small1/arrsize.c | 2 +-
test/testcil.pl | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/small1/arrsize.c b/test/small1/arrsize.c
index 6da8d0a..718b948 100755
--- a/test/small1/arrsize.c
+++ b/test/small1/arrsize.c
@@ -1,6 +1,6 @@
#include "testharness.h"
-#define MAXINT (1ull << ((8 * sizeof(int)) - 1))
+#define MAXINT (1ull << ((8 * sizeof(int)) - 2))
int g1[ MAXINT / sizeof(int) ];
char g2[ MAXINT / sizeof(char) ];
diff --git a/test/testcil.pl b/test/testcil.pl
index 778dfa7..dd814ed 100644
--- a/test/testcil.pl
+++ b/test/testcil.pl
@@ -569,6 +569,7 @@ addTest("merge-ar ");
addTest("testrun/sizeof1");
addTest("testrun/sizeof2");
addTest("test/sizeof3");
+addBadComment("test/sizeof3", "Bug. Constant-folding of very large arrays does not work on 32-bit machines.");
addTest("test/outofmem ");
addTest("testrun/builtin ");
addTest("test/builtin2 ");

View File

@ -0,0 +1,27 @@
From: Gabriel Kerneis <gabriel@kerneis.info>
Date: Thu, 29 Aug 2013 10:36:20 +0100
Subject: Do not fail testsuite on new gcc behaviour
Sometime between gcc 4.4 and gcc 4.7, the behaviour
of function attributes has changed such that
test/small2/regparm0.c does not compile anymore on 32-bit.
This is actually a good thing, since the previous behaviour
was quite confusing (although supported by CIL).
---
test/testcil.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/testcil.pl b/test/testcil.pl
index dd814ed..560430a 100644
--- a/test/testcil.pl
+++ b/test/testcil.pl
@@ -620,7 +620,8 @@ addTest("scott/open $gcc");
addTest("scott/constfold");
addTest("scott/mode_sizes $gcc"); # mode(__QI__) stuff
addTest("scott-nolink/brlock $gcc");
-addTest("scott/regparm0 $gcc"); # this works, unfortunately... but the bug has been fixed nonetheless
+addTest("scott/regparm0 $gcc"); # this used to work, unfortunately... but the bug has been fixed in CIL (and now gcc)
+addBadComment("scott/regparm0", "Notbug. Not a bug if fails with gcc >= 4.7 on i386");
addTest("scott/unscomp"); # kernel/fs/buffer.c
addTest("scott/thing");

View File

@ -1,26 +1,22 @@
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%define debug_package %{nil}
# Prevent unwanted bytecode stripping by RPM.
%define __strip /bin/true
Name: ocaml-cil
Version: 1.4.0
Release: 10%{?dist}
Version: 1.7.3
Release: 1%{?dist}
Summary: CIL - Infrastructure for C Program Analysis and Transformation
License: BSD
URL: http://cil.sourceforge.net/
Source0: http://downloads.sourceforge.net/cil/cil-%{version}.tar.gz
ExcludeArch: armv7hl
ExcludeArch: ppc64
ExcludeArch: ppc
ExcludeArch: sparc64
ExcludeArch: s390 s390x
BuildRequires: ocaml, ocaml-findlib-devel, ocaml-ocamldoc
Patch0: 0001-Fix-testsuite-on-32-bit-machines.patch
Patch1: 0002-Do-not-fail-testsuite-on-new-gcc-behaviour.patch
%description
CIL (C Intermediate Language) is a high-level representation along
@ -63,6 +59,7 @@ developing applications that use %{name}.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildRequires: tex(latex), hevea
%description doc
@ -71,23 +68,24 @@ The %{name}-doc package contains documentation for users of %{name}.
%package cilly
Summary: Support programs for %{name}
# Run-time for tests
Requires: %{name} = %{version}-%{release}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
# test and doc use cilly: Requires must also be BuildRequires
BuildRequires: perl(Carp)
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(File::Basename)
BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Spec)
BuildRequires: perl(File::Temp)
BuildRequires: perl(FindBin)
BuildRequires: perl(lib)
BuildRequires: perl(strict)
BuildRequires: perl(Text::ParseWords)
Requires: %{name} = %{version}-%{release}
Provides: perl(CilConfig) = %{version}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
# Explicit requires because system-wide dependency generator is overriden in
# this package
Requires: perl(Carp)
Requires: perl(Data::Dumper)
Requires: perl(File::Spec)
Requires: perl(lib)
Requires: perl(Text::ParseWords)
# Some more dependencies used only for build and test
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(ExtUtils::MakeMaker)
# Filter out wrong Provides (automatically generated)
%global __provides_exclude perl\\(AR|GNUCC|MSLIB|MSLINK|MSVC\\)
%description cilly
The %{name}-cilly package contains the 'cilly' wrapper/replacement
@ -97,50 +95,43 @@ for gcc.
%prep
%setup -q -n cil-%{version}
%patch0 -p1
%patch1 -p1
%build
./configure --libdir=%{_libdir}
make RELEASE=1
make quicktest
archos=`ls obj`
export PERL_MM_OPT=INSTALLDIRS=vendor
rm -f bin/CilConfig.pm
cat > bin/CilConfig.pm <<EOF
\$::archos = "$archos";
\$::cc = "gcc";
\$::cilhome = "%{_libexecdir}/cil";
\$::default_mode = "GNUCC";
EOF
#strip obj/$archos/cilly.byte.exe - NO! It removes the bytecode :-(
%if %opt
strip obj/$archos/cilly.asm.exe
%endif
%configure
# make -j is broken, do not use it
make all doc
# Force build of bytecode version even if ocamlopt is available
make OCAMLBEST= bin/cilly.byte
%check
make test
%install
# This sets $archos to something like 'x86_LINUX':
archos=`ls obj`
export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
# CIL's make install rule is totally borked.
mkdir -p $DESTDIR%{perl_vendorlib}
install -m 0644 lib/*.pm bin/CilConfig.pm $DESTDIR%{perl_vendorlib}
mkdir -p $OCAMLFIND_DESTDIR
ocamlfind install cil META obj/$archos/*.{ml,mli,cmi,cmo,cmx,cma,cmxa,o,a} \
src/*.mli
make DESTDIR=$DESTDIR install
mkdir -p $DESTDIR%{_bindir}
install -m 0755 bin/cilly $DESTDIR%{_bindir}
# clean up .packlist
find $DESTDIR -name .packlist -type f -exec rm -f {} \;
mkdir -p $DESTDIR%{_libexecdir}/cil/obj/$archos
install -m 0755 obj/$archos/cilly.*.exe $DESTDIR%{_libexecdir}/cil/obj/$archos
mkdir -p $DESTDIR/etc/prelink.conf.d
echo '-b /usr/libexec/cil' > $DESTDIR/etc/prelink.conf.d/ocaml-cil-cilly.conf
# make install does not install documentation
# Copy documentation in doc/ocaml-cil, avoiding spurious files not cleaned up by
# CIL
mkdir -p doc/ocaml-cil/html
cp -r doc/html/cil/api doc/ocaml-cil/html
cp -r doc/html/cil/examples doc/ocaml-cil/html
cp doc/html/cil/*.gif doc/ocaml-cil/html/
cp doc/html/cil/*.html doc/ocaml-cil/html/
cp doc/html/cil/*.css doc/ocaml-cil/html/
cp doc/html/cil/CIL.pdf doc/ocaml-cil/cil-manual.pdf
%clean
rm -rf $RPM_BUILD_ROOT
@ -155,7 +146,6 @@ rm -rf $RPM_BUILD_ROOT
%exclude %{_libdir}/ocaml/cil/*.cmx
%endif
%exclude %{_libdir}/ocaml/cil/*.mli
%exclude %{_libdir}/ocaml/cil/*.ml
%files devel
@ -166,25 +156,29 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/ocaml/cil/*.cmx
%endif
%{_libdir}/ocaml/cil/*.mli
%{_libdir}/ocaml/cil/*.ml
%files doc
%doc README.md LICENSE doc/*
%doc README.md LICENSE doc/ocaml-cil/*
%files cilly
%doc README.md LICENSE
%{perl_vendorlib}/CilConfig.pm
%{perl_vendorlib}/Cilly.pm
%{perl_vendorlib}/KeptFile.pm
%{perl_vendorlib}/OutputFile.pm
%{perl_vendorlib}/TempFile.pm
%{_bindir}/cilly
%{_libexecdir}/cil
%config(noreplace) /etc/prelink.conf.d/ocaml-cil-cilly.conf
%dir %{perl_vendorlib}/App
%{perl_vendorlib}/App/Cilly
%{perl_vendorlib}/App/Cilly.pm
%{_bindir}/cilly*
%changelog
* Fri Aug 30 2013 Gabriel Kerneis <gabriel@kerneis.info> - 1.7.3-1
- New upstream version 1.7.3.
- Use upstream make install target.
- Build and install documentation.
- Run test suite.
- Fix perl-related Provides and Requires for -cilly.
- Enable on arm and ppc (fixed by upstream ./configure).
- Apply two upstream patches to test suite.
* Sun Aug 4 2013 Richard W.M. Jones <rjones@redhat.com> - 1.4.0-10
- Disable on arm (not supported by upstream ./configure).
- Modernize the spec file.

View File

@ -1 +1 @@
a61b329f66e7646163ada56046545af5 cil-1.4.0.tar.gz
dffd5ee8f812b86b5352583c223ef6e6 cil-1.7.3.tar.gz