Replies: 3 comments 16 replies
-
Well in fact i rebuilt allmost all packages for the TDM compiler plugin now and things work quite fine :) so i could setup a repository for it if wanted with a clone of the currrent mingw packages modified towards this. Had to build everything from scratch which was a major pain in the neck because we have so many circular dependencies now 🤕 but its upto speed with the current code and the only downside is that aslr is a nogo and probably allways will be as TDM's code for handling exceptions rely on a very odd way of doing shared memory access via atomic tables which do not like aslr one bit. The original code for this stems back from the days of mingw.org's first gcc port which was not able to do dll builds of the runtimes so they had to hack around this by allowing things that had been linked to the static runtimes to throw exceptions across dll boundaries. I replaced all integers in the code with code more appropriate for 64 bit compilers size_t uintptr_t etc. to try and get around the aslr problem but with little success so far. If someone can fix it completely i can upload the current patch for this feature for them to have a look at. |
Beta Was this translation helpful? Give feedback.
-
currently only 3 packages seem to have any problem linking to the static gcc runtimes -> ogre (though it seems this is a problem in ogre itself as the normal compiler also exhibits the same failures if i force it to link to the static runtimes) -> scite and this one has me a bit perplexed it newer opens but strangely there is no error gdb does not report anything either and even the evenlog says all is honky dory, if i replace libscilexer.dll with the one from the normal mingw gcc it works so wtf ?!?. -> lastly openshadinglanguage again no error is generated and im beginning to suspect the inclusion of clangs libunwind is making a mess of things because gcc's unwinder is linked directly into every dll and library (static linked runtimes remember...) this in turn seems to cause some rather annoying things like multiple definition errors when the source in question tries to link in libunwind. |
Beta Was this translation helpful? Give feedback.
-
so to debunk a few things dwarf is a little not a lot faster than sjlj when no exceptions are thrown, sjlj is a lot faster (<> 20%) when they are. prof has been posted at the winbuilds github ;). as for the TDM plugin, it works with either (dwarf or sjlj) if a dwarf build is the only thing accepted it will work with that also. SEH does not need the shared memory hack. ASLR is a bit wonky with the TDM compiler due to internal address randomization. |
Beta Was this translation helpful? Give feedback.
-
As you all probably know i been using an offshot of the compilers here based on TDM mingw, lately with gcc-10.2.0 it turned out the old patchset was no longer viable and i had to set for a more standard build which no longer defaulted to linking to the static gcc runtimes. I finally managed to get the patchset updated so they work with gcc-10.2.0 but as i discovered there are some things that need to be handled differently when building the mingw packages with this. For one if you have libunwind from clang in the compiler it will conflict pretty badly with gcc's libgcc.a because the TDM based compiler links to that by default the unwinders end up
linked into every library that supports exceptions and you get multiple definition errors as a result (glog is one example).
I created a modified pull of the packages from here which i modified for use with this compiler instead and i modified pacman's build chain to accept the TDM based compiler as a plugin (like the clang compiler). If there is interrest in it i could create packages for msys2 so that people who use it could. TDM uses shared memory to support casting exceptions across dll boundaries without having to link in the gcc runtime but it is not compatible with ASLR and probably newer will be so keep that in mind.
Beta Was this translation helpful? Give feedback.
All reactions