[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2023-08-21 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo updated this revision to Diff 551957. mstorsjo added a comment. Herald added a subscriber: MaskRay. Updated as discussed, adding a new option `-fno-autoimport` (and the corresponding positive one, `-fautoimport`, which is the implicit default), which affects code generation and

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2023-07-25 Thread Jacek Caban via Phabricator via cfe-commits
jacek added a comment. `-fno-autoimport` sounds good to me. For linker implications, using `--disable-auto-import` in this case would seem consistent to me. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61670/new/ https://reviews.llvm.org/D61670

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2023-07-23 Thread Mateusz Mikuła via Phabricator via cfe-commits
mati865 added a comment. > If we make the flag imply linker options, then it becomes much clearer to > spot the error, if you enabled this but the code base still would need > autoimports somewhere. (This has happened - see >

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2023-07-18 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added subscribers: alvinhochun, jeremyd2019, jacek, aaron.ballman. mstorsjo added a comment. I'm looking to pick this up again - hopefully @rnk has time to discuss what would be a good way forward. So taking it from the top; both GCC and Clang generate `.refptr` stubs when referencing

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2023-06-23 Thread Alex Henrie via Phabricator via cfe-commits
alexhenrie added a comment. Herald added a project: All. Any update on this? The Wine project would like to omit the refptr symbols, see https://gitlab.winehq.org/wine/wine/-/merge_requests/3109 Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61670/new/

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2019-05-08 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. In D61670#1495535 , @rnk wrote: > Well, I'm curious what meaning GCC ascribes to a medium code model for COFF. > Do they generate code to allow PE images larger than 2GB, or is it more like > the ELF small code model, where

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2019-05-08 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. Well, I'm curious what meaning GCC ascribes to a medium code model for COFF. Do they generate code to allow PE images larger than 2GB, or is it more like the ELF small code model, where they assume everything can be reached with RIP relative addressing? Repository: rC

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2019-05-08 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Fair enough. On GCC, where the mingw x86_64 default code model is medium, switching it to small gave a small but not insignificant save in code size (around 9KB on a 1,3 MB DLL). On clang, where the default code model is small, getting rid of the extra refptrs didn't

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2019-05-08 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. I'm a little concerned about overloading the code model this way. Currently we have the levels tiny, small, medium, large. Default is the same as small in every way so far as I'm aware. On COFF, the code models are currently untested, so far as I know, and I've been

[PATCH] D61670: [RFC] [MinGW] Allow opting out from .refptr stubs

2019-05-08 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo created this revision. mstorsjo added a reviewer: rnk. Herald added a project: clang. In GCC, the .refptr stubs are only generated for x86_64, and only for code models medium and larger (and medium is the default for x86_64 since this was introduced). They can be omitted (for projects