Andrew Kelley via llvm-dev
2017-Mar-22 16:59 UTC
[llvm-dev] LLD/Mach-O - how to work around this bug?
I filed this bug today: https://bugs.llvm.org/show_bug.cgi?id=32376 I understand that the Mach-O linker is not under active development, but there must be some way to work around this bug. Does anyone have a clue? This trivial IR file gives "dyld: lazy symbol binding failed: bad lazy bind info" at runtime when linked with: lld -flavor darwin -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -pie -o ./tmp_exe ./tmp_exe.o -lSystem When linking with the system linker instead, with the same arguments, it works fine. IR file: target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-darwin-unknown" @0 = internal unnamed_addr constant [9 x i8] c"0: %llu\0A\00", align 1 ; Function Attrs: nounwind define i32 @main(i32, i8** nocapture nonnull readnone) local_unnamed_addr #0 { Entry: %putchar = call i32 @putchar(i32 10) %2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @0, i64 0, i64 0), i64 0) ret i32 0 } ; Function Attrs: nounwind declare i32 @printf(i8* nocapture readonly, ...) #0 declare i32 @putchar(i32) #0 attributes #0 = { nounwind } -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170322/98b6a63b/attachment.html>
Davide Italiano via llvm-dev
2017-Mar-22 19:05 UTC
[llvm-dev] LLD/Mach-O - how to work around this bug?
On Wed, Mar 22, 2017 at 9:59 AM, Andrew Kelley via llvm-dev <llvm-dev at lists.llvm.org> wrote:> I filed this bug today: https://bugs.llvm.org/show_bug.cgi?id=32376 > > I understand that the Mach-O linker is not under active development, but > there must be some way to work around this bug. Does anyone have a clue? > > This trivial IR file gives "dyld: lazy symbol binding failed: bad lazy bind > info" at runtime when linked with: > > lld -flavor darwin -demangle -dynamic -arch x86_64 -macosx_version_min > 10.10.0 -pie -o ./tmp_exe ./tmp_exe.o -lSystem >CC'ing the owners as they may have ideas. Please consider that lld MachO hasn't been touched in 6-9 months for anything real, at least. Even if you work around this bug, chances are you'll find many others. In other words, don't expect to be on par with ld64. -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare
Kevin Enderby via llvm-dev
2017-Mar-22 20:10 UTC
[llvm-dev] LLD/Mach-O - how to work around this bug?
Hello Andrew, If you want to try to figure out what is up with the lazy binding info you might try running top of tree llvm-objdump with -lazy-bind to see what error it gives you (that is with my change from Monday with r298292). The other thing you can do on a MacOS machine is: xcrun dyldinfo -opcodes ./tmp_exe to show the bind opcodes that the error message from llvm-objdump should be referring to. That may give you a start as to what is wrong if you want to try to fix the problem in lld. My thoughts, Kev> On Mar 22, 2017, at 12:05 PM, Davide Italiano via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > On Wed, Mar 22, 2017 at 9:59 AM, Andrew Kelley via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> I filed this bug today: https://bugs.llvm.org/show_bug.cgi?id=32376 >> >> I understand that the Mach-O linker is not under active development, but >> there must be some way to work around this bug. Does anyone have a clue? >> >> This trivial IR file gives "dyld: lazy symbol binding failed: bad lazy bind >> info" at runtime when linked with: >> >> lld -flavor darwin -demangle -dynamic -arch x86_64 -macosx_version_min >> 10.10.0 -pie -o ./tmp_exe ./tmp_exe.o -lSystem >> > > CC'ing the owners as they may have ideas. Please consider that lld > MachO hasn't been touched in 6-9 months for anything real, at least. > Even if you work around this bug, chances are you'll find many others. > In other words, don't expect to be on par with ld64. > > -- > Davide > > "There are no solved problems; there are only problems that are more > or less solved" -- Henri Poincare > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev