New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mingw gcc-6.2 ICE. #2473
Fix mingw gcc-6.2 ICE. #2473
Conversation
Wow, your name should be awesome ;) |
Needs testing. This is for 3.9 ? |
Yea, untested so far. Change is in boost, as awson mentioned himself, so it might even need discussion ;) It's not trivial to test, because it requires a fitting build environment. |
@awson, I tried the build, and it breaks in hidapi for me: https://gist.github.com/bagong/dd42da9bf990bc11e621eb0a2a53a9f4 Unfortunately I won't be around to follow up on this during the next 2 months and it is therefore possible that you don't get much feedback on this interesting pull request, I am sorry to say. I like msys2, and it provides an interesting alternative for qt, as the msys2 maintainers provide webkit in qt5.6 too - which is not the case in the official Qt distribution. Oth I must also say, that there is a strong trend to move towards Visual Studio among the persons working for the Windows version of SC. So while it would be very cool of course, if you were interested in maintaining a MinGW/msys build, atm it will likely not be an effort with much help by others. |
Yeah, a couple of small patches to hidapi (and supercollider proper) is required. |
That would be great! |
…rhaps breaks old headers build).
Hi Awsome ( @awson )! Sorry for taking so long to follow up on this, but I should be ready now if you are still available! It's getting further and further. I get this error now:
|
Oof. The "cast loses precision" complaint used to be a warning, not an error. We should really cleanup things like that. Is there a strictness command-line parameter you can invoke to get around that complaint for now? |
@brianlheim : yes, |
Works! ;) |
SuperNova gets close, but not quite. It seemed to be happy with installing a special "workaround"-package for dynamic linking in a Windows environment (dlfcn), but then still complained with:
All in all it nevertheless feels we're close to MinGW/MSYS 64-bit build. I'd rather get that going and switch to msys2 than perpetuate the 'Qt-release-policy-dependant' MinGW build we're using for the 32-bit version atm. I'll look next how 32-bit-sc and sc3-plugins behave. |
sc32 and sc3-plugins 32 and 64bit build fine (supernova not tested). Using msys2 has another advantage: we're currently using portaudio with a hacked build system because our MinGW build requires cmake. The combination mingw/cmake isn't supported by PA. Switching to MSYS2 would allow to use the MSYS2-provided package on the MinGW side and build vanilla PA with Visual Studio - as supported by the PA maintainers. That would simplify SC-Portaudio maintenance significantly. Building SC with MSYS differs from a linux build only in that you need to specify "MSYS Makefiles" as generator for cmake. If you are used to arch linux, you already know the package manager (it's a pacman clone)... But supernova needs a bit of work... |
This is great, thank you for this @bagong! I did some googling ("msys libdl undefined reference __dl_open") and I think you have to add |
@awson thanks for this! Can you also submit this patch to the boost repo (https://github.com/boostorg/thread/blob/develop/include/boost/thread/executors/basic_thread_pool.hpp ) so that we don't get further out of sync w Boost? Thanks! |
Well, I've revised my (already old) patches and found an old one missed related to But I never ever had any problems with supernova – it was built without the hitch. Perhaps |
Thanks @awson for for staying in the loop. I was not suggesting to introduce -fpermissive globally, I just used to see how far I would get with it. Could you add your patch to this pull request (and maybe others of similar nature ;) )? I will look into the supernova problem, after all the main reason to keep up a MinGW build is supernova. Prior to the error-message I posted, I had another error claiming that dlfcn.h was missing. I worked around that by installing the package mingw-w64-i686-dlfcn, which in turn produced the error I reported. Should I uninstall the dlfcn package (which I think is controversial) again and go on from there (investigate -ldl) or is dlfcn required for the MSYS2 supernova build? |
@@ -49,7 +49,6 @@ | |||
#define basename win32_basename | |||
#define dirname win32_dirname | |||
#define pipe win32_pipe | |||
typedef int pid_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this breaks the VS build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I am not in a position to comment on this, I have verified that this fixes a long standing bug in the MinGW compiler line that blocked MinGW builds above gcc 4.82 on Master. We need this, and we cannot wait for boost... (we should keep track of boost changes, though...). I will submit a PR soon, that integrates the MSYS2 option into the SC Windows build system. Thank you very much, Awson!
PS: The supernova errors disappeared, but I did have to install the dlfc package in MSYS2/MinGW...
This means we have a working 64-bit MinGW build now, and the Qt55-Webkit block is removed on the MinGW line. If readline7 were working this would be the first feature complete Windows build including supernova ;)
I know I'm coming late to this, but I don't understand why the change had to be made in a Boost header; it's not apparent from the linked Gist. Is there a discussion somewhere else where this was diagnosed? |
Hmm, while the offending code is located further down the callstack than the code referred in the gist, the latter is a Boost header's code: |
But these warnings/errors are occurring within the context of translation unit PyrObject.cpp... In order to blame this on Boost someone would have to try compiling the Boost header in a less complex situation. This situation looks suspect (lines 43-54 of PyrObject.cpp): #include <boost/range/irange.hpp> // first boost include
#define BOOST_THREAD_VERSION 4 // define boost marcos without explanation
#define BOOST_THREAD_PROVIDES_EXECUTORS
#include <boost/thread/future.hpp> /* compiler error happens here */
#include <boost/thread/executor.hpp>
#include <boost/thread/executors/basic_thread_pool.hpp>
#ifdef _MSC_VER
#include <future> // ifdef'd include, also for `future`
#endif |
Well, this is enough to make gcc ICEing:
Nothing suspicious. Plain and simple gcc bug on purest Boost code. |
The versions of Boost headers/libraries in this repo span 1.0.45-1.0.61, and chrono, thread, and system are themselves from three close but different versions. So no, not exactly 'purest Boost code'... Anyway, I'm OK with this change since it's been so thoroughly tested and only affects minGW. |
Do we have an organized way of identifying boost patches in SC? I know of two for Windows (including this one). We could keep them somewhere for quick reference if ever a boost reform is done... |
I made a note of it in our projects here: https://github.com/supercollider/supercollider/projects/2#card-1643180 I would like somewhere a little more prominent... maybe we should just open an issue for updating the Boost libraries, and then we can collect this information there. |
I added the other patch (#2457) I know of. |
I've just checked. ICE is here for the latest and greatest stock-single-version-consistent-homogeneous-blessed-don't_know_what_else MSYS2/mingw64 boost-1.63 + gcc-6.3. |
It is at the super bowl too! :) |
I really appreciate you checking that, thank you. Sounds like if we wait long enough, ICE might not be a problem at all: |
Merged after lots of testing documented in #2704. |
This fixes mingw gcc-4.9+ ICE
I can now build HEAD supercollider with stock MSYS2 64-bit gcc compiler/libraries (no manual tools/libraries installation).
Perhaps, this should be submitted to
boost
in the first place, though.I've also guarded this with
__MINGW32__
since I'm not sure if another platform's GCCs suffer from the problem.