[PATCH] D101568: [cmake] Use -ffunction-sections and -Wl,--gc-sections on MinGW targets

Mateusz MikuĊ‚a via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 16:37:38 PDT 2021


mati865 accepted this revision.
mati865 added a comment.

> If compiling with GCC or linking with ld.bfd, these options have little

effect

I have observed size reduction in another project using GCC+Binutils so it's a bit surprising to me.

> @mati865, do you use such builds in MSYS2, and will this be an issue

for you, if you'd upgrade to LLVM 13 and build it with LLVM/LLD 12?

We don't use `BUILD_SHARED_LIBS` but we do use `LLVM_BUILD_LLVM_DYLIB` and `LLVM_LINK_LLVM_DYLIB` if it matters.
I don't think this will be an issue, `gc-sections` fix seems important enough to backport it even on its own.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101568/new/

https://reviews.llvm.org/D101568



More information about the llvm-commits mailing list