Page MenuHomePhabricator

[MinGW] Use lib prefix for libraries
ClosedPublic

Authored by mati865 on Sep 11 2020, 7:57 AM.

Details

Reviewers
JDevlieghere
mstorsjo
Group Reviewers
Restricted Project
Commits
rGcc76965b1908: [MinGW] Use lib prefix for libraries
Summary

In MinGW world, UNIX like lib prefix is preferred for the libraries. This patch adjusts CMake files to do that.

Diff Detail

Event Timeline

mati865 created this revision.Sep 11 2020, 7:57 AM
mati865 requested review of this revision.Sep 11 2020, 7:57 AM
mati865 edited the summary of this revision. (Show Details)
mati865 updated this revision to Diff 291224.Sep 11 2020, 8:10 AM

Also adjusted llvm-config.

What's the practical effect of this? I see that a number of libraries already have a lib prefix prepended, like libclang/liblldb - I presume this changes the name of the individual libs (for BUILD_SHARED_LIBS=TRUE configurations)?

mati865 added a comment.EditedSep 11 2020, 1:06 PM

I haven't tried BUILD_SHARED_LIBS=TRUE TBH.

Effects visible at first glance:

bin/LLVM.dll          -> bin/libLLVM.dll
bin/LTO.dll             -> bin/libLTO.dll
lib/liblibclang.a      -> lib/libclang.a
lib/liblibclang.dll.a  -> lib/libclang.dll.a
lib/libliblldb.dll.a    -> lib/liblldb.dll.a

I'll create 2 clean build directories and diff them for more precise info.

mstorsjo accepted this revision.Sep 11 2020, 1:29 PM

This looks good to me! I can push it later.

This revision is now accepted and ready to land.Sep 11 2020, 1:29 PM
mati865 added a comment.EditedSep 11 2020, 3:07 PM

-DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_BUILD_LLVM_DYLIB=1 with only this patch applied (< is before, > is after):

$ diff <(cd ../build && find ./ | sort) <(cd ../build2/ && find ./ | sort)
38a39,41
> ./bin/libLLVM.dll
> ./bin/libLTO.dll
> ./bin/libRemarks.dll
51d53
< ./bin/LLVM.dll
119d120
< ./bin/LTO.dll
123d123
< ./bin/Remarks.dll
1460a1461
> ./lib/libclang.dll.a
1500,1501c1501
< ./lib/liblibclang.dll.a
< ./lib/libliblldb.dll.a
---
> ./lib/liblldb.dll.a

-DLLVM_ENABLE_PROJECTS="clang;lldb" -DBUILD_SHARED_LIBS=1:
long diff

This revision was automatically updated to reflect the committed changes.