<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/kconfig">
  <channel>
    <title>Kconfig</title>
    <link>https://www.linuxjournal.com/tag/kconfig</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Moving Compiler Dependency Checks to Kconfig</title>
  <link>https://www.linuxjournal.com/content/moving-compiler-dependency-checks-kconfig</link>
  <description>  &lt;div data-history-node-id="1340072" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/bigstock--219943504_3.jpg" width="500" height="355" alt="""" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/zack-brown" lang="" about="https://www.linuxjournal.com/users/zack-brown" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Zack Brown&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
&lt;em&gt;The Linux kernel config system, &lt;strong&gt;Kconfig&lt;/strong&gt;, uses a macro language very similar
to the &lt;strong&gt;make&lt;/strong&gt; build tool's macro language. There are a few
differences, however. And
of course, make is designed as a general-purpose build tool while Kconfig is
Linux-kernel-specific. But, why would the kernel developers create a whole new
macro language so closely resembling that of an existing general-purpose
tool?&lt;/em&gt;
&lt;/p&gt;

&lt;p&gt;
One reason became clear recently when &lt;strong&gt;Linus Torvalds&lt;/strong&gt; asked developers to add
an entirely new system of dependency checks to the Kconfig language,
specifically testing the capabilities of the &lt;strong&gt;GCC&lt;/strong&gt; compiler.
&lt;/p&gt;

&lt;p&gt;
It's actually an important issue. The Linux kernel wants to support as many
versions of GCC as possible—so long as doing so would not require too much
insanity in the kernel code itself—but different versions of GCC support
different features. The GCC developers always are tweaking and adjusting, and
GCC releases also sometimes have bugs that need to be worked around. Some
Linux kernel features can only be built using one version of the compiler or
another. And, some features build better or faster if they can take advantage
of various GCC features that exist only in certain versions.
&lt;/p&gt;

&lt;p&gt;
Up until this year, the kernel build system has had to check all those
compiler features by hand, using many hacky methods. The art of probing a
tool to find out if it supports a given feature dates back decades and is
filled with insanity. Imagine giving a command that you know will fail, but
giving it anyway because the specific manner of failure will tell you what
you need to know for a future command to work. Now imagine hundreds of hacks
like that in the Linux kernel build system.
&lt;/p&gt;

&lt;p&gt;
Part of the problem with having those hacky checks in the build system is
that you find out about them only during the build—not during
configuration. But since some kernel features require certain GCC versions,
the proper place to learn about the GCC version is at config time. If the
user's compiler doesn't support a given feature, there's no reason to show
that feature in the config system. It should just silently not exist.
&lt;/p&gt;

&lt;p&gt;
Linus requested that developers migrate those checks into the Kconfig system
and regularize them into the macro language itself. This way, kernel features
with particular GCC dependencies could identify those dependencies and then
show up or not show up at config time, according to whether those
dependencies had been met.
&lt;/p&gt;

&lt;p&gt;
That's the reason simply using &lt;code&gt;make&lt;/code&gt; wouldn't work. The config language had
to represent the results of all those ugly hacks in a friendly way that
developers could make use of.
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/moving-compiler-dependency-checks-kconfig" hreflang="en"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Wed, 19 Sep 2018 12:00:00 +0000</pubDate>
    <dc:creator>Zack Brown</dc:creator>
    <guid isPermaLink="false">1340072 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
