* [PATCH] raisin: enable ovmf build for arm64
@ 2015-10-12 17:18 Stefano Stabellini
2015-10-13 10:41 ` Ian Campbell
0 siblings, 1 reply; 14+ messages in thread
From: Stefano Stabellini @ 2015-10-12 17:18 UTC (permalink / raw)
To: xen-devel; +Cc: Stefano Stabellini
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
diff --git a/components/ovmf b/components/ovmf
index ffdde19..d2ed96c 100644
--- a/components/ovmf
+++ b/components/ovmf
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
function ovmf_skip() {
- if [[ $RAISIN_ARCH != "x86_64" && $RAISIN_ARCH != "x86_32" ]]
+ if [[ $RAISIN_ARCH = "arm32" ]]
then
return 0
else
@@ -10,15 +10,23 @@ function ovmf_skip() {
}
function ovmf_check_package() {
- local DEP_Debian_common="build-essential nasm uuid-dev python iasl"
- local DEP_Debian_x86_32="$DEP_Debian_common"
- local DEP_Debian_x86_64="$DEP_Debian_common"
+ local DEP_Debian_common="build-essential uuid-dev python iasl"
+ local DEP_Debian_x86_32="$DEP_Debian_common nasm"
+ local DEP_Debian_x86_64="$DEP_Debian_common nasm"
local DEP_Debian_arm32="$DEP_Debian_common"
local DEP_Debian_arm64="$DEP_Debian_common"
- local DEP_Fedora_common="make gcc gcc-c++ nasm libuuid-devel python acpica-tools"
- local DEP_Fedora_x86_32="$DEP_Fedora_common"
- local DEP_Fedora_x86_64="$DEP_Fedora_common"
+ local DEP_Fedora_common="make gcc gcc-c++ libuuid-devel python acpica-tools"
+ local DEP_Fedora_x86_32="$DEP_Fedora_common nasm"
+ local DEP_Fedora_x86_64="$DEP_Fedora_common nasm"
+ local DEP_Fedora_arm32="$DEP_Debian_common"
+ local DEP_Fedora_arm64="$DEP_Debian_common"
+
+ local DEP_CentOS_common="$DEP_Fedora_common"
+ local DEP_CentOS_x86_32="$DEP_Fedora_x86_32"
+ local DEP_CentOS_x86_64="$DEP_Fedora_x86_64"
+ local DEP_CentOS_arm32="$DEP_Fedora_arm32"
+ local DEP_CentOS_arm64="$DEP_Fedora_arm64"
verbose_echo Checking OVMF dependencies
eval check-package \$DEP_"$DISTRO"_"$RAISIN_ARCH"
@@ -30,9 +38,18 @@ function ovmf_build() {
git-checkout $OVMF_URL $OVMF_REVISION ovmf-dir
cd ovmf-dir
- make -C BaseTools/Source/C
- OvmfPkg/build.sh -a X64 -b RELEASE -n 4
- cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
+ make -C BaseTools
+
+ if [[ $RAISIN_ARCH = "arm64" ]]
+ then
+ export GCC48_AARCH64_PREFIX=
+ bash -c "source edksetup.sh && build -a AARCH64 -t GCC48 -p ArmVirtPkg/ArmVirtXen.dsc -b RELEASE"
+ mkdir -p "$INST_DIR"/$PREFIX/lib/xen/boot
+ cp Build/ArmVirtXen-AARCH64/RELEASE_GCC*/FV/XEN_EFI.fd "$INST_DIR"/$PREFIX/lib/xen/boot/XEN_EFI.fd
+ else
+ OvmfPkg/build.sh -a X64 -b RELEASE -n 4
+ cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
+ fi
cd "$BASEDIR"
}
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-12 17:18 [PATCH] raisin: enable ovmf build for arm64 Stefano Stabellini
@ 2015-10-13 10:41 ` Ian Campbell
2015-10-13 10:58 ` Stefano Stabellini
0 siblings, 1 reply; 14+ messages in thread
From: Ian Campbell @ 2015-10-13 10:41 UTC (permalink / raw)
To: Stefano Stabellini, xen-devel
On Mon, 2015-10-12 at 18:18 +0100, Stefano Stabellini wrote:
> @@ -30,9 +38,18 @@ function ovmf_build() {
> git-checkout $OVMF_URL $OVMF_REVISION ovmf-dir
> cd ovmf-dir
>
> - make -C BaseTools/Source/C
> - OvmfPkg/build.sh -a X64 -b RELEASE -n 4
> - cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
> + make -C BaseTools
> +
> + if [[ $RAISIN_ARCH = "arm64" ]]
Based on what I understand of the OVMF buildsystem I think you are going to
eventually want a case $RAISIN_ARCH here, since it seems to vary a fair
bit.
> + then
> + export GCC48_AARCH64_PREFIX=
Won't this (unexpectedly) leak into other subsequent component builds? Or
is each component built in a fresh sub-shell?
What about host platforms which have a gcc other than 4.8? (e.g. Debian
Jessie uses 4.9 by default)
Should you add a comment explaining why this apparent workaround is needed?
> + bash -c "source edksetup.sh && build -a AARCH64 -t GCC48 -p ArmVirtPkg/ArmVirtXen.dsc -b RELEASE"
> + mkdir -p "$INST_DIR"/$PREFIX/lib/xen/boot
> + cp Build/ArmVirtXen-AARCH64/RELEASE_GCC*/FV/XEN_EFI.fd "$INST_DIR"/$PREFIX/lib/xen/boot/XEN_EFI.fd
> + else
> + OvmfPkg/build.sh -a X64 -b RELEASE -n 4
> + cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
> + fi
>
> cd "$BASEDIR"
> }
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 10:41 ` Ian Campbell
@ 2015-10-13 10:58 ` Stefano Stabellini
2015-10-13 11:03 ` Ian Campbell
2015-10-13 11:24 ` Julien Grall
0 siblings, 2 replies; 14+ messages in thread
From: Stefano Stabellini @ 2015-10-13 10:58 UTC (permalink / raw)
To: Ian Campbell; +Cc: ard.biesheuvel, xen-devel, Stefano Stabellini
On Tue, 13 Oct 2015, Ian Campbell wrote:
> On Mon, 2015-10-12 at 18:18 +0100, Stefano Stabellini wrote:
> > @@ -30,9 +38,18 @@ function ovmf_build() {
> > git-checkout $OVMF_URL $OVMF_REVISION ovmf-dir
> > cd ovmf-dir
> >
> > - make -C BaseTools/Source/C
> > - OvmfPkg/build.sh -a X64 -b RELEASE -n 4
> > - cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
> > + make -C BaseTools
> > +
> > + if [[ $RAISIN_ARCH = "arm64" ]]
>
> Based on what I understand of the OVMF buildsystem I think you are going to
> eventually want a case $RAISIN_ARCH here, since it seems to vary a fair
> bit.
>
> > + then
> > + export GCC48_AARCH64_PREFIX=
>
> Won't this (unexpectedly) leak into other subsequent component builds? Or
> is each component built in a fresh sub-shell?
>
> What about host platforms which have a gcc other than 4.8? (e.g. Debian
> Jessie uses 4.9 by default)
>
> Should you add a comment explaining why this apparent workaround is needed?
That is a good question. It all comes from
https://wiki.linaro.org/LEG/UEFIforXEN, but I don't know why is
required. Without GCC48_AARCH64_PREFIX= and -t GCC48, it won't build.
Ard, do you know why? x86 doesn't need anything like that, as you can
see below.
> > + bash -c "source edksetup.sh && build -a AARCH64 -t GCC48 -p ArmVirtPkg/ArmVirtXen.dsc -b RELEASE"
> > + mkdir -p "$INST_DIR"/$PREFIX/lib/xen/boot
> > + cp Build/ArmVirtXen-AARCH64/RELEASE_GCC*/FV/XEN_EFI.fd "$INST_DIR"/$PREFIX/lib/xen/boot/XEN_EFI.fd
> > + else
> > + OvmfPkg/build.sh -a X64 -b RELEASE -n 4
> > + cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
> > + fi
> >
> > cd "$BASEDIR"
> > }
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 10:58 ` Stefano Stabellini
@ 2015-10-13 11:03 ` Ian Campbell
2015-10-13 11:24 ` Julien Grall
1 sibling, 0 replies; 14+ messages in thread
From: Ian Campbell @ 2015-10-13 11:03 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: xen-devel, ard.biesheuvel
On Tue, 2015-10-13 at 11:58 +0100, Stefano Stabellini wrote:
> On Tue, 13 Oct 2015, Ian Campbell wrote:
> > On Mon, 2015-10-12 at 18:18 +0100, Stefano Stabellini wrote:
> > > @@ -30,9 +38,18 @@ function ovmf_build() {
> > > git-checkout $OVMF_URL $OVMF_REVISION ovmf-dir
> > > cd ovmf-dir
> > >
> > > - make -C BaseTools/Source/C
> > > - OvmfPkg/build.sh -a X64 -b RELEASE -n 4
> > > - cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
> > > + make -C BaseTools
> > > +
> > > + if [[ $RAISIN_ARCH = "arm64" ]]
> >
> > Based on what I understand of the OVMF buildsystem I think you are
> > going to
> > eventually want a case $RAISIN_ARCH here, since it seems to vary a fair
> > bit.
> >
> > > + then
> > > + export GCC48_AARCH64_PREFIX=
> >
> > Won't this (unexpectedly) leak into other subsequent component builds?
> > Or
> > is each component built in a fresh sub-shell?
> >
> > What about host platforms which have a gcc other than 4.8? (e.g. Debian
> > Jessie uses 4.9 by default)
> >
> > Should you add a comment explaining why this apparent workaround is
> > needed?
>
> That is a good question. It all comes from
> https://wiki.linaro.org/LEG/UEFIforXEN, but I don't know why is
> required. Without GCC48_AARCH64_PREFIX= and -t GCC48, it won't build.
Is it just that GCC48_AARCH64_PREFIX defaults to some cross-compiler prefix
(e.g. aarch64-linux-gnu-) but a native build environment doesn't (always)
use that?
On Debian at least the prefixed name exists even for the native compiler,
but I'd not be surprised if that wasn't universal across all distros.
> Ard, do you know why? x86 doesn't need anything like that, as you can
> see below.
>
>
> > > + bash -c "source edksetup.sh && build -a AARCH64 -t GCC48 -p
> > > ArmVirtPkg/ArmVirtXen.dsc -b RELEASE"
> > > + mkdir -p "$INST_DIR"/$PREFIX/lib/xen/boot
> > > + cp Build/ArmVirtXen-AARCH64/RELEASE_GCC*/FV/XEN_EFI.fd
> > > "$INST_DIR"/$PREFIX/lib/xen/boot/XEN_EFI.fd
> > > + else
> > > + OvmfPkg/build.sh -a X64 -b RELEASE -n 4
> > > + cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
> > > + fi
> > >
> > > cd "$BASEDIR"
> > > }
> > >
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.xen.org
> > > http://lists.xen.org/xen-devel
> >
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 10:58 ` Stefano Stabellini
2015-10-13 11:03 ` Ian Campbell
@ 2015-10-13 11:24 ` Julien Grall
2015-10-13 12:49 ` Stefano Stabellini
1 sibling, 1 reply; 14+ messages in thread
From: Julien Grall @ 2015-10-13 11:24 UTC (permalink / raw)
To: Stefano Stabellini, Ian Campbell; +Cc: xen-devel, ard.biesheuvel
On 13/10/15 11:58, Stefano Stabellini wrote:
> On Tue, 13 Oct 2015, Ian Campbell wrote:
>> On Mon, 2015-10-12 at 18:18 +0100, Stefano Stabellini wrote:
>>> @@ -30,9 +38,18 @@ function ovmf_build() {
>>> git-checkout $OVMF_URL $OVMF_REVISION ovmf-dir
>>> cd ovmf-dir
>>>
>>> - make -C BaseTools/Source/C
>>> - OvmfPkg/build.sh -a X64 -b RELEASE -n 4
>>> - cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
>>> + make -C BaseTools
>>> +
>>> + if [[ $RAISIN_ARCH = "arm64" ]]
>>
>> Based on what I understand of the OVMF buildsystem I think you are going to
>> eventually want a case $RAISIN_ARCH here, since it seems to vary a fair
>> bit.
>>
>>> + then
>>> + export GCC48_AARCH64_PREFIX=
>>
>> Won't this (unexpectedly) leak into other subsequent component builds? Or
>> is each component built in a fresh sub-shell?
>>
>> What about host platforms which have a gcc other than 4.8? (e.g. Debian
>> Jessie uses 4.9 by default)
>>
>> Should you add a comment explaining why this apparent workaround is needed?
>
> That is a good question. It all comes from
> https://wiki.linaro.org/LEG/UEFIforXEN, but I don't know why is
> required. Without GCC48_AARCH64_PREFIX= and -t GCC48, it won't build.
Are you sure? I'm able to build without GCC48_AARCH64_PREFIX=.
Although -t GCC48 is still required:
42sh> build -a AARCH64 -p ArmVirtPkg/ArmVirtXen.dsc -b RELEASE
WORKSPACE = /root/works/edk2
ECP_SOURCE = /root/works/edk2/EdkCompatibilityPkg
EDK_SOURCE = /root/works/edk2/EdkCompatibilityPkg
EFI_SOURCE = /root/works/edk2/EdkCompatibilityPkg
EDK_TOOLS_PATH = /root/works/edk2/BaseTools
Architecture(s) = AARCH64
Build target = RELEASE
Toolchain = MYTOOLS
Active Platform = /root/works/edk2/ArmVirtPkg/ArmVirtXen.dsc
Flash Image Definition = /root/works/edk2/ArmVirtPkg/ArmVirtXen.fdf
Processing meta-data .................
build.py...
: error F000: Nothing to build
[/root/works/edk2/ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf]
--
Julien Grall
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 11:24 ` Julien Grall
@ 2015-10-13 12:49 ` Stefano Stabellini
2015-10-13 13:00 ` Ian Campbell
0 siblings, 1 reply; 14+ messages in thread
From: Stefano Stabellini @ 2015-10-13 12:49 UTC (permalink / raw)
To: Julien Grall; +Cc: xen-devel, ard.biesheuvel, Ian Campbell, Stefano Stabellini
On Tue, 13 Oct 2015, Julien Grall wrote:
> On 13/10/15 11:58, Stefano Stabellini wrote:
> > On Tue, 13 Oct 2015, Ian Campbell wrote:
> >> On Mon, 2015-10-12 at 18:18 +0100, Stefano Stabellini wrote:
> >>> @@ -30,9 +38,18 @@ function ovmf_build() {
> >>> git-checkout $OVMF_URL $OVMF_REVISION ovmf-dir
> >>> cd ovmf-dir
> >>>
> >>> - make -C BaseTools/Source/C
> >>> - OvmfPkg/build.sh -a X64 -b RELEASE -n 4
> >>> - cp Build/OvmfX64/RELEASE_GCC*/FV/OVMF.fd ovmf.bin
> >>> + make -C BaseTools
> >>> +
> >>> + if [[ $RAISIN_ARCH = "arm64" ]]
> >>
> >> Based on what I understand of the OVMF buildsystem I think you are going to
> >> eventually want a case $RAISIN_ARCH here, since it seems to vary a fair
> >> bit.
> >>
> >>> + then
> >>> + export GCC48_AARCH64_PREFIX=
> >>
> >> Won't this (unexpectedly) leak into other subsequent component builds? Or
> >> is each component built in a fresh sub-shell?
> >>
> >> What about host platforms which have a gcc other than 4.8? (e.g. Debian
> >> Jessie uses 4.9 by default)
> >>
> >> Should you add a comment explaining why this apparent workaround is needed?
> >
> > That is a good question. It all comes from
> > https://wiki.linaro.org/LEG/UEFIforXEN, but I don't know why is
> > required. Without GCC48_AARCH64_PREFIX= and -t GCC48, it won't build.
>
> Are you sure? I'm able to build without GCC48_AARCH64_PREFIX=.
I didn't git clean enough. You are right, only -t GCC48 is required.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 12:49 ` Stefano Stabellini
@ 2015-10-13 13:00 ` Ian Campbell
2015-10-13 13:16 ` Julien Grall
2015-10-13 13:18 ` Stefano Stabellini
0 siblings, 2 replies; 14+ messages in thread
From: Ian Campbell @ 2015-10-13 13:00 UTC (permalink / raw)
To: Stefano Stabellini, Julien Grall; +Cc: xen-devel, ard.biesheuvel
On Tue, 2015-10-13 at 13:49 +0100, Stefano Stabellini wrote:
> I didn't git clean enough. You are right, only -t GCC48 is required.
What if only e.g. gcc-4.9 is available though?
Ian.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 13:00 ` Ian Campbell
@ 2015-10-13 13:16 ` Julien Grall
2015-10-13 13:18 ` Stefano Stabellini
1 sibling, 0 replies; 14+ messages in thread
From: Julien Grall @ 2015-10-13 13:16 UTC (permalink / raw)
To: Ian Campbell, Stefano Stabellini; +Cc: xen-devel, ard.biesheuvel
On 13/10/15 14:00, Ian Campbell wrote:
> On Tue, 2015-10-13 at 13:49 +0100, Stefano Stabellini wrote:
>> I didn't git clean enough. You are right, only -t GCC48 is required.
>
> What if only e.g. gcc-4.9 is available though?
Note that I'm able to build ovmf on Jessie with -t GCC48.
Although I don't know what is the different between -t GCC48 and -t
GCC49. Ard might be able to tell more?
Regards,
--
Julien Grall
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 13:00 ` Ian Campbell
2015-10-13 13:16 ` Julien Grall
@ 2015-10-13 13:18 ` Stefano Stabellini
2015-10-13 13:31 ` Julien Grall
1 sibling, 1 reply; 14+ messages in thread
From: Stefano Stabellini @ 2015-10-13 13:18 UTC (permalink / raw)
To: Ian Campbell; +Cc: Julien Grall, ard.biesheuvel, xen-devel, Stefano Stabellini
On Tue, 13 Oct 2015, Ian Campbell wrote:
> On Tue, 2015-10-13 at 13:49 +0100, Stefano Stabellini wrote:
> > I didn't git clean enough. You are right, only -t GCC48 is required.
>
> What if only e.g. gcc-4.9 is available though?
It is just the no -t build that doesn't work. As far as I can tell
looking at BaseTools/Conf/tools_def.template there is no difference
between -t GCC49, -t GCC48 and -t GCC47 in terms of gcc flags.
Of course I could figure out the right GCCXX string to pass based on the
host gcc version, but it seems unnecessary.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 13:18 ` Stefano Stabellini
@ 2015-10-13 13:31 ` Julien Grall
2015-10-13 13:41 ` Stefano Stabellini
2015-10-13 13:43 ` Ard Biesheuvel
0 siblings, 2 replies; 14+ messages in thread
From: Julien Grall @ 2015-10-13 13:31 UTC (permalink / raw)
To: Stefano Stabellini, Ian Campbell; +Cc: xen-devel, ard.biesheuvel
On 13/10/15 14:18, Stefano Stabellini wrote:
> On Tue, 13 Oct 2015, Ian Campbell wrote:
>> On Tue, 2015-10-13 at 13:49 +0100, Stefano Stabellini wrote:
>>> I didn't git clean enough. You are right, only -t GCC48 is required.
>>
>> What if only e.g. gcc-4.9 is available though?
>
> It is just the no -t build that doesn't work. As far as I can tell
> looking at BaseTools/Conf/tools_def.template there is no difference
> between -t GCC49, -t GCC48 and -t GCC47 in terms of gcc flags.
The differences may be more subtle. I would be surprised if they
duplicate code just for having the variable name GCCXX matching the
version of the compiler.
For instance compiling using GCC 5.0 folds under GCC49. They didn't
bother to add a new GCCXX.
FWIW, the scripts to build x86 (OvmfPkg/build.sh) is detecting which
compiler is used and will setup the TARGET_TOOLS correctly:
gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
case $gcc_version in
4.5.*)
TARGET_TOOLS=GCC45
;;
4.6.*)
TARGET_TOOLS=GCC46
;;
4.7.*)
TARGET_TOOLS=GCC47
;;
4.8.*)
TARGET_TOOLS=GCC48
;;
4.9.*|4.1[0-9].*|5.*.*)
TARGET_TOOLS=GCC49
;;
*)
TARGET_TOOLS=GCC44
;;
esac
A couple of weeks ago I've looked at porting this script for ARM but it
wasn't trivial to do it (i.e requiring more than a couple of hours to
fix it).
Regards,
--
Julien Grall
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 13:31 ` Julien Grall
@ 2015-10-13 13:41 ` Stefano Stabellini
2015-10-13 13:43 ` Ard Biesheuvel
1 sibling, 0 replies; 14+ messages in thread
From: Stefano Stabellini @ 2015-10-13 13:41 UTC (permalink / raw)
To: Julien Grall; +Cc: xen-devel, ard.biesheuvel, Ian Campbell, Stefano Stabellini
On Tue, 13 Oct 2015, Julien Grall wrote:
> On 13/10/15 14:18, Stefano Stabellini wrote:
> > On Tue, 13 Oct 2015, Ian Campbell wrote:
> >> On Tue, 2015-10-13 at 13:49 +0100, Stefano Stabellini wrote:
> >>> I didn't git clean enough. You are right, only -t GCC48 is required.
> >>
> >> What if only e.g. gcc-4.9 is available though?
> >
> > It is just the no -t build that doesn't work. As far as I can tell
> > looking at BaseTools/Conf/tools_def.template there is no difference
> > between -t GCC49, -t GCC48 and -t GCC47 in terms of gcc flags.
>
> The differences may be more subtle. I would be surprised if they
> duplicate code just for having the variable name GCCXX matching the
> version of the compiler.
>
> For instance compiling using GCC 5.0 folds under GCC49. They didn't
> bother to add a new GCCXX.
>
> FWIW, the scripts to build x86 (OvmfPkg/build.sh) is detecting which
> compiler is used and will setup the TARGET_TOOLS correctly:
>
> gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
> case $gcc_version in
> 4.5.*)
> TARGET_TOOLS=GCC45
> ;;
> 4.6.*)
> TARGET_TOOLS=GCC46
> ;;
> 4.7.*)
> TARGET_TOOLS=GCC47
> ;;
> 4.8.*)
> TARGET_TOOLS=GCC48
> ;;
> 4.9.*|4.1[0-9].*|5.*.*)
> TARGET_TOOLS=GCC49
> ;;
> *)
> TARGET_TOOLS=GCC44
> ;;
> esac
>
> A couple of weeks ago I've looked at porting this script for ARM but it
> wasn't trivial to do it (i.e requiring more than a couple of hours to
> fix it).
And it wouldn't solve the problem for the current and past ovfm
versions. I think it might be best to just import the case .. esac
above into the raisin build script for ovmf arm64.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 13:31 ` Julien Grall
2015-10-13 13:41 ` Stefano Stabellini
@ 2015-10-13 13:43 ` Ard Biesheuvel
2015-10-13 13:48 ` Stefano Stabellini
1 sibling, 1 reply; 14+ messages in thread
From: Ard Biesheuvel @ 2015-10-13 13:43 UTC (permalink / raw)
To: Julien Grall; +Cc: xen-devel, Ian Campbell, Stefano Stabellini
> On 13 okt. 2015, at 15:31, Julien Grall <julien.grall@citrix.com> wrote:
>
>> On 13/10/15 14:18, Stefano Stabellini wrote:
>>> On Tue, 13 Oct 2015, Ian Campbell wrote:
>>>> On Tue, 2015-10-13 at 13:49 +0100, Stefano Stabellini wrote:
>>>> I didn't git clean enough. You are right, only -t GCC48 is required.
>>>
>>> What if only e.g. gcc-4.9 is available though?
>>
>> It is just the no -t build that doesn't work. As far as I can tell
>> looking at BaseTools/Conf/tools_def.template there is no difference
>> between -t GCC49, -t GCC48 and -t GCC47 in terms of gcc flags.
>
> The differences may be more subtle. I would be surprised if they
> duplicate code just for having the variable name GCCXX matching the
> version of the compiler.
>
That was actually the case starting out, (i.e., lots of toolchain definitions resolving to the same set of options) simply because a few guys thought it makes sense, and those guys happen to be in charge :-)
But in the mean time, as Stefano found out, the tiny code model we prefer for AArch64 (which uses relative symbol references but without the 4k alignment requirement imposed by the small model) is only available under gcc 4.9 and up so everything below that uses the large model (absolute symbol references only)
> For instance compiling using GCC 5.0 folds under GCC49. They didn't
> bother to add a new GCCXX.
>
> FWIW, the scripts to build x86 (OvmfPkg/build.sh) is detecting which
> compiler is used and will setup the TARGET_TOOLS correctly:
>
> gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
> case $gcc_version in
> 4.5.*)
> TARGET_TOOLS=GCC45
> ;;
> 4.6.*)
> TARGET_TOOLS=GCC46
> ;;
> 4.7.*)
> TARGET_TOOLS=GCC47
> ;;
> 4.8.*)
> TARGET_TOOLS=GCC48
> ;;
> 4.9.*|4.1[0-9].*|5.*.*)
> TARGET_TOOLS=GCC49
> ;;
> *)
> TARGET_TOOLS=GCC44
> ;;
> esac
>
> A couple of weeks ago I've looked at porting this script for ARM but it
> wasn't trivial to do it (i.e requiring more than a couple of hours to
> fix it).
>
> Regards,
>
> --
> Julien Grall
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 13:43 ` Ard Biesheuvel
@ 2015-10-13 13:48 ` Stefano Stabellini
2015-10-13 14:02 ` Ard Biesheuvel
0 siblings, 1 reply; 14+ messages in thread
From: Stefano Stabellini @ 2015-10-13 13:48 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: Julien Grall, xen-devel, Ian Campbell, Stefano Stabellini
On Tue, 13 Oct 2015, Ard Biesheuvel wrote:
> > On 13 okt. 2015, at 15:31, Julien Grall <julien.grall@citrix.com> wrote:
> >
> >> On 13/10/15 14:18, Stefano Stabellini wrote:
> >>> On Tue, 13 Oct 2015, Ian Campbell wrote:
> >>>> On Tue, 2015-10-13 at 13:49 +0100, Stefano Stabellini wrote:
> >>>> I didn't git clean enough. You are right, only -t GCC48 is required.
> >>>
> >>> What if only e.g. gcc-4.9 is available though?
> >>
> >> It is just the no -t build that doesn't work. As far as I can tell
> >> looking at BaseTools/Conf/tools_def.template there is no difference
> >> between -t GCC49, -t GCC48 and -t GCC47 in terms of gcc flags.
> >
> > The differences may be more subtle. I would be surprised if they
> > duplicate code just for having the variable name GCCXX matching the
> > version of the compiler.
> >
>
> That was actually the case starting out, (i.e., lots of toolchain definitions resolving to the same set of options) simply because a few guys thought it makes sense, and those guys happen to be in charge :-)
>
> But in the mean time, as Stefano found out, the tiny code model we prefer for AArch64 (which uses relative symbol references but without the 4k alignment requirement imposed by the small model) is only available under gcc 4.9 and up so everything below that uses the large model (absolute symbol references only)
Do you mean is only available for gcc <= 4.9 and gcc >= 4.7 ?
Do you think it is best to just force -t GCC48 independently from the
actual gcc version? Or should we use some kind of logic like the one
below:
> > gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
> > case $gcc_version in
> > 4.5.*)
> > TARGET_TOOLS=GCC45
> > ;;
> > 4.6.*)
> > TARGET_TOOLS=GCC46
> > ;;
> > 4.7.*)
> > TARGET_TOOLS=GCC47
> > ;;
> > 4.8.*)
> > TARGET_TOOLS=GCC48
> > ;;
> > 4.9.*|4.1[0-9].*|5.*.*)
> > TARGET_TOOLS=GCC49
> > ;;
> > *)
> > TARGET_TOOLS=GCC44
> > ;;
> > esac
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] raisin: enable ovmf build for arm64
2015-10-13 13:48 ` Stefano Stabellini
@ 2015-10-13 14:02 ` Ard Biesheuvel
0 siblings, 0 replies; 14+ messages in thread
From: Ard Biesheuvel @ 2015-10-13 14:02 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: Julien Grall, xen-devel, Ian Campbell
> On 13 okt. 2015, at 15:48, Stefano Stabellini <stefano.stabellini@eu.citrix.com> wrote:
>
> On Tue, 13 Oct 2015, Ard Biesheuvel wrote:
>>> On 13 okt. 2015, at 15:31, Julien Grall <julien.grall@citrix.com> wrote:
>>>
>>>>> On 13/10/15 14:18, Stefano Stabellini wrote:
>>>>>> On Tue, 13 Oct 2015, Ian Campbell wrote:
>>>>>> On Tue, 2015-10-13 at 13:49 +0100, Stefano Stabellini wrote:
>>>>>> I didn't git clean enough. You are right, only -t GCC48 is required.
>>>>>
>>>>> What if only e.g. gcc-4.9 is available though?
>>>>
>>>> It is just the no -t build that doesn't work. As far as I can tell
>>>> looking at BaseTools/Conf/tools_def.template there is no difference
>>>> between -t GCC49, -t GCC48 and -t GCC47 in terms of gcc flags.
>>>
>>> The differences may be more subtle. I would be surprised if they
>>> duplicate code just for having the variable name GCCXX matching the
>>> version of the compiler.
>>>
>>
>> That was actually the case starting out, (i.e., lots of toolchain definitions resolving to the same set of options) simply because a few guys thought it makes sense, and those guys happen to be in charge :-)
>>
>> But in the mean time, as Stefano found out, the tiny code model we prefer for AArch64 (which uses relative symbol references but without the 4k alignment requirement imposed by the small model) is only available under gcc 4.9 and up so everything below that uses the large model (absolute symbol references only)
>
> Do you mean is only available for gcc <= 4.9 and gcc >= 4.7 ?
>
The first gcc version to support the AArch64 tiny model is 4.9, but Linaro backported it so some variants of 4.8 support it as well.
> Do you think it is best to just force -t GCC48 independently from the
> actual gcc version? Or should we use some kind of logic like the one
> below:
>
For now, just using GCC48 should work fine, but as I said, the tiny model is the recommended model so if you have 4.9, it is preferred imo. But other than that, the builds should be mostly identical.
>
>>> gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
>>> case $gcc_version in
>>> 4.5.*)
>>> TARGET_TOOLS=GCC45
>>> ;;
>>> 4.6.*)
>>> TARGET_TOOLS=GCC46
>>> ;;
>>> 4.7.*)
>>> TARGET_TOOLS=GCC47
>>> ;;
>>> 4.8.*)
>>> TARGET_TOOLS=GCC48
>>> ;;
>>> 4.9.*|4.1[0-9].*|5.*.*)
>>> TARGET_TOOLS=GCC49
>>> ;;
>>> *)
>>> TARGET_TOOLS=GCC44
>>> ;;
>>> esac
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2015-10-13 14:02 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-12 17:18 [PATCH] raisin: enable ovmf build for arm64 Stefano Stabellini
2015-10-13 10:41 ` Ian Campbell
2015-10-13 10:58 ` Stefano Stabellini
2015-10-13 11:03 ` Ian Campbell
2015-10-13 11:24 ` Julien Grall
2015-10-13 12:49 ` Stefano Stabellini
2015-10-13 13:00 ` Ian Campbell
2015-10-13 13:16 ` Julien Grall
2015-10-13 13:18 ` Stefano Stabellini
2015-10-13 13:31 ` Julien Grall
2015-10-13 13:41 ` Stefano Stabellini
2015-10-13 13:43 ` Ard Biesheuvel
2015-10-13 13:48 ` Stefano Stabellini
2015-10-13 14:02 ` Ard Biesheuvel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.