New version and patch for 'sqlite'. (#6303)

This commit is contained in:
Sergey Kosukhin 2017-11-23 16:04:41 +01:00 committed by Christoph Junghans
parent cd7d812be9
commit 7f0659f032
2 changed files with 57 additions and 0 deletions

View File

@ -33,6 +33,8 @@ class Sqlite(AutotoolsPackage):
"""
homepage = "www.sqlite.org"
version('3.21.0', '7913de4c3126ba3c24689cb7a199ea31',
url='https://www.sqlite.org/2017/sqlite-autoconf-3210000.tar.gz')
version('3.20.0', 'e262a28b73cc330e7e83520c8ce14e4d',
url='https://www.sqlite.org/2017/sqlite-autoconf-3200000.tar.gz')
version('3.18.0', 'a6687a8ae1f66abc8df739aeadecfd0c',
@ -50,6 +52,13 @@ class Sqlite(AutotoolsPackage):
# following patch undefines the macro in shell.c
patch('sqlite_b0.patch', when='@3.18.0')
# Starting version 3.17.0, SQLite uses compiler built-ins
# __builtin_sub_overflow(), __builtin_add_overflow(), and
# __builtin_mul_overflow(), which are not supported by Intel compiler.
# Starting version 3.21.0 SQLite doesn't use the built-ins if Intel
# compiler is used.
patch('remove_overflow_builtins.patch', when='@3.17.0:3.20%intel')
def get_arch(self):
arch = architecture.Arch()
arch.platform = architecture.platform()

View File

@ -0,0 +1,48 @@
diff --git a/sqlite3.c b/sqlite3.c
index 4ec1271..8615169 100644
--- a/sqlite3.c
+++ b/sqlite3.c
@@ -29466,9 +29466,6 @@ SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){
** overflow, leave *pA unchanged and return 1.
*/
SQLITE_PRIVATE int sqlite3AddInt64(i64 *pA, i64 iB){
-#if GCC_VERSION>=5004000
- return __builtin_add_overflow(*pA, iB, pA);
-#else
i64 iA = *pA;
testcase( iA==0 ); testcase( iA==1 );
testcase( iB==-1 ); testcase( iB==0 );
@@ -29483,12 +29480,8 @@ SQLITE_PRIVATE int sqlite3AddInt64(i64 *pA, i64 iB){
}
*pA += iB;
return 0;
-#endif
}
SQLITE_PRIVATE int sqlite3SubInt64(i64 *pA, i64 iB){
-#if GCC_VERSION>=5004000
- return __builtin_sub_overflow(*pA, iB, pA);
-#else
testcase( iB==SMALLEST_INT64+1 );
if( iB==SMALLEST_INT64 ){
testcase( (*pA)==(-1) ); testcase( (*pA)==0 );
@@ -29498,12 +29491,8 @@ SQLITE_PRIVATE int sqlite3SubInt64(i64 *pA, i64 iB){
}else{
return sqlite3AddInt64(pA, -iB);
}
-#endif
}
SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){
-#if GCC_VERSION>=5004000
- return __builtin_mul_overflow(*pA, iB, pA);
-#else
i64 iA = *pA;
if( iB>0 ){
if( iA>LARGEST_INT64/iB ) return 1;
@@ -29519,7 +29508,6 @@ SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){
}
*pA = iA*iB;
return 0;
-#endif
}
/*