<html><head></head><body>I thought I had to do that. I'll try without scope. Thanks!<br><br><div class="gmail_quote">Evgeny Leviant <eleviant@accesssoftek.com> schreef op 21 maart 2018 18:36:26 CET:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Yep, it's once again variable and it's type using different scopes.<br>Is there any strong reason why you set scope for global DIDerivedType?<br><hr><br>От: Carlo Kok <ck@remobjects.com><br>Отправлено: 21 марта 2018 г. 18:22<br>Кому: Evgeny Leviant; llvm-dev@lists.llvm.org<br>Тема: Re: [llvm-dev] lld/lto/win32 crash on DIE code<br><br>Thanks!<br><br>Unfortunately this doesn't seem to cause it, because when I fix it to<br>match the other files (and pretty much how clang emits it:)<br><br>!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())<br>!1 = !DIGlobalVariable(name: "IDispatch_UID", linkageName:<br>"f_t2b_RemObjects_d_Elements_d_System_d_____Global.IDispatchUID", scope:<br>!2, file: !3, type: !622, isLocal: false, isDefinition: true)<br>!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer:<br>"RemObjects Island", isOptimized: true, runtimeVersion: 0, emissionKind:<br>FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !703)<br>!3 = !DIFile(filename:<br>"island.windows.elements-e54b3dc8c0536e29a65f8548b5ae7958-global",<br>directory: "/__windows_drive__c/ci/b/elements/1301/source/islandrtl/source")<br>!4 = !{}<br>!5 = !{!0, !6, !620, !635, !637, !639, !660, !669, !671, !673, !675,<br>!680, !682, !684}<br>!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())<br>!7 = !DIGlobalVariable(name: "IDispatch_VMT", linkageName:<br>"f_t2b_RemObjects_d_Elements_d_System_d_____Global.IDispatchVMT", scope:<br>!2, file: !3, type: !8, isLocal: false, isDefinition: true)<br><br>It still crashes. Same callstack.<br><br>Note that all these .o files individually compile file, it's only when I<br>let the linker lto-merge them things go wrong for me.<br><br>(updated <a href="https://www.dropbox.com/s/n3e2eystps9qvwx/repro.tar?dl=0">https://www.dropbox.com/s/n3e2eystps9qvwx/repro.tar?dl=0</a> to<br>reflect above)<br><br>Op 21-3-2018 om 11:58 schreef Evgeny Leviant:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Ok, I've done a bit more investigation. I found the module which declares broken DIE<br> (e54b3dc8c0536e29a65f8548b5ae7958-Global.o) and here is what I found there:<br><br> !2 = !DIFile(filename: "island.windows.elements", ...<br> ...<br> !4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !5, ...<br> !5 = !DIFile(filename: "island.windows.elements-e54b3dc8c0536e29a65f8548b5ae7958-global", ...<br><br> All subsequent DIEs reference file !2, except DICompileUnit (!4) which references file !5. This seems a bit<br> strange for me. Can't this be a root cause of your problems?<br><br><hr><br> От: Carlo Kok <ck@remobjects.com><br> Отправлено: 21 марта 2018 г. 12:31<br> Кому: Evgeny Leviant; llvm-dev@lists.llvm.org<br> Тема: Re: [llvm-dev] lld/lto/win32 crash on DIE code<br><br> Op 21-3-2018 om 10:28 schreef Evgeny Leviant:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> It looks the problem lies in how your compiler generates debug info. LLVM doesn't<br> expect DIDerivedType scope to be an instance of DICompileUnit. Here is a quick fix:<br><br>    DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) {<br> -  if (!Context || isa<DIFile>(Context))<br> +  if (!Context || isa<DIFile>(Context) || isa<DICompileUnit>(Context))<br><br> However, I suggest talking to someone with in-depth debug info experience, as the problem<br> itself seems to be not related to LTO.<br></blockquote><br> The problem seems to be related to that but it *does* support some<br> DICompileUnits, just not this particular one, I stepped through this<br> code and it gets a DICompileUnit often enough. Somehow during<br> LTO/merging I get a type that has a different DICompileUnit than where<br> the variable is defined, and it's not liking it.</blockquote><br></pre></blockquote></div></body></html>