linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philip Li <philip.li@intel.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: <lkp@lists.01.org>, 0day robot <lkp@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [LKP] Fix make.cross for 0day bot
Date: Thu, 1 Sep 2022 15:06:15 +0800	[thread overview]
Message-ID: <YxBZ5wcGUSQ/VeHD@rli9-MOBL1.ccr.corp.intel.com> (raw)
In-Reply-To: <CAK7LNATbAVE8QY_QZQkiaNy9UZb2tH30eP50n0TNpgsHVrTKJQ@mail.gmail.com>

On Thu, Sep 01, 2022 at 03:55:52PM +0900, Masahiro Yamada wrote:
> Hello,  maintainers of Intel 0day bot,
> 
> make.cross is supposed to use the latest GCC by default
> (according to the comment "use highest available version")
> but actually chooses GCC 9.3.0 rather than gcc-12.1.0.

thanks a lot for pointing out the issue and fixing it. Do you mind to send
a PR to https://github.com/intel/lkp-tests, or you suggest we composing
a patch based on your fix below?

> 
> If both gcc-9.3.0-nolibc and gcc-12.1.0-nolibc exist
> in COMPILER_INSTALL_PATH, make.cross chooses gcc-9.3.0.
> 
> Likewise, make.cross installs gcc-9.3.0 when no suitable compiler is found.
> 
> 
> This is due the fact that compiler is sorted like follows:
> 
> gcc-10.2.0-nolibc
> gcc-10.3.0-nolibc
> gcc-11.1.0-nolibc
> gcc-11.2.0-nolibc
> gcc-11.3.0-nolibc
> gcc-12.1.0-nolibc
> gcc-4.9.4-nolibc
> gcc-5.5.0-nolibc
> gcc-6.4.0-nolibc
> gcc-6.5.0-nolibc
> gcc-7.5.0-nolibc
> gcc-8.1.0-nolibc
> gcc-9.2.0-nolibc
> gcc-9.3.0-nolibc
> 
> 
> Then, gcc-9.3.0-nolibc is picked up since it is listed at the last.
> 
> 
> 
> 'sort -V' can do natural sort for versions:
> 
> gcc-4.9.4-nolibc
> gcc-5.5.0-nolibc
> gcc-6.4.0-nolibc
> gcc-6.5.0-nolibc
> gcc-7.5.0-nolibc
> gcc-8.1.0-nolibc
> gcc-9.2.0-nolibc
> gcc-9.3.0-nolibc
> gcc-10.2.0-nolibc
> gcc-10.3.0-nolibc
> gcc-11.1.0-nolibc
> gcc-11.2.0-nolibc
> gcc-11.3.0-nolibc
> gcc-12.1.0-nolibc
> 
> 
> 
> 
> One example code change is like follows:
> 
> 
> 
> --- make.cross.old      2022-09-01 12:18:20.933154233 +0900
> +++ make.cross  2022-09-01 15:06:48.995945712 +0900
> @@ -143,7 +143,7 @@
>         local URL='https://download.01.org/0day-ci/cross-package'
>         local list=/tmp/0day-ci-crosstool-files
> 
> -       lftp -c "open $URL && find -d 3 > $list" || return
> +       lftp -c "open $URL && find -d 3" | sort -V > $list || return
> 
>         local file
>         local gcc_arch_pattern=$(echo "${gcc_arch}" | sed 's/*/.*/g')
> @@ -206,7 +206,7 @@
>         }
> 
>         # use highest available version
> -       gcc_exec=${gcc_exec[-1]}
> +       gcc_evec=$(tr ' ' '\n' <<< ${gcc_exec[@]} | sort -V | tail -n1)
>  }
> 
>  update_path_env_for_parisc()
> @@ -340,7 +340,7 @@
> 
>                 # load build-in depends libs
>                 local
> deplibs_path=($COMPILER_INSTALL_PATH/${COMPILER}*/${gcc_arch}/libexec/gcc/${gcc_arch}/*)
> -               deplibs_path=${deplibs_path[-1]}
> +               deplibs_path=$(tr ' ' '\n' <<< ${deplibs_path[@]} |
> sort -V | tail -n1)
>                 [[ -d $deplibs_path ]] && export
> LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$deplibs_path
> 
>                 install_dependence "$gcc_exec" || return
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada
> _______________________________________________
> LKP mailing list -- lkp@lists.01.org
> To unsubscribe send an email to lkp-leave@lists.01.org

  reply	other threads:[~2022-09-01  7:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01  6:55 Fix make.cross for 0day bot Masahiro Yamada
2022-09-01  7:06 ` Philip Li [this message]
2022-09-01  8:20   ` [LKP] " Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YxBZ5wcGUSQ/VeHD@rli9-MOBL1.ccr.corp.intel.com \
    --to=philip.li@intel.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lkp@lists.01.org \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).