Closed xd009642 closed 2 years ago
The problem is that __llvm_profile_register_function
already exists in the codegen unit when LLVM adds a new one as an external reference. Since there is a name conflict LLVM adds a .1
, .2
to the name. LLVM is getting a bit confused because it expects that function to be in an external runtime library, not in the same code it's compiling right now.
Ah that makes sense, thanks for the quick fix :+1:
I'm sure this is probably also the case for other similar targets but I've only tried for this target hence the issue. When attempting to build minicov for an embedded target with no OS I encounter linker errors. I'll put the full printout from the bottom for the symbols it can't find are:
I see both of these are implemented in the rust code so I wasn't quite sure what was going on there. However, I removed those implementations and moved them into the C code (https://github.com/xd009642/minicov/tree/working-on-arm) and now it builds fine without linker errors. Kinda curious what's happening here because as far as I can see both ways of doing it should lead to the same symbols added to the binary :thinking: