Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] wine: could not load kernel32.dll, status c0000135
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
sidneypepo
n00b
n00b


Joined: 11 Dec 2021
Posts: 8

PostPosted: Sat Dec 11, 2021 9:09 pm    Post subject: [SOLVED] wine: could not load kernel32.dll, status c0000135 Reply with quote

Hello, how 'r u? :D
I'm new here haha :oops:

Well, I need some help with Wine... Basically, I'm trying to install Wine (following the Gentoo Wiki instructions) since, like, 4 months, and the installation completes with no errors, but, when I try to start a Windows PE (or run any Wine command), I always get this error message: "wine: could not load kernel32.dll, status c0000135" and this Wine error and behavior was present in every attempt to install it on every single one of my past Gentoo installations (including the actual one), and, after some fix attempts, now it also gives me this other message before the last one: "MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0".

I've been searching and researching other people with this same "kernel32.dll" problem (including in other distros) and tried to follow their solutions, but none of they works for me :cry:

Because of that, I don't really know what kind of information should I give about my software/hardware, but I asked about in #gentoo-wine and one of the chat members replied asking for some information that I'll share here too (with some other infos that may be important):

Q: Can you provide the output from any Wine run attempts?
A: https://dpaste.com/CHFFXS5HW#wrap.

Q: What filesystem is the Wine prefix on?
A: I didn't set one... It's on my user home on my ext4 partition.

Q: Which are your graphics cards? And which one you actually want to use?
A: My laptop has hybrid graphics card, an Intel and a NVIDIA. Note: I use Bumblebee instead default NVIDIA driver, because the default one sucks and doesn't run anything properly; I don't know what GPU should I use, because I really just wanna my Wine working in any of my they.

Q: Did Wine ever work for you with this set-up/hardware?
A: Some months ago, (with a Debian-based distro), Wine ran perfectly, but, since I finished any of my Gentoo installations, Wine never worked in any of them.

Q: Have you tried with a new, clean Wine prefix?
A: Yes, i tried to recreate some Wine prefixes (with and without changing Wine arch).

Q: Does anything at all run, like for example, winecfg?
A: The only Wine thing that actually works is Winetricks. winecfg, wineboot or any Wine command gives me the "wine: could not load kernel32.dll, status c0000135". When I run Wine after a --depclean or after recreate my wine prefix, it opens a Wine window and says something about it's configuring wine (the basic first wine startup default configuration), but after that, it closes and my terminal give me the "kernel32.dll" error message.

Q: Did you tried to emerge other Wine flavors? If yes, what happened?
A: I tried to emerge Wine Vanilla, but gave me the same error and behavior. I tried to emerge Wine Staging, and the same thing happened. I also tried to do again the last 2 items, but, at this time, with abi_x86_64 in my make.conf, and (again) the same thing...

Q: Have you tried to build Wine without Portage?
A: Yes, I already tried to compile Wine from it source (without emerge, following the WineHQ Wiki instructions), and the installation completes with no errors too, but when I ran Wine, it behavior and error was the same.

Q: Which Portage profile do you use in your system?
A: I installed my system with Hardened, but I actually use a custom combined one, Hardened-Desktop, created following this Gentoo Wiki instructions: https://wiki.gentoo.org/wiki/Profile_(Portage)#Example_1:_Combining_multiple_profiles_from_the_Gentoo_ebuild_repository.

Q: Can you provide the output from emerge --info wine-vanilla?
A: https://dpaste.com/EMA4A5S7U#wrap.

Q: Do you use -mingw in your USE Flags?
A: I didn't specified mingw in my USE flags, but this is the output when I add it and try to update my stuff with emerge -aquDU @world: https://dpaste.com/ALE92K5ZF#wrap.

Well, if those infos aren't enough, ask for more :wink:

If someone can help, I'll be really glad and grateful :D
Thanks in advance o/


Last edited by sidneypepo on Mon Dec 13, 2021 6:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2551
Location: Here and Away Again

PostPosted: Sun Dec 12, 2021 2:01 pm    Post subject: Reply with quote

Greetings (again) and welcome. :]

I may have been able to re-produce this with USE="-mingw", or something very similar in any case.

I remember I said that I probably wouldn't jump into it just yet, but did you try building with USE="mingw" yet aside from what you mentioned?
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
sidneypepo
n00b
n00b


Joined: 11 Dec 2021
Posts: 8

PostPosted: Sun Dec 12, 2021 4:56 pm    Post subject: Reply with quote

Hey Chiitoo :D/

