[PATCH] D14543: llvm-config: Explicitly flush ostream so output can be piped into other programs.

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 11:23:57 PST 2016

nhaehnle added a subscriber: beanz.
nhaehnle added a reviewer: beanz.
nhaehnle added a comment.

I ran into this **again** and decided to investigate a bit more. The root cause is r223805, which explicitly disables atexit for the dynamic library build.

This behaviour is controlled by LLVM_DISABLE_LLVM_DYLIB_ATEXIT, which tries to default to OFF when the tools (i.e. llvm-config) is linked against the dynamic library. As far as I can tell, the problem is basically that we did (as one is likely to do):

1. Set up a dylib build. This sets LLVM_DISABLE_LLVM_DYLIB_ATEXIT to ON.
2. Notice that all the tool executables become gigantic and turn on LLVM_LINK_LLVM_DYLIB.
3. Oops, CMake remembers the old setting of LLVM_DISABLE_LLVM_DYLIB_ATEXIT and llvm-config is now unusable from build scripts.

So while explicitly setting LLVM_DISABLE_LLVM_DYLIB_ATEXIT to OFF is a (extremely hard to discover) workaround, this really needs to be fixed somehow.


More information about the llvm-commits mailing list