New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 701524 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
ex-Googler
Closed: Sep 2017
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug

Blocked on:
issue 701518



Sign in to add a comment

SQLite 3.17 cannot find __mulodi4 on Android clang.

Project Member Reported by sh...@chromium.org, Mar 14 2017

Issue description

SQLite implements sqlite3MulInt64() using __builtin_mul_overflow() for appropriate versions of GCC or clang.  But clang appears to provide this function in a non-standard library which our Android clang does not provide.  It fails with an undefined symbol __mulodi4.

As best I can tell from web searches, it should either add the library compiler-rt or perhaps clang_rt.  But AFAICT those aren't actually available in our clang package.

This may not be an isolated problem:
https://codereview.chromium.org/2011073002/diff/40001/gyp/dng_sdk.gyp
 

Comment 1 by richard....@arm.com, Mar 21 2017

This has started to show up in ChromeOS builds too.

Comment 2 by richard....@arm.com, Mar 21 2017

OK, so looking at the pre-processor guard in sqlite3MulInt64, it seems that modifying it from

#if GCC_VERSION>=5004000 || \
    (CLANG_VERSION>=4000000 && !defined(__ANDROID__) && \
     (!defined(__linux__) || !defined(__i386__)))

to

#if GCC_VERSION>=5004000 || \
    (CLANG_VERSION>=4000000 && !defined(__ANDROID__) && !defined(__linux__))

works around the problem for ChromeOS on ARM. If I remember correctly, defined(__ANDROID__) implies defined(__linux__) as well.


Comment 3 by sh...@chromium.org, Mar 21 2017

I think I might just disable the intrinsic for clang entirely.  I don't want to spend the rest of my life playing whack-a-mole, and AFAICT this is a clang bug.  Maybe https://bugs.llvm.org//show_bug.cgi?id=28629
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e39ce92107b239f0043d55eef91e155b1471382

commit 9e39ce92107b239f0043d55eef91e155b1471382
Author: shess <shess@chromium.org>
Date: Tue Mar 21 17:31:49 2017

[sql] Disable a clang intrinsic in SQLite 3.17.0.

SQLite implements sqlite3MulInt64() using __builtin_mul_overflow() for
appropriate versions of GCC or clang.  But clang appears to provide this
function in a non-standard library which our Android clang does not provide.  It
fails with an undefined symbol __mulodi4.

[It is possible that this is specific to Chromium's packaged clang, but
https://bugs.llvm.org//show_bug.cgi?id=28629 ]

BUG= 701524 , 701518 

Review-Url: https://codereview.chromium.org/2762233003
Cr-Commit-Position: refs/heads/master@{#458457}

[modify] https://crrev.com/9e39ce92107b239f0043d55eef91e155b1471382/third_party/sqlite/amalgamation/sqlite3.c
[modify] https://crrev.com/9e39ce92107b239f0043d55eef91e155b1471382/third_party/sqlite/patches/0010-build-Undefined-symbol-in-intrinsic-on-clang.patch
[modify] https://crrev.com/9e39ce92107b239f0043d55eef91e155b1471382/third_party/sqlite/src/src/util.c

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 21 2017

Labels: merge-merged-3047
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fde207b1619a7d46a362c582a2c3f07b09f81614

commit fde207b1619a7d46a362c582a2c3f07b09f81614
Author: Steven Bennetts <stevenjb@chromium.org>
Date: Tue Mar 21 19:52:23 2017

[sql] Disable a clang intrinsic in SQLite 3.17.0.

SQLite implements sqlite3MulInt64() using __builtin_mul_overflow() for
appropriate versions of GCC or clang.  But clang appears to provide this
function in a non-standard library which our Android clang does not provide.  It
fails with an undefined symbol __mulodi4.

[It is possible that this is specific to Chromium's packaged clang, but
https://bugs.llvm.org//show_bug.cgi?id=28629 ]

BUG= 701524 , 701518 

Review-Url: https://codereview.chromium.org/2762233003
Cr-Commit-Position: refs/heads/master@{#458457}
(cherry picked from commit 9e39ce92107b239f0043d55eef91e155b1471382)

Review-Url: https://codereview.chromium.org/2767723002 .
Cr-Commit-Position: refs/branch-heads/3047@{#6}
Cr-Branched-From: 15ae1e89e749d6443b6caffdbc78ad24f945aa67-refs/heads/master@{#458255}

[modify] https://crrev.com/fde207b1619a7d46a362c582a2c3f07b09f81614/third_party/sqlite/amalgamation/sqlite3.c
[modify] https://crrev.com/fde207b1619a7d46a362c582a2c3f07b09f81614/third_party/sqlite/patches/0010-build-Undefined-symbol-in-intrinsic-on-clang.patch
[modify] https://crrev.com/fde207b1619a7d46a362c582a2c3f07b09f81614/third_party/sqlite/src/src/util.c

Comment 6 by sh...@chromium.org, Jun 21 2017

Labels: ShessReview

Comment 7 by pwnall@chromium.org, Sep 21 2017

Status: Fixed (was: Started)
This is no longer a problem after the SQLite 3.20.0 import.

Sign in to add a comment