lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 1 Sep 2022 15:55:52 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     lkp@...ts.01.org, 0day robot <lkp@...el.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>
Subject: Fix make.cross for 0day bot

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.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