Skip to content
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

Clang -g crashes at link #88

Closed
bprail opened this issue Mar 14, 2016 · 0 comments
Closed

Clang -g crashes at link #88

bprail opened this issue Mar 14, 2016 · 0 comments
Assignees
Labels

Comments

@bprail
Copy link
Owner

bprail commented Mar 14, 2016

When compiling with -g, Clang 3.7+ crashes in the link step for non-trivial Contech-instrumented binaries.

Issue was seen last fall with rust - rust-lang/rust#28947; however, they brought in a fix for their local environment.
LLVM bug - http://llvm.1065342.n5.nabble.com/llvm-dev-CloneFunction-during-LTO-leads-to-seg-fault-td90858.html.

In a simple program, the debug issue is now at:
!dbg attachment points at wrong subprogram for function

!10 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 8, type: !11, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, variables: !13)
i8* (i8*)* @foo
  tail call void @llvm.dbg.value(metadata i8* %"Cast as void", i64 0, metadata !374, metadata !1035), !dbg !1038
!1038 = !DILocation(line: 695, column: 58, scope: !370)
!370 = distinct !DISubprogram(name: "__ctStoreMemOp", scope: !49, file: !49, line: 695, type: !371, isLocal: false, isDefinition: true, scopeLine: 696, flags: DIFlagPrototyped, isOptimized: true, variables: !373)
!370 = distinct !DISubprogram(name: "__ctStoreMemOp", scope: !49, file: !49, line: 695, type: !371, isLocal: false, isDefinition: true, scopeLine: 696, flags: DIFlagPrototyped, isOptimized: true, variables: !373)

Is the inlined code an issue with -flto, as the debug symbols are not updated in a proper manner?

@bprail bprail added the bug label Mar 14, 2016
@bprail bprail self-assigned this Mar 14, 2016
bprail pushed a commit that referenced this issue Mar 16, 2016
See issue #88.  Ideally, long term this flag will be restored; however,
supporting this at present would require modifying clang / LLVM itself.
@bprail bprail closed this as completed Mar 16, 2016
bprail added a commit that referenced this issue Sep 13, 2016
As long as the runtime is not linked into the bitcode prior to Clang, the
debugging symbols can be present. #88.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant