Skip to contentSkip to conversation

raisin: enable ovmf build for arm64

PATCH Superseded Stefano Stabellini 4 participants 14 messages Oct 12, 2015 – Oct 13, 2015

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raisin: enable ovmf build for arm64

components/ovmf +27 -10
index ffdde19..d2ed96c 100644
@@ -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"
 }
#1 lore raw

components/ovmf function ovmf_build() { · line 43

Quoted 10 lines · Stefano Stabellini
components/ovmf +3 -3
@@ -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.

components/ovmf function ovmf_build() { · line 45

Quoted 2 lines
components/ovmf +2 -0
+    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?

Quoted 15 lines
components/ovmf +7 -0
+        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
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 19 lines · Ian Campbell

components/ovmf function ovmf_build() { · line 43

Quoted 10 lines · Stefano Stabellini
components/ovmf +3 -3
@@ -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.

components/ovmf function ovmf_build() { · line 45

Quoted 2 lines
components/ovmf +2 -0
+    then
+        export GCC48_AARCH64_PREFIX=
Quoted 7 lines

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.

Quoted 16 lines
Quoted 15 lines
components/ovmf +7 -0
+        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
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 28 lines · Stefano Stabellini
Quoted 27 lines · Ian Campbell

components/ovmf function ovmf_build() { · line 43

Quoted 10 lines · Stefano Stabellini
components/ovmf +3 -3
@@ -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.

components/ovmf function ovmf_build() { · line 45

Quoted 2 lines
components/ovmf +2 -0
+    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)

Quoted 6 lines
Quoted 2 lines

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.

Quoted 22 lines

Ard, do you know why? x86 doesn't need anything like that, as you can see below.

Quoted 18 lines
Quoted 17 lines
(quoted diff) +1 -0
+        bash -c "source edksetup.sh && build -a AARCH64 -t GCC48 -p

ArmVirtPkg/ArmVirtXen.dsc -b RELEASE"

(quoted diff) +2 -0
+        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

components/ovmf +4 -0
+    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
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Stefano Stabellini
Quoted 23 lines · Stefano Stabellini
Quoted 22 lines · Ian Campbell

components/ovmf function ovmf_build() { · line 43

Quoted 10 lines · Stefano Stabellini
components/ovmf +3 -3
@@ -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.

components/ovmf function ovmf_build() { · line 45

Quoted 2 lines
components/ovmf +2 -0
+    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?

Quoted 8 lines
Quoted 4 lines

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]

Signature · 1 line
Julien Grall
#5 lore raw
Quoted 27 lines · Julien Grall
Quoted 26 lines · Stefano Stabellini
Quoted 25 lines · Ian Campbell

components/ovmf function ovmf_build() { · line 43

Quoted 10 lines · Stefano Stabellini
components/ovmf +3 -3
@@ -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.

components/ovmf function ovmf_build() { · line 45

Quoted 2 lines
components/ovmf +2 -0
+    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)

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

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.

#6 lore raw
Quoted 1 line · Stefano Stabellini

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.

#7 lore raw
Quoted 4 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

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,

Signature · 1 line
Julien Grall
#8 lore raw
In reply to Ian Campbell
Quoted 4 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

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.

#9 lore raw
Quoted 9 lines · Stefano Stabellini
Quoted 4 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

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,

Signature · 1 line
Julien Grall
#10 lore raw
Quoted 43 lines · Julien Grall
Quoted 9 lines · Stefano Stabellini
Quoted 4 lines · Ian Campbell
Quoted 1 line · Stefano Stabellini

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
Quoted 3 lines

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.

#11 lore raw
In reply to Julien Grall
Quoted 10 lines · Julien Grall
Quoted 8 lines · Stefano Stabellini
Quoted 5 lines · Ian Campbell
Quoted 2 lines · Stefano Stabellini

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?

Quoted 8 lines
Quoted 3 lines

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)

Quoted 36 lines

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,

Signature · 1 line
Julien Grall
#12 lore raw
Quoted 13 lines · Ard Biesheuvel
Quoted 13 lines · Julien Grall
Quoted 11 lines · Stefano Stabellini
Quoted 5 lines · Ian Campbell
Quoted 2 lines · Stefano Stabellini

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.

Quoted 8 lines
Quoted 4 lines

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:

Quoted 21 lines
Quoted 21 lines
   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
#13 lore raw
Quoted 22 lines · Stefano Stabellini
Quoted 18 lines · Ard Biesheuvel
Quoted 17 lines · Julien Grall
Quoted 11 lines
Quoted 7 lines · Stefano Stabellini
Quoted 3 lines · Ian Campbell

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.

Quoted 6 lines
Quoted 3 lines

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.

Quoted 4 lines

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.

Quoted 23 lines
Quoted 22 lines
Quoted 22 lines
  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