On Thu, 6 Feb 2025, Jacek Caban wrote:

On 5.02.2025 14:33, Martin Storsjö wrote:
Ideally, we wouldn't need to use assembly for things like this;
ideally we should set -fno-builtin for the relevant source files.
However, with automake, it is not easy to set such an option
specifically for one individual file, and it is not possible to
activate specifically -fno-builtin with either a pragma or an
optimize attribute in the source files.


I agree that would be better. Automake allows setting custom CFLAGS for an entire library, so one workaround could be building that file as a separate static library and merging it into the intended one. It's a bit annoying, but since you mentioned it would help in more cases, maybe we should do it anyway.

The reason for why I'm very hesitant to do this, is because we already have a huge combinatorial explosion for the various libraries in here.

We have a couple major CRT variants, and if counting all msvcr DLLs, there's probably at least a dozen of them. Then we have 4 architecture variants of most of them (each with a slightly different set of functions). If we'd need to split out a separate part of each of them, for functions that must be compiled with -fno-builtin, we'd essentially double the number of individual libraries and lists of files.

So I'm not really very keen on doing that.

The alternative would be to build all of the CRT libraries with -fno-builtin; we did that at some point (for specifically this reason), but I guess that it does inhibit some potentially useful optimizations in all the other files that don't need it.

// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to