<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Tulio Magno Quites Machado Filho</title><link href="https://www.quites.com.br/" rel="alternate"/><link href="https://www.quites.com.br/feed" rel="self"/><id>https://www.quites.com.br/</id><updated>2022-03-11T00:00:00-03:00</updated><entry><title>Using build-many-glibcs.py</title><link href="https://www.quites.com.br/2022/03/11/using-build-many-glibcspy/index.html" rel="alternate"/><published>2022-03-11T00:00:00-03:00</published><updated>2022-03-11T00:00:00-03:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2022-03-11:/2022/03/11/using-build-many-glibcspy/index.html</id><summary type="html">&lt;p&gt;The &lt;a href="https://www.gnu.org/software/libc"&gt;GNU C Library&lt;/a&gt; project maintains a
script called &lt;code&gt;build-many-glibcs.py&lt;/code&gt; that is used, according to its source
code, to:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Build many configurations of glibc&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As of today, the script allows to cross compile glibc for 93 different glibc
configurations used in the most common triplets supported by glibc.
But …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The &lt;a href="https://www.gnu.org/software/libc"&gt;GNU C Library&lt;/a&gt; project maintains a
script called &lt;code&gt;build-many-glibcs.py&lt;/code&gt; that is used, according to its source
code, to:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Build many configurations of glibc&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As of today, the script allows to cross compile glibc for 93 different glibc
configurations used in the most common triplets supported by glibc.
But &lt;code&gt;build-many-glibcs.py&lt;/code&gt; is also useful to create 52 cross compilers
that can be used by other projects unrelated to glibc.&lt;/p&gt;
&lt;h2&gt;Downloading the source code&lt;/h2&gt;
&lt;p&gt;First you have to have the glibc source code in your computer.
In my case, I'm going to download it to &lt;code&gt;~/src/glibc&lt;/code&gt; by running the following
commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/src
$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;clone&lt;span class="w"&gt; &lt;/span&gt;https://sourceware.org/git/glibc.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, we need to create a directory for the build-many-glibcs artifacts.
I'm using &lt;code&gt;~/build-many-glibs&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;~/build-many-glibcs
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/build-many-glibcs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In the following step, we ask &lt;code&gt;build-many-glibcs.py&lt;/code&gt; to download the source
code of all the projects it builds:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;~/src/glibc/scripts/build-many-glibcs.py&lt;span class="w"&gt; &lt;/span&gt;./&lt;span class="w"&gt; &lt;/span&gt;checkout
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The download might take a while.&lt;/p&gt;
&lt;p&gt;Notice this step will download the glibc
source code again and will store it under &lt;code&gt;~/build-many-glibcs/src/glibc&lt;/code&gt;.
The script will build glibc using the source code it downloaded and not
from &lt;code&gt;~/src/glibc&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Building the host libraries&lt;/h2&gt;
&lt;p&gt;In the next step, we have to build the host libraries that will be used by
the cross compilers: libgmp, libmpc and libmpfr.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;~/src/glibc/scripts/build-many-glibcs.py&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;160&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;./&lt;span class="w"&gt; &lt;/span&gt;host-libraries
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This step is really fast, but it benefits from parallel jobs as specified
by parameter &lt;code&gt;-j 160&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Building the cross compilers&lt;/h2&gt;
&lt;p&gt;In this step, we'll build the cross compilers.
This is the first time you can list the architectures and build combinations
you'd like to build, but if you run the &lt;code&gt;compilers&lt;/code&gt; command without
specifying the list of compiler configurations, &lt;code&gt;build-many-glibcs.py&lt;/code&gt; will
build all the configurations available.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;~/src/glibc/scripts/build-many-glibcs.py&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;160&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;./&lt;span class="w"&gt; &lt;/span&gt;compilers
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The execution of this command will take a couple of hours and will require
~50 GiB of disk space.
I suggest to save the contents of this directory for future executions.&lt;/p&gt;
&lt;h2&gt;Building glibcs&lt;/h2&gt;
&lt;p&gt;If all you need is a cross compiler, you can stop after the previous command.
However, if you plan to build glibc too, there is one final command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;~/src/glibc/scripts/build-many-glibcs.py&lt;span class="w"&gt; &lt;/span&gt;-j&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;160&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;./&lt;span class="w"&gt; &lt;/span&gt;glibcs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is going to build, install and run all glibc tests available at a cross
compilation for all the 93 glibc configurations. It will take many hours to
complete.
If you don't need all the configurations, you can list the ones that you need.&lt;/p&gt;</content><category term="posts"/><category term="glibc"/><category term="powerpc"/></entry><entry><title>The Moon</title><link href="https://www.quites.com.br/2021/09/08/the-moon/index.html" rel="alternate"/><published>2021-09-08T00:00:00-03:00</published><updated>2021-09-08T00:00:00-03:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2021-09-08:/2021/09/08/the-moon/index.html</id><content type="html">&lt;p&gt;&lt;img alt="The Moon" src="https://www.quites.com.br/images/DSCF3028-500px.jpg" title="The Moon"&gt;&lt;/p&gt;</content><category term="photos"/><category term="Photography"/></entry><entry><title>Quote of the day</title><link href="https://www.quites.com.br/2021-09-07-quote-pt.html" rel="alternate"/><published>2021-09-07T00:00:00-03:00</published><updated>2021-09-07T00:00:00-03:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2021-09-07:/2021-09-07-quote-pt.html</id><content type="html">&lt;p&gt;O que antes era marketing massivo, agora é personalização massiva. As marcas que mais rapidamente entenderem isso, vão se sobressair. É uma corrida em que a tecnologia te ajuda a entender melhor o cliente e suas nuances. - &lt;a href="https://www1.folha.uol.com.br/mercado/2021/09/saudabilidade-e-o-que-nao-falta-no-mcdonalds-diz-presidente-da-rede-no-brasil.shtml"&gt;Paulo Camargo&lt;/a&gt;&lt;/p&gt;</content><category term="quotes"/><category term="Privacy"/></entry><entry><title>Migrating to Pelican</title><link href="https://www.quites.com.br/2021/08/25/migrating-to-pelican/index.html" rel="alternate"/><published>2021-08-25T00:00:00-03:00</published><updated>2021-08-25T00:00:00-03:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2021-08-25:/2021/08/25/migrating-to-pelican/index.html</id><content type="html">&lt;p&gt;After a long time, I've finally complete the migration of this site to
&lt;a href="https://blog.getpelican.com"&gt;Pelican&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the end, I decided to remove old posts that had no value anymore and
converted the remaining to the new format. Hopefully, this will help me
write more. :-D&lt;/p&gt;</content><category term="posts"/><category term="Blogging"/></entry><entry><title>Reading the serial number of a POWER server from Linux</title><link href="https://www.quites.com.br/2019/01/23/reading-the-serial-number-of-a-power-server-from-linux/index.html" rel="alternate"/><published>2019-01-23T00:00:00-02:00</published><updated>2019-01-23T00:00:00-02:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2019-01-23:/2019/01/23/reading-the-serial-number-of-a-power-server-from-linux/index.html</id><summary type="html">&lt;p&gt;From time to time, I have to identify which physical server I'm connected to.
That usually involves reading the manufacturer serial number of the server.
That information is provided to Linux by the device tree, which is exported
via procfs at &lt;code&gt;/proc/device-tree/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;However, the file that hosts the serial …&lt;/p&gt;</summary><content type="html">&lt;p&gt;From time to time, I have to identify which physical server I'm connected to.
That usually involves reading the manufacturer serial number of the server.
That information is provided to Linux by the device tree, which is exported
via procfs at &lt;code&gt;/proc/device-tree/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;However, the file that hosts the serial number of your server may vary
according to the virtualization mechanism in place, e.g. bare-metal and
LPARs use the file &lt;code&gt;system-id&lt;/code&gt;, while KVM guests use the file &lt;code&gt;host-serial&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;With that said, we can read the serial number of our server with the
following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;find /proc/device-tree/ -name host-serial -o -name system-id | xargs cat; echo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="posts"/><category term="Linux"/><category term="powerpc"/></entry><entry><title>Updated tutorial on Optimized libraries for Linux on Power</title><link href="https://www.quites.com.br/2018/12/01/updated-tutorial-on-optimized-libraries-for-linux-on-power/index.html" rel="alternate"/><published>2018-12-01T00:00:00-02:00</published><updated>2018-12-01T00:00:00-02:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2018-12-01:/2018/12/01/updated-tutorial-on-optimized-libraries-for-linux-on-power/index.html</id><summary type="html">&lt;p&gt;A while ago, David Flaherty wrote a nice tutorial about writing optimized
libraries for Linux on Power. As time passed, parts of the tutorial became
obsolete and needed some love.&lt;/p&gt;
&lt;p&gt;Earlier in November
&lt;a href="https://developer.ibm.com/tutorials/optimized-libraries-for-linux-on-power/"&gt;I completed this update&lt;/a&gt;
and removed all the obsolete parts, added new sections mentioning glibc's
&lt;code&gt;getauxval()&lt;/code&gt; and …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A while ago, David Flaherty wrote a nice tutorial about writing optimized
libraries for Linux on Power. As time passed, parts of the tutorial became
obsolete and needed some love.&lt;/p&gt;
&lt;p&gt;Earlier in November
&lt;a href="https://developer.ibm.com/tutorials/optimized-libraries-for-linux-on-power/"&gt;I completed this update&lt;/a&gt;
and removed all the obsolete parts, added new sections mentioning glibc's
&lt;code&gt;getauxval()&lt;/code&gt; and GCC's &lt;code&gt;__builtin_cpu_is()&lt;/code&gt; and attribute ifunc. &lt;/p&gt;</content><category term="posts"/><category term="Linux"/><category term="libraries"/></entry><entry><title>Quote of the day</title><link href="https://www.quites.com.br/2015/11/20/2015-11-20-quote/index.html" rel="alternate"/><published>2015-11-20T00:00:00-02:00</published><updated>2015-11-20T00:00:00-02:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2015-11-20:/2015/11/20/2015-11-20-quote/index.html</id><content type="html">&lt;p&gt;If it's not practical to redistribute free software, it's not free software in practice. - &lt;a href="https://mjg59.dreamwidth.org/38467.html"&gt;Matthew Garrett&lt;/a&gt;&lt;/p&gt;</content><category term="quotes"/><category term="Free Software"/></entry><entry><title>Quote of the day</title><link href="https://www.quites.com.br/2014/01/04/2014-01-04-quote/index.html" rel="alternate"/><published>2014-01-04T00:00:00-02:00</published><updated>2014-01-04T00:00:00-02:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2014-01-04:/2014/01/04/2014-01-04-quote/index.html</id><content type="html">&lt;p&gt;If you don't have full source to your firmware you don't have a system you
can trust. - &lt;a href="https://plus.google.com/+AlanCoxLinux/posts/9bCJPSdjT4t"&gt;Alan Cox&lt;/a&gt;&lt;/p&gt;</content><category term="quotes"/><category term="Free Software"/></entry><entry><title>Quote of the day</title><link href="https://www.quites.com.br/2012/08/04/2012-08-04-quote/index.html" rel="alternate"/><published>2012-08-04T00:00:00-03:00</published><updated>2012-08-04T00:00:00-03:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2012-08-04:/2012/08/04/2012-08-04-quote/index.html</id><summary type="html">&lt;p&gt;Don’t rely on the cloud. It’s great to have online storage you can get at
from all your various devices, but when the shit goes down and your under
attack, nothing is more secure than a hard drive you can unplug and hide in a
shoebox in the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Don’t rely on the cloud. It’s great to have online storage you can get at
from all your various devices, but when the shit goes down and your under
attack, nothing is more secure than a hard drive you can unplug and hide in a
shoebox in the closet. It’s not the most convenient way to back up, but you’ll
thank yourself for it. - &lt;a href="https://www.gizmodo.co.uk/2012/08/how-gizmodo-got-hacked-and-how-you-should-defend-yourself/"&gt;Gizmodo UK&lt;/a&gt;&lt;/p&gt;</content><category term="quotes"/><category term="Free Software"/></entry><entry><title>Ocimum gratissimum</title><link href="https://www.quites.com.br/2012/06/23/ocimum-gratissimum/index.html" rel="alternate"/><published>2012-06-23T00:00:00-03:00</published><updated>2012-06-23T00:00:00-03:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2012-06-23:/2012/06/23/ocimum-gratissimum/index.html</id><content type="html">&lt;p&gt;&lt;img alt="Ocimum gratissimum" src="https://www.quites.com.br/images/DSCF2935v1-500px.jpg" title="Ocimum gratissimum"&gt;&lt;/p&gt;</content><category term="photos"/><category term="Photography"/></entry><entry><title>Sky today in Campinas</title><link href="https://www.quites.com.br/2012/05/19/sky-today-in-campinas/index.html" rel="alternate"/><published>2012-05-19T00:00:00-03:00</published><updated>2012-05-19T00:00:00-03:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2012-05-19:/2012/05/19/sky-today-in-campinas/index.html</id><content type="html">&lt;p&gt;&lt;img alt="Sky today in Campinas" src="https://www.quites.com.br/images/DSCF2842-500px.jpg" title="Sky today in Campinas"&gt;&lt;/p&gt;</content><category term="photos"/><category term="Photography"/></entry><entry><title>Touristic steam locomotive in Campinas</title><link href="https://www.quites.com.br/2012/04/30/touristic-steam-locomotive-in-campinas/index.html" rel="alternate"/><published>2012-04-30T00:00:00-03:00</published><updated>2012-04-30T00:00:00-03:00</updated><author><name>Tulio Magno Quites Machado Filho</name></author><id>tag:www.quites.com.br,2012-04-30:/2012/04/30/touristic-steam-locomotive-in-campinas/index.html</id><content type="html">&lt;p&gt;&lt;img alt="Touristic steam locomotive in Campinas" src="https://www.quites.com.br/images/DSCF2780-500px.jpg" title="Touristic steam locomotive in Campinas"&gt;&lt;/p&gt;</content><category term="photos"/><category term="Photography"/></entry></feed>