This repository was archived by the owner on Aug 3, 2021. It is now read-only.
Fix compilation on gcc-mingw-w64 8.3 (debian buster)#1
Closed
thaJeztah wants to merge 1 commit intodocker-archive:masterfrom
Closed
Fix compilation on gcc-mingw-w64 8.3 (debian buster)#1thaJeztah wants to merge 1 commit intodocker-archive:masterfrom
thaJeztah wants to merge 1 commit intodocker-archive:masterfrom
Conversation
Debian buster installs gcc-mingw-w64 8.3, causing compilation to
fail due to the hard-coded path for includes.
```
In file included from /usr/x86_64-w64-mingw32/include/minwindef.h:163,
from /usr/x86_64-w64-mingw32/include/windef.h:8,
from /usr/x86_64-w64-mingw32/include/windows.h:69,
from containerutility.h:3,
from argumentstream.cpp:1:
/usr/x86_64-w64-mingw32/include/winnt.h:1554:11: fatal error: x86intrin.h: No such file or directory
# include <x86intrin.h>
^~~~~~~~~~~~~
compilation terminated.
```
Note that instead of adding a manual path to this list, compilation also
succeeds if the `-nostdinc` option is removed (which makes `gcc-mingw-w64`
search the standard paths:
```
x86_64-w64-mingw32-g++ -print-search-dirs
install: /usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/
programs: =/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/:/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/:/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/../../../../x86_64-w64-mingw32/bin/x86_64-w64-mingw32/8.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/../../../../x86_64-w64-mingw32/bin/
libraries: =/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/8.3-win32/:/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/../../../../x86_64-w64-mingw32/lib/
x86_64-w64-mingw32-g++ -fno-exceptions -std=c++11 -static -DUNICODE -municode -O3 -s -o containerutility.exe argumentstream.cpp commands.cpp containerutility.cpp identity.cpp version.cpp
echo $?
0
```
I decided to keep the current approach, assuming that specifying these paths, and
explicitly excluding the standard paths was done for a reason. That said, if there
is no specific reason, we might want to opt for the last option, as it is more
flexible and doesn't depend on hard-coded paths (which may change in future
updates).
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
This was referenced Jan 7, 2020
Member
Author
|
After discussing this with @chris-crone, we couldn't come up with reasons to exclude the standard paths, and I decided to open an alternative PR: #2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
relates to moby/moby#39880
Debian buster installs gcc-mingw-w64 8.3, causing compilation to fail due to the hard-coded path for includes.
Note that instead of adding a manual path to this list, compilation also succeeds if the
-nostdincoption is removed (which makesgcc-mingw-w64search the standard paths:With the
-nostdincremoved, compilation is successfulI decided to keep the current approach, assuming that specifying these paths, and
explicitly excluding the standard paths was done for a reason. That said, if there
is no specific reason, we might want to opt for the last option, as it is more
flexible and doesn't depend on hard-coded paths (which may change in future
updates).