This is an archive of the discontinued LLVM Phabricator instance.

Give shared modules in unittests the platform-native extension, make PipSqueak a MODULE
ClosedPublic

Authored by thakis on May 15 2018, 10:57 AM.

Details

Reviewers
philip.pfaffe
Summary

As far as I can tell from revision history, there's no good reason to call these files .so instead of .dll in Windows, so use the normal extension.

Also change PipSquak from SHARED to MODULE -- it's never passed to target_link_libraries() and only loaded via dlopen(), so MODULE is more appropriate. This makes it possible to delete a workaround for SHARED ldflags being not quite right as well.

No intended behavior change.

Diff Detail

Event Timeline

thakis created this revision.May 15 2018, 10:57 AM

Fundamentally looks good, but I'm slightly concerned about using different macros in the Code (LTDL_SHLIB_EXT) vs. in the build (LLVM_PLUGIN_EXT). Right now those are identical, but it might change. Can we export LLVM_PLUGIN_EXT in config.h?

How about I use LTDL_SHLIB_EXT instead of LLVM_PLUGIN_EXT in the cmake files? (I'm not sure why we have both, they're set to the same thing: http://llvm-cs.pcc.me.uk/cmake/modules/HandleLLVMOptions.cmake#132)

Since this is only for the testcase, sounds perfect!

Aha, they used to be different before https://reviews.llvm.org/rL201316

In theory, I suppose LLVM_PLUGIN_EXT is more correct with that history, but in practice I suggest I use LTDL_SHLIB_EXT here and then replace LLVM_PLUGIN_EXT with LTDL_SHLIB_EXT everywhere else (not too many uses) in a follow-up since in the LLVM build shared libraries and loadable modules have the same extension.

thakis updated this revision to Diff 147113.May 16 2018, 9:28 AM

LTDL_SHLIB_EXT

This revision is now accepted and ready to land.May 16 2018, 9:30 AM
thakis closed this revision.May 16 2018, 9:32 AM

r332487, thanks!