I can't compile to gentoo-minimal, what should I do?

I want compile to gentoo-minimal, but always failing along the way.
Fails are three pattern.

Error 1:When run emaint or emerge, template is shutdown.
Dom0 terminal’s error message:‘command failed with code:255’.

Error 2:When compile by ‘emerge --ask --verbose --update --deep --newuse @world’ command, compile stop.
Gentoo xterm’s error message:‘Segmentation fault (core dumped)’.
This message frequently appears and stop compile, each time I must run emerge command.

Error 3:Each time I re-run emerge command, I reach cmake package, but compile definitely stop.
Gentoo xterm’s error message:‘emake failed’.
After cmake, emerge never progresses.

How can I succeed?

MyPC

RAM:16GB
CPU:i3 12gen
OS:Qubes OS 4.2.2

When I use Qubes 4.2, gentoo-minimal template success to compiled.
But 4.2.1 and 4.2.2 operation is unstable than 4.2, I can’t compile to gentoo-minimal.

I need to your help!