Locietta / xanmod-kernel-WSL2

Xanmod kernel for WSL2, built by clang with ThinLTO enabled. Build & Release are automated by Github Action.
GNU General Public License v2.0
88 stars 20 forks source link

Backport microsoft/WSL2-Linux-Kernel@a1edb1f #31

Closed Locietta closed 1 year ago

Locietta commented 1 year ago

Backport config changes from upstream.

Updates #30.

Seems to resolve the issue without disabling LTO, still need more information. I'm wondering if providing an non-lto build is a nice move...? (maybe make it non-lto for current "old" build for example)

WERROR is enabled to avoid problematic kernel being published. Though it's not quite helpful for LTO bugs, since the warning is not given by compiler and doesn't break the build. 😕

schuettecarsten commented 1 year ago

There is a warning when building this:

.config:384:warning: override: GENERIC_CPU3 changes choice state

Normally, CPU type should be set using the config script? I am quite sure that I did not see this warning before.

For me, it still reports:

Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_CONNECTION_TIMEOUT
Locietta commented 1 year ago

.config:384: warning: override: GENERIC_CPU3 changes choice state

This is caused by duplicated flags set by defconfig and scripts/config -e, and should be benign. But you are right, I may fix it just by deleting GENERIC_CPU3=y in defconfig.

For me, it still reports:

Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_CONNECTION_TIMEOUT

That's interesting, I don't know what chips you're on. But I revisited the build and found it boots on my old skylake laptop, but fails on newer 12th gen intel chip. And I also tried non-LTO build, it's the same result (ok for skylake, fails on newer chip).

Locietta commented 1 year ago

But you are right, I may fix it just by deleting GENERIC_CPU3=y in defconfig.

Ah, just noticed that deleting CONFIG_GENERIC_CPU3=y will make CONFIG_GENERIC_CPU=y automatically generated in .config, which makes the warning still presists.

Locietta commented 1 year ago

I've tried to build with gcc, clang and with non-LTO, ThinLTO/FullLTO. And all of them fails on the newer chip. So compiler and LTO status might be irrelavent...

Captured WSL logs shows an error:

ThreadID="21,744" ProcessorNumber="11" PartA_PrivTags="16,777,216" file="D:\a\1\s\src\windows\common\socket.cpp" linenumber="45" type="0" failurecount="6" threadid="21,744" hr="-2,143,878,903" message="" code="" function="" 

No idea about what's going on. 🤔

Locietta commented 1 year ago

Merge this anyway (as a partial solution), I'll make another PR if I think I find a complete solution.