Added a patch to avoid segmentation fault of tests on ppc64
This commit is contained in:
parent
e3b51008ff
commit
4309129710
46
sqlite-2.8.17-ppc64.patch
Normal file
46
sqlite-2.8.17-ppc64.patch
Normal file
@ -0,0 +1,46 @@
|
||||
Patch by Gustavo Luiz Duarte <gustavold@gmail.com> for sqlite >= 2.8.17,
|
||||
which fixes the cast of a pointer to int that causes a segmentation fault
|
||||
during the tests. On 64 bit machines, pointers are 64 bit and int is 32
|
||||
bit. During casting the pointer is truncated, so the original code could
|
||||
potentially also break x86_64, while it is doing not so at the moment.
|
||||
|
||||
--- sqlite-2.8.17/src/test2.c 2005-04-24 00:43:22.000000000 +0200
|
||||
+++ sqlite-2.8.17/src/test2.c.ppc64 2012-03-23 10:47:07.000000000 +0100
|
||||
@@ -82,7 +82,7 @@ static int pager_open(
|
||||
Tcl_AppendResult(interp, errorName(rc), 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
- sprintf(zBuf,"0x%x",(int)pPager);
|
||||
+ sprintf(zBuf,"%p", pPager);
|
||||
Tcl_AppendResult(interp, zBuf, 0);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -334,7 +334,7 @@ static int page_get(
|
||||
Tcl_AppendResult(interp, errorName(rc), 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
- sprintf(zBuf,"0x%x",(int)pPage);
|
||||
+ sprintf(zBuf,"%p", pPage);
|
||||
Tcl_AppendResult(interp, zBuf, 0);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -364,7 +364,7 @@ static int page_lookup(
|
||||
if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
|
||||
pPage = sqlitepager_lookup(pPager, pgno);
|
||||
if( pPage ){
|
||||
- sprintf(zBuf,"0x%x",(int)pPage);
|
||||
+ sprintf(zBuf,"%p", pPage);
|
||||
Tcl_AppendResult(interp, zBuf, 0);
|
||||
}
|
||||
return TCL_OK;
|
||||
--- sqlite-2.8.17/src/test3.c 2005-04-24 00:43:22.000000000 +0200
|
||||
+++ sqlite-2.8.17/src/test3.c.ppc64 2012-03-23 10:47:03.000000000 +0100
|
||||
@@ -534,7 +534,7 @@ static int btree_cursor(
|
||||
Tcl_AppendResult(interp, errorName(rc), 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
- sprintf(zBuf,"0x%x", (int)pCur);
|
||||
+ sprintf(zBuf,"%p", pCur);
|
||||
Tcl_AppendResult(interp, zBuf, 0);
|
||||
return SQLITE_OK;
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
Name: sqlite2
|
||||
Version: 2.8.17
|
||||
Release: 7%{?dist}
|
||||
Release: 8%{?dist}
|
||||
|
||||
Summary: Embeddable SQL engine in a C library
|
||||
Group: System Environment/Libraries
|
||||
@ -16,6 +16,7 @@ Patch4: sqlite-64bit-fixes.patch
|
||||
Patch5: sqlite-2.8.15-arch-double-differences.patch
|
||||
Patch6: sqlite-2.8.17-test.patch
|
||||
Patch7: sqlite-2.8.17-tcl.patch
|
||||
Patch8: sqlite-2.8.17-ppc64.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: ncurses-devel readline-devel %{_includedir}/tcl.h
|
||||
@ -64,6 +65,7 @@ This package contains tcl bindings for sqlite.
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
sed -i.rpath 's!__VERSION__!%{version}!g' Makefile.in
|
||||
# Patch additional /usr/lib locations where we don't have $(libdir)
|
||||
# to substitute with.
|
||||
@ -118,6 +120,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_libdir}/tcl%{tclver}/sqlite2
|
||||
|
||||
%changelog
|
||||
* Fri Mar 23 2012 Robert Scheck <robert@fedoraproject.org> - 2.8.17-8
|
||||
- Added a patch to avoid segmentation fault of tests on ppc64
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.17-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user