This repository was archived by the owner on Aug 3, 2021. It is now read-only.
Use standard include paths instead of hard-coding#2
Merged
thaJeztah merged 1 commit intodocker-archive:masterfrom Feb 14, 2020
Merged
Use standard include paths instead of hard-coding#2thaJeztah merged 1 commit intodocker-archive:masterfrom
thaJeztah merged 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.
```
This patch removes the hard-coded paths to consider for includes, and instead
enables the standard include paths by removing the `-nostdinc` option.
With this option removed, the following paths are considered on Debian buster:
```
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/
```
And compilation succeeds without having to manually specify paths:
```
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
```
There might have been a specific reason for hard-coding the paths and excluding
the standard paths, but no history could be found for this.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Member
Author
|
ping @chris-crone @vikramhh @johnstep @ddebroy PTAL |
chris-crone
approved these changes
Jan 8, 2020
chris-crone
left a comment
There was a problem hiding this comment.
As discussed offline, LGTM.
It would be good to have someone more Windows (mingw) oriented to do a pass and let us know if we're missing something.
Member
Author
|
ping @simonferquel PTAL |
|
I don't have much experience with mingw, but building with default include headers seems likely to be the right thing to do. |
Member
Author
|
Discussed with @johnstep as well, and he also couldn't think of a reason for not using the standard paths. I'll merge this change. |
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.
alternative to #1
closes #1
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.
This patch removes the hard-coded paths to consider for includes, and instead
enables the standard include paths by removing the
-nostdincoption.With this option removed, the following paths are considered on Debian buster:
And compilation succeeds without having to manually specify paths:
There might have been a specific reason for hard-coding the paths and excluding
the standard paths, but no history could be found for this.
Signed-off-by: Sebastiaan van Stijn github@gone.nl