Tim Northover via llvm-dev
2018-May-31 07:54 UTC
[llvm-dev] Miscompilation while switching from clang-4 to clang-5
On 31 May 2018 at 08:41, Alex Denisov via llvm-dev <llvm-dev at lists.llvm.org> wrote:> I understand the linking problem. What I do not understand is how to debug the difference between two versions of compilers. > This what I do (briefly): > > clang++-4 foobar.cpp -lLLVM -l/opt/llvm-3.9/lib > > clang++-5 foobar.cpp -lLLVM -l/opt/llvm-3.9/libIf you add -v then Clang will output each individual command it runs to do that compilation (I'd expect 2: one compile step and one link step). As Tom & Michael said, the link step is most likely to be wrong. You could test that by mixing and matching the invocations (using the .o file produced by one version of Clang in the other link command for example). In the end though, I suspect you'll find it's linking against a different set of libraries now. Cheers. Tim.
Michael Kruse via llvm-dev
2018-Jun-01 17:32 UTC
[llvm-dev] Miscompilation while switching from clang-4 to clang-5
2018-06-01 2:06 GMT-05:00 Alex Denisov <1101.debian at gmail.com>:> If there are any other hints: send them my way :)Debug with gdb, but a breakpoint at https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/Utils/SymbolRewriter.cpp#L91. It should hit twice (which is the error reported). At each break you can look at where the machine code is coming from (e.g. a shared object), and which static analyzer calls it. Michael