Yes, I did. In the last Q&A item, I tried to add/specify the mingw USE flag: USE="$USE mingw", because seems that my Portage or Hardened-Desktop profile uses -mingw (even if I don't specify it). After include this USE flag (+mingw), I ran emerge -aquDU @world to update everything, so Wine vanilla asked for a rebuild (because I added the mingw USE flag), but this was the output: https://dpaste.com/ALE92K5ZF#wrap 8O

I don't know if it helps, but here is all my actual USE flags and my abi_x86_64 in my make.conf:
Code:
USE="X wayland bluetooth x265 dbus suid -gpm opengl vulkan ogg
     opus qml gles2 cli cuda java source driver tools python
     gdbm rar ffmpeg aalib usbredir spice vhost-net mtp fontconfig staging
     contrib vpx frei0r -ggdb mingw"

ABI_X86_64="32 64"
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2551
Location: Here and Away Again

PostPosted: Sun Dec 12, 2021 5:51 pm    Post subject: Reply with quote

The flag isn't enabled by default in the Wine ebuilds either.

And yeah, the error message you initially saw is normal, and gives you a suggestion on how to install MinGW:

Quote:
* USE="mingw" is currently experimental, and requires the
* 'cross-i686-w64-mingw32' compiler and its runtime for 32-bit builds.
*
* These can be installed by using 'sys-devel/crossdev':
*
* crossdev --target i686-w64-mingw32
*
* For more information on setting up MinGW, see: https://wiki.gentoo.org/wiki/Mingw

(And similar for 64-bit support.)

I guess you didn't try any of that yet?
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
sidneypepo
n00b
n00b


Joined: 11 Dec 2021
Posts: 8

PostPosted: Sun Dec 12, 2021 9:13 pm    Post subject: Reply with quote

Chiitoo wrote:
And yeah, the error message you initially saw is normal, and gives you a suggestion on how to install MinGW:

Quote:
* USE="mingw" is currently experimental, and requires the
* 'cross-i686-w64-mingw32' compiler and its runtime for 32-bit builds.
*
* These can be installed by using 'sys-devel/crossdev':
*
* crossdev --target i686-w64-mingw32
*
* For more information on setting up MinGW, see: https://wiki.gentoo.org/wiki/Mingw

(And similar for 64-bit support.)

I guess you didn't try any of that yet?


No, I didn't.

Okay, so I'm trying since 3 hours ago to do the described procedures in Gentoo Wiki to install Mingw, but for some reason it actually installs Crossdev, but crossdev --target x86_64-w64-mingw32 does some stuff and shows this: * error: mingw64-runtime failed with those log files: cross-x86_64-w64-mingw32-mingw64-runtime.log and cross-x86_64-w64-mingw32-info.log

Code:
$ doas crossdev --target x86_64-w64-mingw32
-                                                                                                                                                                                                     
 * crossdev version:      20210621
 * Host Portage ARCH:     amd64
 * Host Portage System:   x86_64-pc-linux-gnu (i686-pc-linux-gnu x86_64-pc-linux-gnu)
 * Target Portage ARCH:   amd64
 * Target System:         x86_64-w64-mingw32
 * Stage:                 4 (C/C++ compiler)
 * USE=multilib:          no
 * Target ABIs:           amd64

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * libc:                  mingw64-runtime-[latest]

 * CROSSDEV_OVERLAY:      /var/db/repos/crossdev
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /
 * Portage flags:         
                                                                                                                                                                                                     
 * leaving sys-devel/binutils in /var/db/repos/crossdev
 * leaving sys-devel/gcc in /var/db/repos/crossdev
 * leaving dev-util/mingw64-runtime in /var/db/repos/crossdev
 * leaving sys-devel/gdb in /var/db/repos/crossdev
 * leaving metadata/layout.conf alone in /var/db/repos/crossdev
                                                                                                                                                                                                     
 * Log: /var/log/portage/cross-x86_64-w64-mingw32-binutils.log
 * Emerging cross-binutils ...                                                                                                                                                                  [ ok ]
 * Log: /var/log/portage/cross-x86_64-w64-mingw32-mingw64-runtime-headers.log
 * Emerging cross-mingw64-runtime-headers ...                                                                                                                                                   [ ok ]
 * Log: /var/log/portage/cross-x86_64-w64-mingw32-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                                                                                                                                [ ok ]
 * Log: /var/log/portage/cross-x86_64-w64-mingw32-mingw64-runtime.log
 * Emerging cross-mingw64-runtime ...

 * error: mingw64-runtime failed :(
 *
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-x86_64-w64-mingw32-info.log
 * /var/log/portage/cross-x86_64-w64-mingw32-mingw64-runtime.log.xz
 * /var/tmp/portage/cross-x86_64-w64-mingw32/mingw64-runtime*/temp/mingw64-runtime-config.logs.tar.xz


The cross-x86_64-w64-mingw32-mingw64-runtime.log log also gave this another log: mingw-w64-v9.0.0/config.log
Quote:
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/cross-x86_64-w64-mingw32/mingw64-runtime-9.0.0/work/mingw-w64-v9.0.0/mingw-w64-tools/gendef':
configure: error: C compiler cannot create executables
See `config.log' for more details
configure: error: ./configure failed for mingw-w64-tools/gendef

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/cross-x86_64-w64-mingw32/mingw64-runtime-9.0.0/work/mingw-w64-v9.0.0/config.log
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2551
Location: Here and Away Again

PostPosted: Sun Dec 12, 2021 11:22 pm    Post subject: Reply with quote

Yeah, crossdev is supposed to make this easier. Supposed to. :]

Meh, I think I've seen this before, but of course I made no notes, so this will be a bit of a shot in the dark. At least I at least have some build logs from a year ago to look at.

Can you try something like this:

Code:
USE="headers-only" emerge -1a cross-x86_64-w64-mingw32/mingw64-runtime

If that succeeds, try building it again with that flag disabled.

If it fails, try with:

Code:
USE="-headers-only -idl -libraries -tools"

_________________
Kindest of regardses.
Back to top
View user's profile Send private message
sidneypepo
n00b
n00b


Joined: 11 Dec 2021
Posts: 8

PostPosted: Mon Dec 13, 2021 5:27 am    Post subject: Reply with quote

Chiitoo wrote:
If it fails, try with:

Code:
USE="-headers-only -idl -libraries -tools"


Man, you saved me. This one works!! :D
After successfully ran the crossdev command with those last USE flags, I also tried to run emerge -aquDU @world and my Wine vanilla was also successfully rebuilt.

Boom, no more kernel32.dll error :D

Btw, Wine is now 50% done, because it's actually working, but it's behavior has another issue (and I think I should create a separate topic for this new one, because this topic issue was solved)

Well, I need to sleep, so later I'll mark this topic as solved and I create a new one for the new issue haha

Again, thank you so much for the entire help (here and in #gentoo-wine)! :D
Cya o/
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2551
Location: Here and Away Again

PostPosted: Mon Dec 13, 2021 5:23 pm    Post subject: Reply with quote

Very good!

I'll try to remember to, and find the time to look into what is up with Wine built with USE="-mingw" this time, as well as the MinGW build itself.

It does seem like the Wine without MinGW issue might have been fixed at least in current 'git master', but I do still see something weird with it.
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
sidneypepo
n00b
n00b


Joined: 11 Dec 2021
Posts: 8

PostPosted: Tue Dec 14, 2021 4:51 pm    Post subject: Reply with quote

Chiitoo wrote:
Very good!

I'll try to remember to, and find the time to look into what is up with Wine built with USE="-mingw" this time, as well as the MinGW build itself.

It does seem like the Wine without MinGW issue might have been fixed at least in current 'git master', but I do still see something weird with it.


Nice.
I've closed this topic and I no longer need to create another to solve the mentioned "new issue", because seems that after 2 reboots, Wine didn't did this "new issue" again lol

https://i.imgur.com/5QqDTX0.png
As you can see, Wine is perfectly working :D

Well, thank you so much again ;)
Back to top
View user's profile Send private message
Mr. Chauv
n00b
n00b


Joined: 14 Sep 2003
Posts: 37

PostPosted: Thu Mar 17, 2022 8:46 am    Post subject: Reply with quote

This topic seems to fit quite well and I am unsure whether it's a bug or PEBKAC..

My current situation

  • system up2date, all is good
  • USE+="-mingw" emerge wine-staging # works
  • USE+="mingw" emerge wine-staging # fails with
    Code:

     * USE="mingw" is currently experimental, and requires the
     * 'cross-i686-w64-mingw32' compiler and its runtime for 32-bit builds.
     *
     * These can be installed by using 'sys-devel/crossdev':
     *
     * crossdev --target i686-w64-mingw32


Code:
crossdev --target i686-w64-mingw32
fails with
Code:

 * crossdev version:      20211121
 * Host Portage ARCH:     amd64
 * Host Portage System:   x86_64-pc-linux-gnu (i686-pc-linux-gnu x86_64-pc-linux-gnu)
 * Target Portage ARCH:   x86
 * Target System:         i686-w64-mingw32
 * Stage:                 4 (C/C++ compiler)
 * USE=multilib:          no
 * Target ABIs:           default

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * libc:                  mingw64-runtime-[latest]

 * CROSSDEV_OVERLAY:      /usr/local/portage-crossdev
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /

[...]

 * Log: /var/log/portage/cross-i686-w64-mingw32-binutils.log
 * Emerging cross-binutils ...                                                                                                                                                                                                                                                                   [ ok ]
 * Log: /var/log/portage/cross-i686-w64-mingw32-mingw64-runtime-headers.log
 * Emerging cross-mingw64-runtime-headers ...                                                                                                                                                                                                                                                    [ ok ]
 * Log: /var/log/portage/cross-i686-w64-mingw32-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                                                                                                                                                                                                                                 [ ok ]
 * Log: /var/log/portage/cross-i686-w64-mingw32-mingw64-runtime.log
 * Emerging cross-mingw64-runtime ...

 * error: mingw64-runtime failed :(
 *
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-i686-w64-mingw32-info.log
 * /var/log/portage/cross-i686-w64-mingw32-mingw64-runtime.log.xz
 * /var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime*/temp/mingw64-runtime-config.logs.tar.xz
crossdev --target i686-w64-mingw32  194.54s user 99.48s system 211% cpu 2:19.17 total

This leaves installed:

  • cross-i686-w64-mingw32/

    • binutils-2.37_p1-r2
    • gcc-11.2.1_p20220115
    • mingw64-runtime-9.0.0


money quote from /var/log/portage/cross-i686-w64-mingw32-mingw64-runtime.log.xz:
Code:

checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-9.0.0/work/mingw-w64-v9.0.0/mingw-w64-tools/gendef':
configure: error: C compiler cannot create executables
See `config.log' for more details
configure: error: ./configure failed for mingw-w64-tools/gendef

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/cross-i686-w64-mingw32/mingw64-runtime-9.0.0/work/mingw-w64-v9.0.0/config.log

money quote from that log:
Code:

configure:4145: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/i686-w64-mingw32/usr'  '--build=x86_64-pc-linux-gnu' '--host=i686-w64-mingw32' '--target=i686-w64-mingw32' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--disable-silent-rules' '--docdir=/usr/share/doc/mingw64-runtime-9.0.0' '--htmldir=/usr/share/doc/mingw64-runtime-9.0.0/html' '--with-sysroot=no' '--libdir=/usr/i686-w64-mingw32/usr/lib' '--with-headers' '--enable-sdk' '--with-crt' '--disable-idl' '--without-libraries' '--with-tools' '--enable-lib32' '--disable-lib64' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=i686-w64-mingw32' 'target_alias=i686-w64-mingw32' --cache-file=/dev/null --srcdir=.
configure:4150: error: ./configure failed for mingw-w64-tools/gendef


Cleanup

  • cleanup everything from before (ls -l /var/db/pkg/cross* and unmerge what can be found), in my case

    • cross-i686-w64-mingw32/binutils-2.37_p1-r2
    • cross-i686-w64-mingw32/gcc-11.2.1_p20220115
    • cross-i686-w64-mingw32/mingw64-runtime-9.0.0

  • remove crossdev-created portage entries, in my case:

    • /usr/local/portage-crossdev/cross-i686-w64-mingw32



Workaround
(To have a 'clean' workaround, the cleanup section overshoots and cleans stuff we'll actually need. So do not let redundant installs confuse you.)
Also refer to https://wiki.gentoo.org/wiki/Crossdev#Crossdev_overlay for how to not make crossdev litter up your portage trees.

  • try to install crossdev targets
    Code:

    crossdev --target cross-i686-w64-mingw32
    crossdev --target x86_64-w64-mingw32

    both will fail, but will leave us with portage packages in (my case): /usr/local/portage-crossdev/cross*
    Code:

    # ls -1 /usr/local/portage-crossdev
    cross-i686-w64-mingw32
    cross-x86_64-w64-mingw32
    metadata
    profiles

    also it leaves installed

    • mingw-runtime
    • gcc
    • binutils

    for both targets.
  • as suggested in this thread
    Code:

    USE="-headers-only -idl -libraries -tools"  emerge -1av cross-i686-w64-mingw32/mingw64-runtime cross-x86_64-w64-mingw32/mingw64-runtime

  • now merging WINE with mingw works fine
    Code:

    USE+="mingw" emerge wine-staging



Yeehaw!! & Darn it!
(remark: On tests yesterday I was unable to merge samba as it tried to use those cross-compilers and got confused. With the approach listed here, I do not have this problem anymore and samba merges just fine.)

I am unsure whether this is a 'WINE ebuild bug' or a 'crossdev bug' (or.. PEBKAC)...

Any comments are highly appreciated and welcome! :?
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2551
Location: Here and Away Again

PostPosted: Mon Apr 18, 2022 6:57 pm    Post subject: Reply with quote

Mr. Chauv wrote:
Any comments are highly appreciated and welcome! :?

I'm hoping this is fixed at last with commit 6411adf2ffd [1], but I haven't had the chance to test and look deeper into it.

1. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6411adf2ffd54418b72fd304b8cbf9ae28321293
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum