[llvm-bugs] [Bug 38251] New: Duplicate profiling symbols on Windows

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 20 10:26:53 PDT 2018


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

            Bug ID: 38251
           Summary: Duplicate profiling symbols on Windows
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dmajor at mozilla.com
                CC: davidxl at google.com, llvm-bugs at lists.llvm.org,
                    llvm at inglorion.net, vsk at apple.com

clang version 7.0.0 (trunk 337473)
Target: x86_64-pc-windows-msvc

$ cat header.h
__declspec(dllimport) inline void Foo() {}
template <class T> void Bar(T) {
  Foo();
}
template void Bar(int);

$ cat a.cpp
#include "header.h"
int main() { return 0; }

$ cat b.cpp
#include "header.h"

$ clang-cl -O1 -fprofile-instr-generate -c a.cpp b.cpp
$ lld-link -nodefaultlib -entry:main a.obj b.obj

lld-link.exe: error: duplicate symbol: __profc_?Foo@@YAXXZ in a.obj and in
b.obj
lld-link.exe: error: duplicate symbol: __profd_?Foo@@YAXXZ in a.obj and in
b.obj

We've been seeing these errors while attempting to build Firefox on Windows
with PGO. Different binaries error out on different symbols. I'm not sure they
would all reduce to this same repro, but I guess fixing this one would be at
least necessary if not sufficient.

In case it's a clue: I'm pretty sure the `__declspec(dllimport)` is a common
theme among all of the problematic symbols. I don't think it's strictly
necessary to use templates though; there may be other ways to hit this.

-- 
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/20180720/8263039d/attachment-0001.html>


More information about the llvm-bugs mailing list