Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang inserts undefined reference to __mulodi4 #506

Closed
alexcohn opened this issue Sep 4, 2017 · 6 comments
Closed

clang inserts undefined reference to __mulodi4 #506

alexcohn opened this issue Sep 4, 2017 · 6 comments

Comments

@alexcohn
Copy link

alexcohn commented Sep 4, 2017

Description

Build of sqlite3.c for armeabi-v7a with clang fails in NDK r15c:

sqlite3.c:function sqlite3MulInt64: error: undefined reference to '__mulodi4'

Here is the minimal command to reproduce this:

void q(long long qq) {
    __builtin_mul_overflow(qq, qq, &qq);
}

clang -arch arm --sysroot $NDK_ROOT/sysroot -c q.c && nm q.o

Note a similar issue in Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=503229.
sqlite3.c does not use __builtin_mul_overflow for CLANG_VERSION under 4000000, hence build succeeds in NDK 14.

Environment Details

  • NDK Version: 15.2.4203891
  • Build sytem: ndk-build
  • Host OS: Mac
  • Compiler: clang version 5.0.300080
  • ABI: armeabi-v7a
@fornwall
Copy link

fornwall commented Sep 4, 2017

I think #294 is the canonical issue for functions provided by compiler-rt.

@alexcohn
Copy link
Author

alexcohn commented Sep 4, 2017

@fornwall thanks for the link. It doesn't seem a duplicate though, because my example is 32-bit. Are we really expected to compile mulodi4.c?

@enh
Copy link
Contributor

enh commented Sep 5, 2017

duplicate of issue #184 .

@enh enh closed this as completed Sep 5, 2017
@unanan
Copy link

unanan commented Sep 28, 2017

Same question about the undefined reference to '__mulodi4' Error

@dibya001
Copy link

dibya001 commented May 9, 2019

Was anyone able to resolve this issue. Still facing the same error.

@mhsmith
Copy link

mhsmith commented Jan 22, 2020

Fixed in NDK r19, according to #294.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants