SRI-CSL/gllvm

Injecting additional llvm-link flags

woodruffw opened this issue ยท 5 comments

Is there any interest in introducing an additional environment variable that would allow a user to inject additional flags for each llvm-link invocation?

My particular use case: I have a collection of build systems that I have minimal control over, and I'd like to produce bitcode modules for each of them. These bitcode modules are then fed into a static analysis system. Some modules trigger pathological cases in the system, particularly when they contain huge numbers of unused functions and global tables. I'd like to pass -only-needed to llvm-link to prune those functions and globals whenever possible.

I'm happy to work on this feature, if there's interest!

(Another example of a potentially useful injectable flag is -internalize, which attempts to steamroll through linkage clashes by making extern symbols into private ones.)

I have no problem with this. You can never have enough environment variables right?

LLVM_LINK_FLAGS

I eagerly await a pull request :-)

Excellent! I'll take a stab at this tomorrow.

And yep, everybody knows that environment variables are a reliable and low-cognitive-overhead way to extend the functionality of one's programs ๐Ÿ˜‰

Opened #51 with the changes.