Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel fails to compile
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Tue Jan 02, 2024 8:52 pm    Post subject: Kernel fails to compile Reply with quote

I've been trying to update my kernel for two weeks, but whenever I try, I get this generic error message:
Code:
make[1]: *** [/usr/src/linux-6.6.9-gentoo/Makefile:1913: .] Error 2
make: *** [Makefile:234: __sub-make] Error 2


I heard that this issue can be caused by incorrectly configuring the module signing thing, but I have that turned off.
I tried re-emerging the kernel source code and the firmware package. No luck; I'm guessing I should share my
Code:
.config
file,
but I don't actually know how to share it (it's too big to include in this post).
Back to top
View user's profile Send private message
sunox
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jan 2022
Posts: 147

PostPosted: Tue Jan 02, 2024 9:09 pm    Post subject: Reply with quote

Check out app-text/wgetpaste for sharing your config.
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3909

PostPosted: Tue Jan 02, 2024 9:11 pm    Post subject: Reply with quote

Do you have any 6.6.x working .config file?

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54588
Location: 56N 3W

PostPosted: Tue Jan 02, 2024 9:32 pm    Post subject: Reply with quote

leyvi,

Try
Code:
wgetpaste </path/to/file>
and post the URL.
You may need to choose the paste service ... like this
Code:
$ wgetpaste -s 0x0 /usr/src/linux/.config
Your paste can be seen here: https://0x0.st/H6af.txt


That's my kernel .config file. Visit the URL to see it.

wgetpaste will need to be installed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Wed Jan 03, 2024 3:44 pm    Post subject: Reply with quote

Ok, here's the link:
http://0x0.st/H6ey.txt
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Thu Jan 04, 2024 2:04 pm    Post subject: Reply with quote

Can someone take a look please?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54588
Location: 56N 3W

PostPosted: Thu Jan 04, 2024 2:46 pm    Post subject: Reply with quote

leyvi,

Here's what I've done to try to reproduce your problem here ..

Code:
eix-sync
emerge -1av gentoo-sources:6.6.9
cd /usr/src/linux-6.6.9-gentoo/
wget https://0x0.st/H6ey.txt
cp H6ey.txt .config
make oldconfig


If your pastebin was a valid .config file for
Code:
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.6.9-gentoo Kernel Configuration

the last step should have done nothing but it asked me
Code:
x32 ABI for 64-bit mode (X86_X32_ABI) [N/y/?] (NEW)
so I stopped there as the .config is not valid for the the kernel tree that its in.

If you have ever used $EDITOR on the .config file, throw it away and start again. That usually produces an illegal .config file, which if it builds, shows all sorts of strange runt time issues that nobody has ever seen.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Thu Jan 04, 2024 3:03 pm    Post subject: Reply with quote

Thanks Ned!
I'll try using my config file from 6.6.4 (the last version to work correctly for me).
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54588
Location: 56N 3W

PostPosted: Thu Jan 04, 2024 3:24 pm    Post subject: Reply with quote

leyvi,

I accepted the default answers to the questions that
Code:
make oldconfig
asked thn the kernel built with
Code:
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.6.9-gentoo Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Gentoo 13.2.1_p20231014 p9) 13.2.1 20231014"


You have been using
Code:
CONFIG_CC_VERSION_TEXT="clang version 17.0.6"

clang is supposed to work.

Put my previous post down to me having a 'senior moment', or me being a twit :)

I use gcc by default. Using clang changeis the .config options, so swapping compilers forces make.oldconfig te ask questions. Sorry about that.

Building with
Code:
make -j40 LLVM=1
works here and uses CONFIG_CC_VERSION_TEXT="clang version 17.0.6" so I cannot reproduce the error.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Thu Jan 04, 2024 3:33 pm    Post subject: Reply with quote

I’ve been using the variables “LLVM=1 LLVM_IAS=1”.
Does the fact that you were able to build it with just “LLVM=1” mean that I should stop using “LLVM_IAS”?
What does that flag IAS even do? (It’s not entirely clear to me).
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1932

PostPosted: Thu Jan 04, 2024 3:41 pm    Post subject: Reply with quote

leyvi wrote:
I’ve been using the variables “LLVM=1 LLVM_IAS=1”.
Does the fact that you were able to build it with just “LLVM=1” mean that I should stop using “LLVM_IAS”?
What does that flag IAS even do? (It’s not entirely clear to me).

Basically, it just removes the option -no-integrated-as to clang during the build. (uses the clang integrated assembler)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22725

PostPosted: Thu Jan 04, 2024 3:58 pm    Post subject: Reply with quote

Since the config works for Neddy, perhaps we should debug the actual error. leyvi: please pastebin the full build log, so we can see all error messages produced.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54588
Location: 56N 3W

PostPosted: Thu Jan 04, 2024 4:04 pm    Post subject: Reply with quote

leyvi,

Code:
make clean
make -j40 LLVM=1 LLVM_IAS=1
works here too.

We need your build log to take the guesswork out of the debugging.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Thu Jan 04, 2024 5:20 pm    Post subject: Reply with quote

OK. But I don't know where the build logs are located...
When everything else failed, that was the first thing I tried to check.
I couldn't find it though.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22725

