| OLD | NEW |
| 1 From 0233385c56d2b900b6f709a1af07d399285445a2 Mon Sep 17 00:00:00 2001 | 1 From 70b982a12a06231968ec365de3cf2c2a1a039fa5 Mon Sep 17 00:00:00 2001 |
| 2 From: Scott Hess <shess@chromium.org> | 2 From: Scott Hess <shess@chromium.org> |
| 3 Date: Tue, 14 Mar 2017 13:51:07 -0700 | 3 Date: Tue, 14 Mar 2017 13:51:07 -0700 |
| 4 Subject: [PATCH 10/10] [build] Undefined symbol in intrinsic on clang. | 4 Subject: [PATCH 10/10] [build] Undefined symbol in intrinsic on clang. |
| 5 | 5 |
| 6 SQLite implements sqlite3MulInt64() using __builtin_mul_overflow() for | 6 SQLite implements sqlite3MulInt64() using __builtin_mul_overflow() for |
| 7 appropriate versions of GCC or clang. But the Chromium clang package | 7 appropriate versions of GCC or clang. But the Chromium clang package |
| 8 doesn't seem to provide the necessary library for Android or Linux i386. | 8 doesn't seem to provide the necessary library for Android or Linux i386 |
| 9 (and other platforms). |
| 9 | 10 |
| 10 BUG=701524 | 11 BUG=701524 |
| 11 --- | 12 --- |
| 12 third_party/sqlite/src/src/util.c | 8 +++++++- | 13 third_party/sqlite/src/src/util.c | 7 ++++++- |
| 13 1 file changed, 7 insertions(+), 1 deletion(-) | 14 1 file changed, 6 insertions(+), 1 deletion(-) |
| 14 | 15 |
| 15 diff --git a/third_party/sqlite/src/src/util.c b/third_party/sqlite/src/src/util
.c | 16 diff --git a/third_party/sqlite/src/src/util.c b/third_party/sqlite/src/src/util
.c |
| 16 index c6d2bae3a7b4..0a76ddec683d 100644 | 17 index c6d2bae3a7b4..445aba9b48e4 100644 |
| 17 --- a/third_party/sqlite/src/src/util.c | 18 --- a/third_party/sqlite/src/src/util.c |
| 18 +++ b/third_party/sqlite/src/src/util.c | 19 +++ b/third_party/sqlite/src/src/util.c |
| 19 @@ -1310,7 +1310,13 @@ int sqlite3SubInt64(i64 *pA, i64 iB){ | 20 @@ -1310,7 +1310,12 @@ int sqlite3SubInt64(i64 *pA, i64 iB){ |
| 20 #endif | 21 #endif |
| 21 } | 22 } |
| 22 int sqlite3MulInt64(i64 *pA, i64 iB){ | 23 int sqlite3MulInt64(i64 *pA, i64 iB){ |
| 23 -#if GCC_VERSION>=5004000 || CLANG_VERSION>=4000000 | 24 -#if GCC_VERSION>=5004000 || CLANG_VERSION>=4000000 |
| 24 +/* TODO(shess): Chromium Android clang generates a link error: | 25 +/* TODO(shess): Removing clang support because on many platforms it generates a |
| 26 +** link error for this intrinsic: |
| 25 +** undefined reference to '__mulodi4' | 27 +** undefined reference to '__mulodi4' |
| 26 +** UPDATE(shess): Also, apparently, 32-bit Linux clang. | 28 +** http://crbug.com/701524 |
| 27 +*/ | 29 +*/ |
| 28 +#if GCC_VERSION>=5004000 || \ | 30 +#if GCC_VERSION>=5004000 |
| 29 + (CLANG_VERSION>=4000000 && !defined(__ANDROID__) && \ | |
| 30 + (!defined(__linux__) || !defined(__i386__))) | |
| 31 return __builtin_mul_overflow(*pA, iB, pA); | 31 return __builtin_mul_overflow(*pA, iB, pA); |
| 32 #else | 32 #else |
| 33 i64 iA = *pA; | 33 i64 iA = *pA; |
| 34 -- | 34 -- |
| 35 2.11.0 | 35 2.11.0 |
| 36 | 36 |
| OLD | NEW |