clang-cl emitting call to __udivti3 resolved from where?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

clang-cl emitting call to __udivti3 resolved from where?

Robinson, Paul via cfe-dev
At least on recent trunk, a simple test.c

> unsigned __int128 f(unsigned __int128 a, unsigned __int128 b) { return a / b; }

compiled as

> clang-cl /c /FA test.c

will contain a call to __udivti3 (see generated test.asm), but it is not
clear to me from where that symbol is supposed to be resolved when
actually linking test.obj?
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang-cl emitting call to __udivti3 resolved from where?

Robinson, Paul via cfe-dev
__udivti3 is provided by compiler-rt.

> On Nov 22, 2017, at 11:41 AM, Stephan Bergmann via cfe-dev <[hidden email]> wrote:
>
> At least on recent trunk, a simple test.c
>
>> unsigned __int128 f(unsigned __int128 a, unsigned __int128 b) { return a / b; }
>
> compiled as
>
>> clang-cl /c /FA test.c
>
> will contain a call to __udivti3 (see generated test.asm), but it is not clear to me from where that symbol is supposed to be resolved when actually linking test.obj?
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang-cl emitting call to __udivti3 resolved from where?

Robinson, Paul via cfe-dev
On 11/22/2017 05:54 PM, Stephen Canon wrote:
> __udivti3 is provided by compiler-rt.

Yeah, but clang-cl won't link against anything from there.  Sorry for
being unclear in my original mail.  So if you actually try to link test2.c

> unsigned __int128 f(unsigned __int128 a, unsigned __int128 b) { return a / b; }
> int main() { return 0; }

on Windows with

> clang-cl test2.c

it will fail with "error LNK2019: unresolved external symbol __udivti3
referenced in function f".

>> On Nov 22, 2017, at 11:41 AM, Stephan Bergmann via cfe-dev <[hidden email]> wrote:
>>
>> At least on recent trunk, a simple test.c
>>
>>> unsigned __int128 f(unsigned __int128 a, unsigned __int128 b) { return a / b; }
>>
>> compiled as
>>
>>> clang-cl /c /FA test.c
>>
>> will contain a call to __udivti3 (see generated test.asm), but it is not clear to me from where that symbol is supposed to be resolved when actually linking test.obj?
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang-cl emitting call to __udivti3 resolved from where?

Robinson, Paul via cfe-dev
On 11/22/2017 06:01 PM, Stephan Bergmann via cfe-dev wrote:

> On 11/22/2017 05:54 PM, Stephen Canon wrote:
>> __udivti3 is provided by compiler-rt.
>
> Yeah, but clang-cl won't link against anything from there.  Sorry for
> being unclear in my original mail.  So if you actually try to link test2.c
>
>> unsigned __int128 f(unsigned __int128 a, unsigned __int128 b) { return
>> a / b; }
>> int main() { return 0; }
>
> on Windows with
>
>> clang-cl test2.c
>
> it will fail with "error LNK2019: unresolved external symbol __udivti3
> referenced in function f".

ah, there's <https://bugs.llvm.org/show_bug.cgi?id=25305> "Clang-cl
generates a call to an undefined symbol __udivti3" already
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev