[llvm-bugs] [Bug 46669] New: Linker error on Windows with -fsanitize=undefined and using <chrono> - unresolved symbol "___mulodi4"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 10 02:22:14 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46669

            Bug ID: 46669
           Summary: Linker error on Windows with -fsanitize=undefined and
                    using <chrono> - unresolved symbol "___mulodi4"
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: familiebaumanns at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 23715
  --> https://bugs.llvm.org/attachment.cgi?id=23715&action=edit
Source file

Expected Behaviour:
====================
No linker error


Actual Behaviour:
====================
unresolved symbol: ___mulodi4


Environment:
====================
OS: Windows 10 2004
Clang++ Version: 10.0.0, Target: i686-pc-windows-msvc


Compiler Output:
====================
LinkError.cpp:10:5: warning: ignoring return value of function declared with
'nodiscard' attribute [-Wunused-result]
    Clock::now();
    ^~~~~~~~~~
1 warning generated.
   Bibliothek "a.lib" und Objekt "a.exp" werden erstellt.
LinkError-0dde10.o : error LNK2019: Verweis auf nicht aufgelöstes externes
Symbol "___mulodi4" in Funktion ""public: static class
std::chrono::time_point<struct std::chrono::steady_clock,class
std::chrono::duration<__int64,struct std::ratio<1,1000000000> > > __cdecl
std::chrono::steady_clock::now(void)"
(?now at steady_clock@chrono at std@@SA?AV?$time_point at Usteady_clock@chrono at std@@V?$duration at _JU?$ratio@$00$0DLJKMKAA@@std@@@23@@23 at XZ)".
a.exe : fatal error LNK1120: 1 nicht aufgelöste Externe
clang++: error: linker command failed with exit code 1120 (use -v to see
invocation)


Source-Code:
====================
#include <chrono>
#include <iostream>
#include <cstdint>


int main()
{
    using Clock = std::chrono::high_resolution_clock;

    Clock::now();
    return 0;
}


Additional:
====================
This error occurs only on Windows - on Linux it works.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200710/8756cce4/attachment.html>


More information about the llvm-bugs mailing list