'“ multiple definition ” llvm pass

I used LLVM to write a pass in which I defined a function FUNC by inheriting modulePass that would record information about other functions in the file. I then compile the library, but get a multiple Definition error. I know this is because compiling each module independently defines FUNC once, so I get an error. But I want to know what I can do to avoid this error and achieve my goal of inserting a function in every executable.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source