-
Notifications
You must be signed in to change notification settings - Fork 284
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
MinGW / MSYS2 build fails for v0.26 with gcc 8.2.0 #421
Comments
Unless you run cmake with |
And that's in src/error.cpp:
The By happy coincidence, I want to do some maintenance work tomorrow on MinGW in preparation for v0.27 RC1 which I hope to publish in September. I have a puzzle to solve with MinGW/regex/version.cpp and I want to update the build notes concerning MinGW. Let me see what I can discover and I'll give you an update tomorrow. |
Gentlemen:
Incidentally there's code in config.h to refuse to build UNICODE with MinGW. Tobias (one of the darktable engineers) asked me to remove that. He's right. I'll deal with that tomorrow when I'm doing the MinGW maintenance. When you build the default (no UNICODE), you get one setMsg() entry point (as I deduced above by looking at the code). This is a mysterious matter. I can't seriously entertain the idea that the name-mangler in GCC 8.2.0 is defective. Today @D4N pointed me to a public/legal Windows 10 VM with Visual Studio. I'll use a nice clean machine tomorrow and install GCC 8.2.0. |
Dear @clanmills , thanks! I'm super happy about your progress! I've previously used the build instructions from https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-exiv2/PKGBUILD but I don't know if they work around enabled/disabled UNICODE (most likely not). Any help is greatly appreciated. I've also reported the issue here downstream here: https://github.com/Alexpux/MINGW-packages/issues/4338 |
I'm pleased that you are pleased! I supported MinGW (msys/1.0) for Qt affectionados. After we released v0.26 in April 2017, I came to the conclusion that MinGW (msys/1.0) was trouble, trouble, trouble. Even building CMake on MinGW required manually altering a Microsoft SDK header file. Tobias assured me that MSYS2 worked, although I was unable to build Exiv2 on that platform. A discussion with @Hombre57 in June 2018 resolved that and MSYS2 now builds OK. #370 I will read the Alexpux document tomorrow when I update README.md with the information in #370. Fixing config.h is trivial. Comment off the error line:
I hope to submit that (and other fixes) tomorrow. |
I just noticed something suspicious in your error line: Since gcc6, the default standard is c++14: https://gcc.gnu.org/gcc-6/changes.html |
Good Idea @piponazo The output from CMake is setting -std==gnu++98
It's really strange that the library has the symbol and it doesn't link itself! And it's only this one symbol. How odd!
I've been delayed by various matters (and had lots of help from @D4N and @piponazo). Hope to install GCC 8.2.0 on a clean machine on Sunday afternoon. |
I will check my configuration with respect to c++ standard. It is actually something I usually take care, to not mix and mingle too many standards, so there are some libraries where I set c++11 or 14. I'll check about exiv2, thanks for the very good pointer! |
I've reproduced this on a 'clean' machine. pacman installed GCC 8.2.0. I don't know how to "downgrade" the compiler. https://stackoverflow.com/questions/33969803/how-to-obtain-older-versions-of-packages-using-msys2
There's a significant difference in the symbols On 8.2.0 we see:
On 7.3.0, we see:
Note: 7.3.0 has BOTH The library doesn't have the entry It feels as though something in 8.2.0 is causing It's been a long day. I'll continue to investigate on Monday. |
Dear @clanmills , thanks for your detailed investigation, this is very interesting! To save some of your time, maybe it would now be time to involve some MSYS2 / MinGW core people in the discussion? Since the problem you found is so fundamental it may be a known issue? The MSYS2 mailing list (https://sourceforge.net/p/msys2/mailman/) may be a good place for discussion... |
I think this is a GCC issue. MinGW appears to be working fine. My suspicion is the compiler. Yesterday, when working on #421, I discovered entry points in Exiv2::Internal::Util were no longer in the library. We build the library as two entities:
I'm not an expert in CMake. I not sure how those are combined into a single library. I think the second This evening I will:
In the process of investigating those four subjects, I'll probably have more ideas. I'd prefer not to involve the MinGW/GCC forum in this investigation until I have run out of ideas for investigation as this will create even more email/discussion. Let's see what another day brings. |
There's no question about the problem.
On 8.2.0
The entry point is missing in 8.2.0. I don't know why it's missing. I'll do more work this evening. |
I've eliminated the following:
Running out of ideas. Why is this function a template? Perhaps a regular function, or an inline will fix this. |
Eureka. Static libraries build OK!
There something wrong with GCC/linker when it creates libexiv2.dll (and libexiv2.dll.a). The application exiv2.exe is in src/exiv2.cpp and links libexiv2.dll.a which doesn't have the import symbol I'm not sure if this is restricted to MinGW, or applies to GCC8 on Linux and/or Cygwin. I'm working hard to release Exiv2 v0.27 RC1 in September and it's been great to explore this issue on MinGW/msys2. To make the schedule, I have to document MinGW/msys2 requiring GCC 7.3.0. I'll put in the release notes that there is an outstanding issue with GCC8 and reference this discussion. May I ask you to take up this case with the GCC team. I hope we can find a solution for Exiv2 v0.27 GM which we hope to release at the end of 2018. |
Thank you for reporting this to Alexpux/MINGW-packages. I really like your precise definition of the puzzle. The dll symbols are quite different for exiv2 since gcc-8.2. Is this known or expected? On GCC 7.3.0:
On 8.2.0:
|
I would like to also report that I have recently experienced this issue. In MSYS2, the gcc package for 64 bits is gcc-8.2 while the one for 32 bits is gcc-7.2. With gcc-7.2 I can compile the full project without issues, but I stumbled into this linking error with gcc-8.2. @clanmills I think it would be good to point to this issue somewhere in the documentation you are writing in the RC1 branch. |
@piponazo For sure, this is going in the documentation. I've made good progress towards RC1 this week. The road is longer than I wanted/imagined. I have written a script (contrib/buildserver/build.sh) build all the packages on the 5 platforms (macosx, linux, cygwin, mingw and msvc). Next, I will fix the localtime/gmtime business for Gilles. Then I'll tackle the website and doxygen. There's still lots to do. I hope we'll have RC1 out in October and GM at the end of the year. Gilles added a load of work this week with the Exiv2Tags::groupList() and localtime.c. However it's good to have Gilles report these matters, because they would have appeared eventually. It's very unfortunate that Exiv2Tags::groupList() revealed a problem with Xcode 10.0. These things happen. |
When do you plan to release the 0.27 RC1 exactly ? Gilles Caulier |
I don't have an exact plan. I'm at home and working on this most of the time. I hope RC1 will be released by the end of October and GM by the end of December. You'll be aware that groupList() and localtime.c and other matters consumed a lot of time this week. And my wife's brother passed away yesterday. There are several major obstacles:
So, please be patient. I'm working on it. @piponazo and @D4N have been very helpful. |
Isn't the missing BasicError issue basically the same as #644 ? |
@phako You could be correct. The investigation here was on a Microsoft VM with a short (90 day?) license. I don't want to install GCC 8.2 on our Windows Buildserver (nor my laptop). I'll get a "fresh" VM from Microsoft and look at this. It would be great to get this solved. |
Hey folks, I have recently tried to cross compile exiv2 with mingw on Fedora (also with gcc 8.2.) and I am seeing exactly the same error as @emmenlau. The error only pops up when building a shared library, with a static library everything is fine. The resulting binary actually runs on Linux with wine and with some tweaking and cheating it might even pass the test suite. The culprit of this is I have yet to come up with a good solution for this, but I am afraid there is none. The imho best solution would be to just drop |
I agree with you Dan. I had that conversation with @piponazo earlier this week. I suspect that class was "templatized" when UNICODE_PATH was added. The wchar stuff is only to pass the pathname when a file doesn't open. I believe we can use I've installed a new Windows 10 VM on Parallels and (avr-)GCC 8.2 won't build anything. Puzzled. |
By the way, Dan. I'm confident that we will be able to run the test suite with wine on Linux. I intend that our GSoC student will deal with that when we adopt CTest and replace the bash scripts with your python code. |
Hi! Any chance this will get a happy ending? :-) I can have Exiv2 build with GCC 8.3.0 if I simply comment out the 4 calls to |
Jehan <notifications@github.com> writes:
Hi! Any chance this will get a happy ending? :-)
Not for 0.26, that one is out of maintenance.
For the upcoming 0.28 release we'll hopefully have
#685 merged, which should fix this
issue properly.
I can have Exiv2 build with GCC 8.3.0 if I simply comment out the 4
calls to `setMsg()` inside `src/error.cpp`. I have a hard time
understanding exactly why the linking errors though. If really a GCC
bug, has a report been opened there?
This is not a gcc bug, the issue is that we are mixing hidden visibility
and templates and that is a recipe for disaster (at least on Windows).
…
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#421 (comment)
|
Yes, this was raised with the GCC folks (by our user). However I'm not aware of a response. I trust Dan's judgement that visibility/templates are the culprit. |
Yeah I encountered the problem with last master commit. Should have mentioned that. ;-)
Awesome. Looking forward to this.
Ok. |
Folks. Here's the "discussion" of the issue: As you can see, sadly nobody investigated! I'm very proud of Team Exiv2. We quickly and thoroughly investigate everything reported. This issue is tough. @D4N is this solved on 'master'? |
I think we can close this now as historical trouble. |
Since the upgrade to gcc 8.2.0 I can not build exiv2 anymore. Maybe someone here has experience or an idea about the problem? If not, we can maybe just leave this issue hanging for other people to share insight?
With gcc 8.2.0 on MSYS2 I get the following linker error:
I checked the symbols in
libexiv2.dll
and there the symbol is defined:I do not know why the linker step could fail, and why only for this symbol. Is there a chance that this is related to a
char
vswchar
issue? But I did not mix and mingle object files, this is one consistent clean build.The text was updated successfully, but these errors were encountered: