• [gentoo-dev] [PATCH v3] kernel-2.eclass: Respect portage toolchain vari

    From Adrian Ratiu@21:1/5 to All on Mon Jan 3 19:00:02 2022
    Starting with kernel>=v5.7 the build system can override the
    tools vars by setting LLVM=1 [1], but older kernels still use
    the default GNU tools, so to be able to use a full LLVM/Clang
    build, CC & co should be set to their respective portage values.

    [1] a0d1c951ef08 kbuild: support LLVM=1 to switch the default tools to Clang/LLVM

    Co-authored-by: Manoj Gupta <manojgupta@chromium.org>
    Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
    ---
    Changes in v3:
    - Add rest of vars used by kernel builds (suggested by James)
    - Minor commit msg rewording

    Changes in v2:
    - Set AR variable which is also required for linux-headers
    - Reword msg for clarity
    ---
    eclass/kernel-2.eclass | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
    index adc1425bc2e..865c43d3153 100644
    --- a/eclass/kernel-2.eclass
    +++ b/eclass/kernel-2.eclass
    @@ -692,7 +692,7 @@ env_setup_xmakeopts() {
    elif type -p ${CHOST}-ar >/dev/null; then
    xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
    fi
    - xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)"
    + xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC) CC=$(tc-getCC) LD=$(tc-getLD) AR=$(tc-getAR) NM=$(tc-getNM) NM=$(tc-getNM) OBOBJCOPY=$(tc-getOBJCOPY) READELF=$(tc-getREADELF) STRIP=$(tc-getSTRIP)"
    export xmakeopts
    }

    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Gilbert@21:1/5 to adrian.ratiu@collabora.com on Mon Jan 3 19:30:02 2022
    On Mon, Jan 3, 2022 at 12:49 PM Adrian Ratiu <adrian.ratiu@collabora.com> wrote:

    Starting with kernel>=v5.7 the build system can override the
    tools vars by setting LLVM=1 [1], but older kernels still use
    the default GNU tools, so to be able to use a full LLVM/Clang
    build, CC & co should be set to their respective portage values.

    [1] a0d1c951ef08 kbuild: support LLVM=1 to switch the default tools to Clang/LLVM

    Co-authored-by: Manoj Gupta <manojgupta@chromium.org>
    Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
    ---
    Changes in v3:
    - Add rest of vars used by kernel builds (suggested by James)
    - Minor commit msg rewording

    Changes in v2:
    - Set AR variable which is also required for linux-headers
    - Reword msg for clarity
    ---
    eclass/kernel-2.eclass | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
    index adc1425bc2e..865c43d3153 100644
    --- a/eclass/kernel-2.eclass
    +++ b/eclass/kernel-2.eclass
    @@ -692,7 +692,7 @@ env_setup_xmakeopts() {
    elif type -p ${CHOST}-ar >/dev/null; then
    xmakeopts="${xmakeopts} CROSS_COMPILE=${CHOST}-"
    fi
    - xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC)"
    + xmakeopts="${xmakeopts} HOSTCC=$(tc-getBUILD_CC) CC=$(tc-getCC) LD=$(tc-getLD) AR=$(tc-getAR) NM=$(tc-getNM) NM=$(tc-getNM) OBOBJCOPY=$(tc-getOBJCOPY) READELF=$(tc-getREADELF) STRIP=$(tc-getSTRIP)"
    export xmakeopts
    }

    This seems ok to me, at least given the way the eclass currently works.

    At some point, we should really convert xmakeopts into an array. Any
    of these variables might contain spaces, and that would break the
    current implementation.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike@21:1/5 to Sam James on Wed Jan 5 00:40:01 2022
    On 1/4/22 18:25, Sam James wrote:


    On 3 Jan 2022, at 18:23, Mike Gilbert <floppym@gentoo.org
    <mailto:floppym@gentoo.org>> wrote: On Mon, Jan 3, 2022 at 12:49
    PM Adrian Ratiu <adrian.ratiu@collabora.com
    <mailto:adrian.ratiu@collabora.com>> wrote:

    Starting with kernel>=v5.7 the build system can override the
    tools vars by setting LLVM=1 [1], but older kernels still use
    the default GNU tools, so to be able to use a full LLVM/Clang
    build, CC & co should be set to their respective portage values.

    [1] a0d1c951ef08 kbuild: support LLVM=1 to switch the default
    tools to Clang/LLVM

    Co-authored-by: Manoj Gupta <manojgupta@chromium.org
    <mailto:manojgupta@chromium.org>> Signed-off-by: Adrian Ratiu
    <adrian.ratiu@collabora.com <mailto:adrian.ratiu@collabora.com>>
    [snip]

    This seems ok to me, at least given the way the eclass currently
    works.

    At some point, we should really convert xmakeopts into an array.
    Any of these variables might contain spaces, and that would break
    the current implementation.

    agreed, but lgtm


    Thanks to both authors for your work, this has been committed.

    --
    Mike Pagano
    Gentoo Developer - Kernel Project
    Gentoo Sources - Lead
    E-Mail : mpagano@gentoo.org
    GnuPG FP : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137
    Public Key : http://http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137&op=index

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Wed Jan 5 00:30:02 2022
    --Apple-Mail=_3CFE16C8-E0D3-42B9-B8A3-4C393F76FD78
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain;
    charset=us-ascii



    On 3 Jan 2022, at 18:23, Mike Gilbert <floppym@gentoo.org> wrote:
    On Mon, Jan 3, 2022 at 12:49 PM Adrian Ratiu <adrian.ratiu@collabora.com <mailto:adrian.ratiu@collabora.com>> wrote:

    Starting with kernel>=v5.7 the build system can override the
    tools vars by setting LLVM=1 [1], but older kernels still use
    the default GNU tools, so to be able to use a full LLVM/Clang
    build, CC & co should be set to their respective portage values.

    [1] a0d1c951ef08 kbuild: support LLVM=1 to switch the default tools to Clang/LLVM

    Co-authored-by: Manoj Gupta <manojgupta@chromium.org>
    Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
    [snip]

    This seems ok to me, at least given the way the eclass currently works.

    At some point, we should really convert xmakeopts into an array. Any
    of these variables might contain spaces, and that would break the
    current implementation.


    agreed, but lgtm

    --Apple-Mail=_3CFE16C8-E0D3-42B9-B8A3-4C393F76FD78
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/html;
    charset=us-ascii

    <html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""
    <div class="">On 3 Jan 2022, at 18:23, Mike Gilbert &lt;<a href="mailto:floppym@gentoo.org" class="">floppym@gentoo.org</a>&gt; wrote:</div><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-
    size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration:
    none; float: none; display: inline !important;" class="">On Mon, Jan 3, 2022 at 12:49 PM Adrian Ratiu &lt;</span><a href="mailto:adrian.ratiu@collabora.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal;
    font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">adrian.
    ratiu@collabora.com</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none;
    white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">&gt; wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style:
    normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><
    blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space:
    normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class="">Starting with kernel&gt;=v5.7 the build system can override the<br class="">tools vars by setting LLVM=
    1 [1], but older kernels still use<br class="">the default GNU tools, so to be able to use a full LLVM/Clang<br class="">build, CC &amp; co should be set to their respective portage values.<br class=""><br class="">[1] a0d1c951ef08 kbuild: support LLVM=1
    to switch the default tools to Clang/LLVM<br class=""><br class="">Co-authored-by: Manoj Gupta &lt;<a href="mailto:manojgupta@chromium.org" class="">manojgupta@chromium.org</a>&gt;<br class="">Signed-off-by: Adrian Ratiu &lt;<a href="mailto:adrian.ratiu@
    collabora.com" class="">adrian.ratiu@collabora.com</a>&gt;<br class="">[snip]</blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing:
    normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px;
    font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float:
    none; display: inline !important;" class="">This seems ok to me, at least given the way the eclass currently works.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-
    weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family:
    Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
    text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-
    transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">At some point, we should really convert xmakeopts into an array. Any</span><br style="caret-
    color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -
    webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start;
    text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">of these variables might contain spaces, and that would break the</
    span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal;
    word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing:
    normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">current implementation.</span></div></
    blockquote></div><div class=""><br class=""></div><div class="">agreed, but lgtm</div></body></html>
    --Apple-Mail=_3CFE16C8-E0D3-42B9-B8A3-4C393F76FD78--

    -----BEGIN PGP SIGNATURE-----

    iQGTBAEBCgB9FiEEYOpPv/uDUzOcqtTy9JIoEO6gSDsFAmHU125fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDYw RUE0RkJGRkI4MzUzMzM5Q0FBRDRGMkY0OTIyODEwRUVBMDQ4M0IACgkQ9JIoEO6g SDvSuAf+P23TrChCVRK6wR2ti4gow1ktcFeI/BU9RxeacYvdFBOyM5N1+dGtfJRw xnQN8eQDdWeC0UQFBZVvFdHSou8yBY1EcxLGjbAN6Kt50jeP59JjIZQ396UOeKGg DHjGegVpOMJdC7ps+KjRAf64S3Y0j7mdLunl4N2CIP8ONbbe9sMVlOaGUew9Gla7 G+K+Muv1BU1GfxNY2KD5Mxp2dviAavbRZrKYpdh9VOu5Y4aZpKOeSDYnXkcgNVrK HM83Cig4COo8tg/HWgvR0+FafbTcJ9HQH7PGdjdCeiTgUt8PC+FJ814ow7w1AUBF BWzUjyw2ABJ4FTQQwicLZmYizhgc/w==
    =xCdD
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)