This is a followup to the patch 'BaseTools AARCH64: add -mstrict-align to all AARCH64 GCC flavors' that I sent out yesterday. As it turns out, using strict alignment results in a code size increase which breaks the build for the DEBUG shell using the tiny code model we use for GCC49 and up.
(Note to Leif: D02 uses -mstrict-align in its platform specific C flags as well, that is why we hit it there before anywhere else) I have reproduced some patches here that I have already sent out separately (#6) or as part of another series (#1, #2) but I included them again since they need to be merged in order to prevent breaking bisect due to build errors. Patches #1 and #2 set the CLANG35 target to the GNU flavor of the respective architectures, and adds the target to the preprocessor invocations as well. Patch #3 reduces the function alignment for the tiny code model to 4 bytes, and sorts the linker input by alignment. This ensures that all tiny model code is kept in close proximity of each other when using small code model .text using the default 8 byte function alignment in the same binary. This prevents potential linker errors if the binary exceeds 1 MB in size. Patch #4 overrides the code model and function alignment for all modules of type UEFI_APPLICATION that are built as part of ArmVirtQemu or ArmVirtXen when using GCC49. This combines with the changes in patch #3 to ensure that binaries containing both small and tiny code model .text can link successfully. Patch #5 removes the build options for AARCH64 from ShellPkg. They need to be overridden anyway or they will only affect the core Shell binary and not all of the Shell component libraries that are merged with the core binary at build time. Also, we only need this override for GCC49, since GCC 48 and earlier use the large code model, and CLANG35 uses the small code model. Patch #6 moves the -mstrict-align compiler option to the common AARCH64/GCC CFLAGS definition so that it applies to all GCC versions in addition to CLANG35. This addresses an issue spotted by the Ubuntu/Debian folks (and which they kindly never reported upstream, afaict) here: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560 Ard Biesheuvel (6): BaseTools CLANG35: use GNU target triplets explicitly BaseTools CLANG35: use -target in PP flags as well BaseTools AARCH64: reduce tiny model function alignment ArmVirtPkg: use small code model for all UEFI_APPLICATION modules ShellPkg AARCH64: remove DEBUG BuildOptions override BaseTools AARCH64: add -mstrict-align to all AARCH64 GCC flavors ArmVirtPkg/ArmVirt.dsc.inc | 21 ++++++++++++++ BaseTools/Conf/tools_def.template | 29 +++++++++++--------- ShellPkg/Application/Shell/Shell.inf | 7 ----- 3 files changed, 37 insertions(+), 20 deletions(-) -- 2.5.0 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

