Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 544518 - profiles/prefix/windows/winnt: invalid KERNEL="Winnt Interix" value
Summary: profiles/prefix/windows/winnt: invalid KERNEL="Winnt Interix" value
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-25 22:15 UTC by Michael Seifert
Modified: 2015-05-29 09:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Seifert 2015-03-25 22:15:13 UTC
When trying to cross-compile a CMake based ebuild for the x86_64-w64-mingw32 target, the resulting gentoo_toolchain.cmake contains the line
SET (CMAKE_SYSTEM_NAME "Winnt Interix")
whereas it should be
SET (CMAKE_SYSTEM_NAME "Windows")

The error could possibly be related to bug #503216 or the profile settings.

Reproducible: Always

Steps to Reproduce:
1.crossdev --gcc 4.7.4 --ov-output /usr/local/portage/ -t x86_64-w64-mingw32
2. pushd /usr/x86_64-w64-mingw32
3. ln -s /usr/portage/profiles/prefix/windows/winnt/6.1 etc/portage/make.profile
4. ln -s /usr/portage usr/portage
5. popd
6. x86_64-w64-mingw32-emerge --nodeps <cmake based ebuild>
Actual Results:  
Configure fails, because CMake cannot find an appropriate platform file:
"System is unknown to cmake, create:
Platform/Winnt Interix to use this system, please send your config file to cmake@www.cmake.org so it can be added to cmake"

Expected Results:  
Configure runs without error

cmake-utils.eclass looks at the KERNEL variable to determine the system name.

# grep -r "KERNEL" /usr/portage/profiles/prefix/windows/
/usr/portage/profiles/prefix/windows/cygwin/make.defaults:KERNEL="Cygwin"
/usr/portage/profiles/prefix/windows/winnt/make.defaults:KERNEL="Winnt"
/usr/portage/profiles/prefix/windows/interix/make.defaults:KERNEL="Interix"
Comment 1 Michael Seifert 2015-03-25 22:21:41 UTC
Sorry, the initial description is a little confuse :)
What I was trying to say is that:
1. It looks like a regression, because it used to work sometime last October
2. cmake-utils.eclass should actually turn the KERNEL="Winnt" into the correct CMAKE_SYSTEM_NAME="Windows", but it doesn't
Comment 2 Michael Palimaka (kensington) gentoo-dev 2015-03-27 17:24:24 UTC
CCing prefix in case they have any comment.
Comment 3 Michael Seifert 2015-05-27 08:15:08 UTC
Does anyone have an idea why CMAKE_SYSTEM_NAME is set to "Winnt Interix", even though there is no platform file in CMake?

I take it that Winnt and Interix are different profiles. Yet, the KERNEL variable in cmake-utils.eclass seems to have the same value (i.e. "Winnt Interix").

Hints for debugging would also be appreciated.
Comment 4 Michael Haubenwallner (RETIRED) gentoo-dev 2015-05-27 11:13:00 UTC
(In reply to Michael Seifert from comment #0)
> Steps to Reproduce:
> 1.crossdev --gcc 4.7.4 --ov-output /usr/local/portage/ -t x86_64-w64-mingw32
> 2. pushd /usr/x86_64-w64-mingw32
> 3. ln -s /usr/portage/profiles/prefix/windows/winnt/6.1
> etc/portage/make.profile

NOTE: The prefix/windows/winnt profile is *not* intended for any MinGW toolchain, but the native Windows toolchain (Visual Studio) wrapped by Parity (https://github.com/mduft/parity) only. The problem here is that currently I'm not aware (haven't checked recently) of any working (stable enough to run a buildbot slave) POSIX build environment running on some current Windows (Server 2012R2), like it was with Interix on Windows Server 2003R2 or Cygwin on Windows 2000. As MSVC does not work with Wine, Markus tried hard to use a Linux (virtual) machine to remotely (ssh) call the MSVC toolchain - with both the Linux and Windows machine accessing the the same filesystems, but that approach turned out to be too unstable due to filesystem synchronisation problems.

> 6. x86_64-w64-mingw32-emerge --nodeps <cmake based ebuild>

As I'm bound to Windows Server 2003R2 for now, I'm definitively interested in building for a current Windows target, ideally using the Microsoft toolchain. If it turns out there is no stable enough POSIX build system on Windows any more, my fallback would be some MinGW target.

> # grep -r "KERNEL" /usr/portage/profiles/prefix/windows/
> /usr/portage/profiles/prefix/windows/cygwin/make.defaults:KERNEL="Cygwin"
> /usr/portage/profiles/prefix/windows/winnt/make.defaults:KERNEL="Winnt"
> /usr/portage/profiles/prefix/windows/interix/make.defaults:KERNEL="Interix"

So you really should create some new profile for w64-mingw32.
As far as I'm aware of, we should preserve profile-namespaces for MinGW (32-bit), MinGW-W64 (64-bit), MinGW32-W64 (32-bit), probably along:
profiles/prefix/windows/mingw/
profiles/prefix/windows/mingw-w64/
profiles/prefix/windows/mingw-w64/32/
Comment 5 Michael Seifert 2015-05-27 11:43:10 UTC
I see, so the profile is not meant to be used with MinGW (even though I successfully did :).
I will try setting up a custom profile then. In my case this would be mingw-w64.
Thanks for the clarification!

Independently of my misuse, it still seems strange that the KERNEL variable becomes "Winnt Interix" instead of just "Winnt" which is set in the selected profile in "prefix/windows/winnt/make.defaults".

However, if this behaviour is not a bug, I will happily mark this ticket as resolved.
Comment 6 Michael Haubenwallner (RETIRED) gentoo-dev 2015-05-27 12:19:24 UTC
(In reply to Michael Seifert from comment #5)
> Independently of my misuse, it still seems strange that the KERNEL variable
> becomes "Winnt Interix" instead of just "Winnt" which is set in the selected
> profile in "prefix/windows/winnt/make.defaults".

This indeed is a bug.

IMO, "Interix Winnt Cygwin" should not be KERNEL values, but ELIBC values only, while KERNEL should be "Windows" for all these.
Comment 7 Michael Haubenwallner (RETIRED) gentoo-dev 2015-05-27 13:08:29 UTC
(In reply to Michael Haubenwallner from comment #6)
> IMO, "Interix Winnt Cygwin" should not be KERNEL values, but ELIBC values
> only, while KERNEL should be "Windows" for all these.

Probably KERNEL="Windows" is too unspecific, I'll stay with KERNEL="Winnt".

The only package found in gx86 using "kernel_Interix" is x11-themes/nimbus:
--- nimbus-0.1.7-r1.ebuild
+++ nimbus-0.1.7-r1.ebuild
@@ -25,3 +25,3 @@
        !gtk? ( ${AUTOTOOLS_DEPEND} )
-       kernel_Interix? ( ${AUTOTOOLS_DEPEND} )"
+       elibc_Interix? ( ${AUTOTOOLS_DEPEND} )"
 
@desktop-misc: Ok to update?
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2015-05-28 16:18:37 UTC
Sure.