[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH v1 2/4] automation: add cross-compiler support for the build script
- To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
- Date: Wed, 28 Dec 2022 23:24:12 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Lxy5aIf+V6oxW/7pQpxkJRh0iDWgDWC4OgwyQSpsaUI=; b=d+7Jzjnwc1vCeBnIXu0Qr8LSXe2xjxc30oq48sLIJlQVbKz3nm6AAtj5V6JshPbH0eOEgunnGmvlv4gbcIyxPe6feFLIylx0zJLiILk3byJi6ZSR+U0Hf6z0y1yIOZB4jfZ+JBMvxYx+g7HqKMZkHEtD3BJXHRrvc8yB1vXDTWCxODe/zOIigKr+mLfEDw1K5xAoIKnVAZUAoVIrFkTbBrhpqEdSTXa9TF8zeafoGyn0w5qtcFP9jGAFMALB5lt/hYQFlx8VPwVzw9Bz8wcj7XaLdcOviA200LYJg8X7MLkCu/fJ54rODWfAIzsn7WZXZ19Ln886vcH1dAE0pPExsA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cLtLpasxifUF7N1EH7rXTjahe23BIuC4p4g2KM9zwmWqnrhTa/+2h12FG/J/mJS+Irges7SWyixnHDZbUqcCNPqfL11NERQPzIkQ73zqI65uZGQsoGgaqtQce60+75gmhfI+A8UM/7SNknz5aY0OWF12QgtqQh8Uqf+dLJ1qmNgc8ignK/0TrRdU3ifEREiB1YDKXJw4C8kInwnd/4ISeo5RwT8w5H0FvGi4s8pxpndzR2na1zIThjy3ru89xRe49VmFPTSRjwmEovD0LmuaX0fpSEKK8F90i4B2J6VxPZ9y2TTUA/3/gwNie49zim/gDcTCmIeCQppPF19WKYhtLw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>
- Delivery-date: Wed, 28 Dec 2022 23:24:33 +0000
- Ironport-data: A9a23:07apo6ualgid2tvjxUJFQbzxwOfnVLVfMUV32f8akzHdYApBsoF/q tZmKWmCbP2OYTPzLotwao3kpEhT68TQmNU2HQNupXo8RCgX+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg0HVU/IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4bKj5lv0gnRkPaoR5QWExyFOZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwJnMsTwyZlaGK76/4eLlXpZgnL/S6M9ZK0p1g5Wmx4fcOZ7nmGv2Pz/kHmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0ouiP60aIC9lt+iHK25mm6xo G7c8nu/KRYdLNGFkhKO8262h/+JliT+MG4XPOzipq4y2QPOroAVIB0qDQKxo/adsE+RWfNCA UEzwSs0joFnoSRHSfG4BXVUukWsuRoRWMFREqs59RuKwarX5C6WA2EFSnhKb9lOnN87Q3km2 0GEm/vtBCdzq/uFRHSF7LCWoDiufy8PIgcqfjQYRAEI593ipoAbjR/VSNtnVqmvgbXdFjD5x TSXpyEWnbQNitUK0a799lfC6xqnr4LFSQMd7QzNUmWoqAh+YeaYi5eA7FHa6bNKKtmfR1zY5 HwcwZHGtqYJEI2HkzGLTKMVBra16v2ZMTrax1lyA50m8Dfr8HmmFWxN3AxDyI5SGp5sUVfUj IX742u9OLc70KOWUJJK
- Ironport-hdrordr: A9a23:PCTAOagE79RetO5pp/FZODurd3BQXssji2hC6mlwRA09TyX4ra 2TdZEgvnXJYVkqKRIdcK+7Scu9qB/nm6KdgrN8AV7BZmnbUQKTRelfBODZrAEIdReeygdV79 YET5RD
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHZFsAK4cT7u1aq80+VSFJtEw0nw66D+XwA
- Thread-topic: [XEN PATCH v1 2/4] automation: add cross-compiler support for the build script
On 23/12/2022 11:16 am, Oleksii Kurochko wrote:
> diff --git a/automation/scripts/build b/automation/scripts/build
> index a593419063..026f480e76 100755
> --- a/automation/scripts/build
> +++ b/automation/scripts/build
> @@ -2,12 +2,12 @@
>
> test -f /etc/os-release && cat "$_"
>
> -$CC --version
> +${CROSS_COMPILE}${CC} --version
>
> # Express the compiler version as an integer. e.g. GCC 4.9.2 => 0x040902
> cc-ver()
> {
> - $CC -dumpversion | awk -F. '{ printf "0x%02x%02x%02x", $1, $2, $3 }'
> + ${CROSS_COMPILE}${CC} -dumpversion | awk -F. '{ printf "0x%02x%02x%02x",
> $1, $2, $3 }'
> }
>
> # random config or default config
> @@ -66,7 +66,7 @@ if ! type python3 || python3 -c "import sys; res =
> sys.version_info < (3, 5); ex
> fi
>
> # SeaBIOS requires GCC 4.6 or later
> -if [[ "${CC}" == "gcc" && `cc-ver` -lt 0x040600 ]]; then
> +if [[ "${CROSS_COMPILE}${CC}" == "gcc" && `cc-ver` -lt 0x040600 ]]; then
This change won't work, because it's no longer a plain "gcc".
Also, prepreding CROSS_COMPILE isn't compatible with LLVM toolchains,
but that's not something you've made any worse with your change (just
more obvious).
We probably want a stanza near the top which sets
CC="${CROSS_COMPILE}${CC}" which can be adjusted to support LLVM in due
course, and we'll need to detect GCC using --version | grep as its done
elsewhere.
But the other logic wants reworking too so we don't play around with
bits of the tools build when we're doing a hypervisor-only build anyway...
~Andrew
|