Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via or IRC
Bug 644556 - dev-util/mingw64-runtime USE=tools fails bootstrap (or builds target binaries), gendef and genidl are compiled for Windows
Summary: dev-util/mingw64-runtime USE=tools fails bootstrap (or builds target binaries...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
Depends on:
Reported: 2018-01-14 15:35 UTC by hanetzer
Modified: 2020-05-05 20:52 UTC (History)
2 users (show)

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

runtime build.log (build.log,18.53 KB, text/plain)
2019-02-19 02:29 UTC, Fedja Beader
runtime config.log (config.log,11.71 KB, text/plain)
2019-02-19 02:30 UTC, Fedja Beader
what it says on the tin (cross-i686-w64-mingw32-mingw64-runtime.log,18.48 KB, text/plain)
2019-02-19 02:31 UTC, Fedja Beader
cross-x86_64-w64-mingw32-mingw64-runtime.log (cross-x86_64-w64-mingw32-mingw64-runtime.log,19.57 KB, text/x-log)
2020-05-05 17:58 UTC, anna

Note You need to log in before you can comment on or make changes to this bug.
Description hanetzer 2018-01-14 15:35:03 UTC
Per a discussion with ktietz (mingw-w64 developer) in when mingw-w64 is compiled as
a cross-compiler on linux the gendef/genidl tools are
supposed to be compiled as native ELF binaries and not
cross-compiled as win32 pe executables.
Comment 1 Fedja Beader 2019-02-19 02:29:16 UTC
Created attachment 565808 [details]
runtime build.log
Comment 2 Fedja Beader 2019-02-19 02:30:09 UTC
Created attachment 565810 [details]
runtime config.log
Comment 3 Fedja Beader 2019-02-19 02:31:28 UTC
Created attachment 565812 [details]
what it says on the tin
Comment 4 Sergei Trofimovich gentoo-dev 2019-02-19 07:48:20 UTC
Was original bug report about build failure?
Comment 5 Sergei Trofimovich gentoo-dev 2019-02-19 07:53:50 UTC
(In reply to Fedja Beader from comment #3)
> Created attachment 565812 [details]
> what it says on the tin

> configure:3432: i686-w64-mingw32-gcc -O2 -pipe -fomit-frame-pointer -march=core2  -I/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-6.0.0-r1/temp/tmproot/include -Wl,-O1 -Wl,--as-needed conftest.c  >&5
> /usr/libexec/gcc/i686-w64-mingw32/ld: cannot find crt2.o: No such file or directory
> /usr/libexec/gcc/i686-w64-mingw32/ld: cannot find -lmingw32

Do you have full cross-compiler installed to use USE=tools?

Try 'USE=-tools crossdev ...' if it works.
Comment 6 Fedja Beader 2019-02-19 19:38:24 UTC
USE="-tools -hardened" FEATURES="-fail-clean" crossdev --ov-output /var/portage/crossdev/ --overlays gentoo  -t i686-w64-mingw32

Produces a toolchain without failure.
Comment 7 Sergei Trofimovich gentoo-dev 2019-02-19 22:04:26 UTC
Thank you! Let's see if we can just skip tools building at headers-only stage.
Comment 8 hanetzer 2019-02-21 15:48:13 UTC
(In reply to Sergei Trofimovich from comment #4)
> Was original bug report about build failure?

No, it was about a 'successful' build which built the genidl/etc
executables as windows binaries which are 'unusable' (without wine
or so) on linux.
Comment 9 Sergei Trofimovich gentoo-dev 2019-02-22 20:50:31 UTC
Thank you! Updated the title.
Comment 10 Luke-Jr 2020-04-20 14:59:55 UTC
(In reply to Sergei Trofimovich from comment #7)
> Thank you! Let's see if we can just skip tools building at headers-only
> stage.

They already seem to be.

But this fails at *any* stage, because it's trying to build them for the wrong platform (which isn't bootstrapped yet)
Comment 11 anna 2020-05-05 17:58:38 UTC
Created attachment 636272 [details]
Comment 12 anna 2020-05-05 18:03:25 UTC
I am having this issue as well, it seems to be trying to build for a target that doesn't exist yet. I have tried all sorts of things but no workaround gets this to work and it is difficult to find anyone who knows anything about it, and mostly it just seems what it is trying to do is bizarre, as checking for whether the c compiler is capable of making an executable seems antiethical to the entire point of mingw in the first place.
Comment 13 tt_1 2020-05-05 18:37:54 UTC
you might want to try to bootstrap the whole toolchain with USE="-tools" (flipping  the libraries use flag might be also a good choice) and readd the useflags to cross-x86_64-w64-mingw32/mingw64-runtime when you're done with that. This way it should build, but the tools are still build as executables for windows.
Comment 14 Sergei Trofimovich gentoo-dev 2020-05-05 20:52:24 UTC
(In reply to anna from comment #11)
> Created attachment 636272 [details]
> cross-x86_64-w64-mingw32-mingw64-runtime.log

I see you have --with-tools enabled. How do you enable USE=tools? Is it intentional?