[PATCH] D102419: [MinGW] Always enable -mbig-obj for LLVM build unless using Clang

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 22:23:23 PDT 2021


mstorsjo added a comment.

In D102419#2758398 <https://reviews.llvm.org/D102419#2758398>, @mati865 wrote:

> Sorry I thought it's simple enough on it's own.
>
>> Previously this was only enabled for 64 bit cases (apparently because with SEH, there are a bit more individual sections than in non-SEH cases?). Does this stem from the fact that we enabled `-ffunction-sections`, which crosses the limit on i686 too?
>
> I just thought why not upstream the patch we've been carrying since 2018 at MSYS2. We have been having recurring error about sections limit, possibly related to some specific LLVM options.

Oh, ok, that’s certainly possible that we’re close to/past the limit even in i686 builds these days, even before that new option

> TBH I haven't tested it with main and we haven't enabled `-ffunction-sections`.
>
>> We don't enable it on clang at all (but we did before). IIRC the option is a no-op on clang, and big objects are created where needed only, right?
>
> Exactly, Clang was actually the main motivator to do something about it since there are over 100 useless warnings in our build saying: `clang: warning: argument unused during compilation: '-Wa,-mbig-obj' [-Wunused-command-line-argument]`.
>
> I can revert pointer size check because reproducing and reducing this issue is not worth the time it will take - we can carry it in the repo until we drop 32-bit support.
> Avoiding ~30% of the warnings in our build is more important thing for me.

Nah, I’m fine with changing it for 32 bit, it’s ok as a collateral change when touching this. But warnings in builds with clang was the reason I was looking for here. I’m not getting such warnings, that’s why I didn’t realize that this was the motivator.

My builds are done with “-Qunused-arguments", https://github.com/mstorsjo/llvm-mingw/blob/master/wrappers/clang-target-wrapper.sh#L89, because of how my wrapper sets defaults. But I can’t reproduce that warning even when bypassing my wrapper, e.g. “clang -target x86_64-w64-mingw32 -c -Wall -Wextra -Weverything -Wa,-mbig-obj test.c” doesn’t give such warnings.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102419



More information about the llvm-commits mailing list