<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<title>zunzuncito - experiments</title>
	<subtitle>Wolf&#x27;s humming microblog</subtitle>
	<link href="https://zunzuncito.oriole.systems/tags/experiments/atom.xml" rel="self" type="application/atom+xml"/>
	<link href="https://zunzuncito.oriole.systems"/>
	<generator uri="https://www.getzola.org/">Zola</generator>
	<updated>2022-02-05T19:29:44+01:00</updated>
	<id>https://zunzuncito.oriole.systems/tags/experiments/atom.xml</id>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>Building the Linux kernel with clang and full LTO</title>
		<published>2022-02-05T19:29:44+01:00</published>
		<updated>2022-02-05T19:29:44+01:00</updated>
		<link href="https://zunzuncito.oriole.systems/16/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/16/</id>
		<content type="html">&lt;p&gt;My main desktop PC tracks the latest LTS &lt;a href=&quot;https:&#x2F;&#x2F;kernel.org&#x2F;&quot;&gt;release&lt;&#x2F;a&gt; of the
Linux kernel which very recently switched to the 5.15 line. Along with neat new
features like the
&lt;a href=&quot;https:&#x2F;&#x2F;lore.kernel.org&#x2F;all&#x2F;aa4aa155-b9b2-9099-b7a2-349d8d9d8fbd@paragon-software.com&#x2F;&quot;&gt;NTFS3 driver&lt;&#x2F;a&gt;
it also includes experimental support for
&lt;a href=&quot;https:&#x2F;&#x2F;llvm.org&#x2F;docs&#x2F;LinkTimeOptimization.html&quot;&gt;Link Time Optimization&lt;&#x2F;a&gt;
through LLVM’s
&lt;a href=&quot;https:&#x2F;&#x2F;clang.llvm.org&#x2F;&quot;&gt;&lt;code&gt;clang&lt;&#x2F;code&gt; compiler&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;I’m not really one to shy away from weird experiments, so I decided to run a
full LTO kernel for a while. If you have a recent version of &lt;code&gt;clang&lt;&#x2F;code&gt; and the
&lt;a href=&quot;https:&#x2F;&#x2F;lld.llvm.org&#x2F;&quot;&gt;&lt;code&gt;lld&lt;&#x2F;code&gt; linker&lt;&#x2F;a&gt;, building one is as easy as toggling
&lt;code&gt;CONFIG_LTO_CLANG_FULL&lt;&#x2F;code&gt; and exporting the right flags to &lt;code&gt;make&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code&gt;make CC=clang LLVM=1 menuconfig
	# CONFIG_LTO_CLANG_FULL=y
make CC=clang LLVM=1
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Subsequent steps are the same as with a normal build:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code&gt;sudo make install
sudo make modules_install
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Keep in mind, however, that any out-of-tree modules such as ZFS must also be
built with &lt;code&gt;clang&lt;&#x2F;code&gt;. Here I ran into
&lt;a href=&quot;https:&#x2F;&#x2F;bugs.gentoo.org&#x2F;show_bug.cgi?id=814194&quot;&gt;this bug&lt;&#x2F;a&gt; which should soon be
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;openzfs&#x2F;zfs&#x2F;pull&#x2F;13046&quot;&gt;fixed upstream&lt;&#x2F;a&gt;. For now I
backported that fix locally to ZFS 2.1.2 and am building it like so:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code&gt;sudo CC=clang LLVM=1 emerge zfs-kmod
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Build times and memory usage when building are increased dramatically with full
LTO. Optimizing &lt;code&gt;vmlinux.o&lt;&#x2F;code&gt; alone allocates about 3 to 4 GiB of memory. If you
rely a lot on incremental builds, thin LTO might be the better option here.&lt;&#x2F;p&gt;
</content>
	</entry>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>Minecraft on syys</title>
		<published>2021-12-29T19:14:15+02:00</published>
		<updated>2021-12-29T19:14:15+02:00</updated>
		<link href="https://zunzuncito.oriole.systems/15/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/15/</id>
		<content type="html">&lt;p&gt;I didn’t expect this to actually work, but as half-jokingly mentioned in the &lt;a class=&quot;internal&quot; href=&quot;&#x2F;14&quot;&gt;previous post&lt;&#x2F;a&gt;
, here’s a Minecraft server running on a
machine from around 25 years ago. Pretty much worked out of the box with
&lt;code&gt;icedtea&lt;&#x2F;code&gt; assembled by the build VM and a 512MiB swapfile (of which only around
50MiB was actually used).&lt;&#x2F;p&gt;
&lt;figure&gt;
&lt;a href=&quot;&#x2F;15&amp;#x2F;minecraft-syys-1.png&quot;&gt;
		&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;zunzuncito.oriole.systems&amp;#x2F;processed_images&amp;#x2F;minecraft-syys-1.09387cd79b4ef26d.jpg&quot; alt=&quot;nortti in the overworld on the syys
Minecraft server&quot; &#x2F;&gt;
	&lt;&#x2F;a&gt;
	&lt;figcaption class=&quot;smaller&quot;&gt;nortti in the overworld on the syys Minecraft
server&lt;&#x2F;figcaption&gt;
	&lt;&#x2F;figure&gt;
&lt;p&gt;The game was surprisingly playable, and we made it all the way to finding
diamonds.&lt;&#x2F;p&gt;
&lt;figure&gt;
&lt;a href=&quot;&#x2F;15&amp;#x2F;minecraft-syys-2.png&quot;&gt;
		&lt;img src=&quot;https:&amp;#x2F;&amp;#x2F;zunzuncito.oriole.systems&amp;#x2F;processed_images&amp;#x2F;minecraft-syys-2.e345a90abeffbbaa.jpg&quot; alt=&quot;nortti in the Minecraft on syys
looking at a diamond deposit in the ceiling&quot; &#x2F;&gt;
	&lt;&#x2F;a&gt;
	&lt;figcaption class=&quot;smaller&quot;&gt;We found diamonds!&lt;&#x2F;figcaption&gt;
	&lt;&#x2F;figure&gt;
</content>
	</entry>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>A post from syys</title>
		<published>2021-12-29T14:30:36+02:00</published>
		<updated>2021-12-29T14:30:36+02:00</updated>
		<link href="https://zunzuncito.oriole.systems/14/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/14/</id>
		<content type="html">&lt;p&gt;I spent the last few days building a &lt;a href=&quot;https:&#x2F;&#x2F;syys.nortti.org&quot;&gt;cursed Gentoo
system&lt;&#x2F;a&gt; with my &lt;a href=&quot;https:&#x2F;&#x2F;nortti.org&quot;&gt;partner&lt;&#x2F;a&gt;. We
named it “syys”, after “syyskuu” - the Finnish word for September.&lt;&#x2F;p&gt;
&lt;p&gt;This post was written, committed, and pushed on that system, using only
software that was built on it natively. For some heavier parts that were not
involved in the making of this post (&lt;code&gt;links&lt;&#x2F;code&gt;, &lt;code&gt;fish&lt;&#x2F;code&gt;, both of which need
&lt;code&gt;cmake&lt;&#x2F;code&gt;, which would take hours to build) we set up a portage binary host on a
VM that is nearly identical to the actual Pentium II system.&lt;&#x2F;p&gt;
&lt;p&gt;The next logical step, of course, is to try and get Minecraft running on it…&lt;&#x2F;p&gt;
</content>
	</entry>
</feed>