PostPosted: Thu Jan 04, 2024 6:01 pm    Post subject: Reply with quote

You quoted the tail of the build output in your opening post. From where did you get that? Go there, and get the rest of it.
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Thu Jan 04, 2024 6:34 pm    Post subject: Reply with quote

Oh, I though there was a separate log file to the build output.
Here is a link to the pastebin:
http://0x0.st/H6Jf.log
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Thu Jan 04, 2024 6:40 pm    Post subject: Reply with quote

Now that I can actually see the top of the log (it was lost to the line limit in my terminal), I am able to see this:
Code:

xz: Filter chain: --lzma2=dict=1536MiB,lc=3,lp=0,pb=2,mode=normal,nice=64,mf=bt4,depth=0 --lzma2=dict=1536MiB,lc=3,lp=0,pb=2,mode=normal,nice=64,mf=bt4,depth=0
xz: Unsupported filter chain or filter options
tar: kernel/kheaders_data.tar.xz: Wrote only 4096 of 10240 bytes
tar: Child returned status 1
tar: Error is not recoverable: exiting now
make[3]: *** [kernel/Makefile:158: kernel/kheaders_data.tar.xz] Error 2
make[3]: *** Deleting file 'kernel/kheaders_data.tar.xz'
make[2]: *** [scripts/Makefile.build:480: kernel] Error 2
make[2]: *** Waiting for unfinished jobs....

I did recently create a file (/etc/env.d/99xz) where I set some default arguments for the xz command...
I'll check if disabling everything to do with xz helps mitigate the issue.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54588
Location: 56N 3W

PostPosted: Thu Jan 04, 2024 9:32 pm    Post subject: Reply with quote

leyvi,

I don't have /etc/env.d/99xz and it worked for me.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Thu Jan 04, 2024 9:40 pm    Post subject: Reply with quote

Yeah... I tried disabling everything related to xz in the config, but it didn't change anything (tar was run with xz anyway).
But I did try this:
Code:

XZ_DEFAULT="" XZ_OPT="" LLVM=1 make -j16

and that worked just fine:
Code:

Kernel: arch/x86/boot/bzImage is ready  (#1)

It seems that one's xz configuration should be set to the defaults, or the kernel may not build correctly.
Might be a good thing to put onto a wiki page. Maybe the one about xz?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22725

PostPosted: Thu Jan 04, 2024 10:17 pm    Post subject: Reply with quote

Do those custom XZ options work for building a simple tar file by hand? There are plenty of ways users can configure their tools to be completely broken. In my opinion, an unstated prerequisite for building anything is that your build tools are not broken, so specifically advising users not to configure their xz to be broken is only one of many things we would need to list.
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Thu Jan 04, 2024 11:52 pm    Post subject: Reply with quote

To clarify, I read about this in the xz article on the Gentoo Wiki.
I'm just saying that perhaps a warning should be added to that
article, so that people like me (who can be a bit clueless
sometimes) don't go changing this configuration, then wonder
why their kernel won't build. Here is the link:
https://wiki.gentoo.org/wiki/Xz-utils#Configuration
I don't think it would be a bad idea to add a disclaimer here.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5158
Location: Bavaria

PostPosted: Fri Jan 05, 2024 12:18 am    Post subject: Reply with quote

I would like to see the content of your previous XZ_DEFAULTS=
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22725

PostPosted: Fri Jan 05, 2024 12:20 am    Post subject: Reply with quote

Wikis are freely editable, so you could use the associated Talk: page to propose the disclaimer, and discuss with other Wiki contributors what the ideal phrasing would be.

What options had you put in your local environment for xz? The same ones shown on the Wiki (XZ_DEFAULTS="-9 -T0") or something more complex? The output from the failed kernel build looks to me like you put something very complicated in the environment, which is why I wanted to know if those complex options worked outside the kernel build.
Back to top
View user's profile Send private message
leyvi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2023
Posts: 80

PostPosted: Sat Jan 06, 2024 8:58 pm    Post subject: Reply with quote

This was my xz config:
Code:

XZ_OPT="--memlimit=48GiB -v --threads=24 --block-size=4GiB --lzma2=dict=1536MiB"
XZ_DEFAULTS="--memlimit=48GiB -v --threads=24 --block-size=4GiB --lzma2=dict=1536MiB"

I was using tar for backups, and wanted to increase the compression ratio of the xz wrapper it
uses. I didn't get to test it though, and then I sort of forgot about it :oops:
However, now GRUB doesn't work correctly; I tried to reboot, and nothing happened.
Then I tried using the GRUB shell on the installation of GRUB in the Debian 12 LiveCD (don't
judge, I had it on my desk anyways) to manually boot my OS, which worked fine, but I have no
clue why GRUB from my boot partition didn't work as usual. I've checked dmesg, kern.log,
syslog, etc...
I couldn't find any clues as to why it didn't work, but maybe I'm missing something.
In any case, I also regenerated my grub config with
Code:
grub-mkconfig -o /boot/grub/grub.cfg

This didn't work either.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22725

PostPosted: Sat Jan 06, 2024 10:02 pm    Post subject: Reply with quote

We have had a number of threads recently about systems failing to boot after a grub update. Perhaps one of those will have useful advice for you.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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