When I run: sudo crossdev --target x86_64-w64-mingw32 I get: * getting sys-devel/gcc from /var/lib/layman/dlang which is my D language overlay. The gcc it builds is 6.4.0, but I would rather have the latest. It seems like it's getting the wrong gcc ebuild.
I think it's an intended behaviour to search overlays first. This option should define overlay search list: -oS, --overlays list Space delimited list of overlays to search [default: `portageq repositories_configuration`]
I admit to not being a gentoo expert yet, however it seems a little counter-intuitive that some random gcc ebuild from some random overlay, which is there for who-knows-what reason, would be built instead of the regular gentoo gcc sources.
I would be hesitant changing behaviour. We can work on making crossdev's output to be more straightforward to understand if the effect is desired or not.
So simple solution for me was: crossdev --gcc 8.2.0-r3 which was my current gentoo gcc. This also solved the problem of the wrong gcc being picked up from an overlay. I see a couple of possiblities here: - default to current main gcc version, this way an overlay version is still picked up for that version - require the user to pass wanted gcc version, perhaps they need to think about which gcc version they want in some situations
Never mind, that actually did nothing.
I tried --overlays gentoo and --overlays sys-devel and it still picks up the bad gcc version from dlang overlay.
To have any effect you might need to delete contents of the overlay. crossdev does not do much with overlay: on the first srun it builds minimal skeleton repo with directory symlinks pointing to original repo. It does not repoint symlinks afterwards. You can tweak symlinks manually as well. $ portage/cross/cross-i686-w64-mingw32:LANG=C ls -l total 20 lrwxrwxrwx 1 root root 41 Jan 17 2016 binutils -> /gentoo-ebuilds/gentoo/sys-devel/binutils lrwxrwxrwx 1 root root 36 Jan 17 2016 gcc -> /gentoo-ebuilds/gentoo/sys-devel/gcc lrwxrwxrwx 1 root root 36 Jan 17 2016 gdb -> /gentoo-ebuilds/gentoo/sys-devel/gdb lrwxrwxrwx 1 slyfox users 48 Apr 2 2017 ghc -> /home/slyfox/portage/gentoo-haskell/dev-lang/ghc lrwxrwxrwx 1 root root 47 Jan 17 2016 mingw64-runtime -> /gentoo-ebuilds/gentoo/dev-util/mingw64-runtime
Getting further now. First I disabled the dlang overlay with: sudo layman -D dlang Then I tried building the toolchain with crossdev again, but it failed on gcc stage2, because of some kind of bad interaction with the previously built toolchain most likely. So I removed the old toolchain with: eix -# 'cross*/*' | xargs sudo emerge -vC Looks like crossdev --clean does the same thing. Now it properly builds gcc 8.2.0-r3 which is my gentoo gcc. Having some issues with mingw64-runtime 6.0.0 now I'm trying to figure out.
So now that I know how to build this with the right gcc, I wanted to make a suggestion. This is the initial crossdev output for me with the dlang overlay enabled: rkitover@epyc ➤ sudo crossdev --target x86_64-w64-mingw32 - * crossdev version: 20180918 * Host Portage ARCH: amd64 * Target Portage ARCH: amd64 * Target System: x86_64-w64-mingw32 * Stage: 4 (C/C++ compiler) * USE=multilib: no * ABIs: amd64 * binutils: binutils-[latest] * gcc: gcc-[latest] * libc: mingw64-runtime-[latest] * CROSSDEV_OVERLAY: /var/lib/layman/dlang * PORT_LOGDIR: /var/log/portage * PORTAGE_CONFIGROOT: / * Portage flags: There is no indication that some old version of gcc is being used, would it be possible to replace the [latest] tags with the actual version? It seems that by default, some random overlay gets used for the cross symlinks, so you have no way of knowing that the wrong overlay is being used. Versions for the toolchain would at least indicate that a wrong version was being used for something for some reason.
Yeah, calling something like $ portageq best_version ${EPREFIX} sys-devel/gcc::${OVERLAY} from crossdev should show exact version.