Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 725642 - crossdev's use of embedded profile for mingw breaks cmake
Summary: crossdev's use of embedded profile for mingw breaks cmake
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Crossdev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-27 16:57 UTC by Mark Harmstone
Modified: 2020-05-28 06:51 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 Mark Harmstone 2020-05-27 16:57:04 UTC
At the moment, x86_64-w64-mingw32-emerge doesn't work for a number of packages that use cmake (e.g. dev-cpp/nlohmann_json). Because CMAKE_SYSTEM_NAME gets set to "Linux" rather than "Windows", the WIN32 conditional variable doesn't function as expected.

The root cause of this is the symlink of /usr/x86_64-w64-mingw32/etc/portage/make.profile to /usr/portage/profiles/embedded, which has kernel_linux hardcoded in /usr/portage/profiles/embedded/use.force. The suggestion in the Wiki to set KERNEL="-linux Winnt" in make.conf doesn't work, and confuses cmake even further.

I suggest that we probably need a dedicated mingw profile, identical to embedded but with kernel_Winnt forced instead of kernel_linux, and that crossdev should symlink to this instead.

Reproducible: Always
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-27 22:08:25 UTC
KERNEL="-linux Winnt" in make.conf suggestion is probably incorrect. These should be profiles variables only.

Note that crossdev already creates a small profile overlay to account for the offset:

"""
$ for f in /usr/i686-w64-mingw32/etc/portage/profile/*; do echo "#$f"; cat $f; done

#/usr/i686-w64-mingw32/etc/portage/profile/make.defaults
ARCH="x86"
KERNEL="-linux Winnt"
ELIBC="mingw"
#/usr/i686-w64-mingw32/etc/portage/profile/package.provided
#/usr/i686-w64-mingw32/etc/portage/profile/use.force
-kernel_linux
kernel_Winnt
"""

Please provide example faulty build.log and ${CTARGET}-emerge --info. That would help me to reproduce it locally.
Comment 2 Mark Harmstone 2020-05-27 23:50:27 UTC
That file wasn't there for me, but when I cleaned the overlay and rebuilt it it showed up. Sorry for this, you've obviously fixed it already. Thanks for responding quickly.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-28 06:51:08 UTC
No problem. Was probably fixed in https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=393e1cd0c6d3ac81fa166bafe6065d42849f622c

Yeah, stale overlay metadata keeps biting users. We should probably add something to cross-emerge to suggest overlay's regeneration when major changes like that happen.