-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
undefined reference to __mulodi4
#14841
Comments
You'll need to use compiler-rt instead of libgcc for your runtime library. It |
Thanks, what is the best way to do that? |
Besides |
has the information (via a link to clang's page) that you'll want for using compiler-rt with your clang. |
Since compiling with Is there any way to make clang to generate the same code as gcc in such cases (and thus avoid compiler-rt)?
i will have to build it with |
Ok, i switched to the latest clang:
and built the following libraries:
Nevertheless compiling the previously attached tests with
I would guess that clang generates code assuming libclang_rt, but linker What did i do wrong? ps: |
Same error occurs while compiling code on Windows with clang++ and flag
Operating System: Windows 7 Ultimate 64-bit, Service Pack 1 Compiler: MinGW-w64's clang-3.2. |
*** This bug has been marked as a duplicate of bug #14269 *** |
This was incorrectly closed as a duplicate. bug 13897 is fixed, but the test case here is still not working. $ gcc -ftrapv -m32 32.cc
$ clang -ftrapv -m32 32.cc
/usr/bin/ld: /tmp/32-cc3c8b.o: in function `main':
32.cc:(.text+0x4f): undefined reference to `__mulodi4'
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
$ clang --version
clang version 9.0.0 (https://github.com/llvm/llvm-project.git 0f472e1d01d60b6e615cd71a09b0a52eb8e42072)
Target: i686-pc-linux-gnu |
mentioned in issue llvm/llvm-bugzilla-archive#24345 |
This looks like a duplicate of #16778. |
__mulodi4
Extended Description
Multiplication of two
long long int
translates into the code that requires to call missing function__mulodi4
if compiled with-ftrapv -m32
(on 64 bit linux)Please compile the attached code with
clang -ftrapv -m32
(at least on a 64 bit machine).Removing either
-ftrapv
or-m32
will produce fine executable.ps:
clang version 3.1 (branches/release_31)
Target: x86_64-unknown-linux-gnu
The text was updated successfully, but these errors were encountered: