OK,
You are also right that
GCC:*_*_ARM_PLATFORM_FLAGS = -march=armv8-a
should be used (this was my original modification, which was changed later).
Alexei.
-----Original Message----- From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] Sent: 27 July 2016 17:27 To: Alexei Fedorov Subject: Re: [Linaro-uefi] [PATCH] Platforms/ARM/Juno: Add GCC ARMv8 target architecture flag
On 27 July 2016 at 17:58, Alexei Fedorov Alexei.Fedorov@arm.com wrote:
See below:
"C:\Linaro_GCC\bin\arm-none-eabi-gcc" -mthumb -Iq:\edk2/ArmPlatformPkg/ArmVExpressPkg/Include -Iq:\edk2/ArmPlatformPkg/ArmJunoPkg/Include -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=BaseMemoryLibStmStrings -g -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -c -include AutoGen.h -fno-common -mlittle-endian -mabi=aapcs -fno-short-enums -save-temps -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fstack-protector -mword-relocations -mno-unaligned-access -O0 -o q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\BaseMemoryLibStm\ BaseMemoryLibStm\OUTPUT.\SetMem64Wrapper.obj -Iq:\edk2\ArmPkg\Lib rary\BaseMemoryLibStm\Arm -Iq:\edk2\ArmPkg\Library\BaseMemoryLibStm -Iq:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\BaseMemoryLibSt m\BaseMemoryLibStm\DEBUG -Iq:\edk2\MdePkg -Iq:\edk2\MdePkg\Include -Iq:\edk2\MdePkg\Include\Arm -Iq:\edk2\ArmPkg -Iq:\edk2\ArmPkg\Include q:\edk2\ArmPkg\Library\BaseMemoryLibStm\SetMem64Wrapper.c q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii: Assembler messages: q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:21: Error: attempt to use an ARM instruction on a Thumb-only processor -- `push {r4-r8}' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:23: Error: attempt to use an ARM instruction on a Thumb-only processor -- `push {r0}' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:26: Error: attempt to use an ARM instruction on a Thumb-only processor -- `ldr r7,[r0,#28]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:27: Error: attempt to use an ARM instruction on a Thumb-only processor -- `ldr r6,[r0,#24]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:28: Error: attempt to use an ARM instruction on a Thumb-only processor -- `ldr r5,[r0,#20]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:29: Error: attempt to use an ARM instruction on a Thumb-only processor -- `ldr r4,[r0,#16]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:30: Error: attempt to use an ARM instruction on a Thumb-only processor -- `ldr r3,[r0,#12]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:31: Error: attempt to use an ARM instruction on a Thumb-only processor -- `ldr r2,[r0,#8]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:32: Error: attempt to use an ARM instruction on a Thumb-only processor -- `ldr r1,[r0,#4]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:33: Error: attempt to use an ARM instruction on a Thumb-only processor -- `ldr r0,[r0,#0]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:35: Error: attempt to use an ARM instruction on a Thumb-only processor -- `smc #0' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:38: Error: attempt to use an ARM instruction on a Thumb-only processor -- `pop {r8}' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:42: Error: attempt to use an ARM instruction on a Thumb-only processor -- `str r3,[r8,#12]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:43: Error: attempt to use an ARM instruction on a Thumb-only processor -- `str r2,[r8,#8]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:44: Error: attempt to use an ARM instruction on a Thumb-only processor -- `str r1,[r8,#4]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:45: Error: attempt to use an ARM instruction on a Thumb-only processor -- `str r0,[r8,#0]' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:47: Error: attempt to use an ARM instruction on a Thumb-only processor -- `mov r0,r8' Mqakefile:290: recipe for target 'q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmc Lib\OUTPUT\Arm\ArmSmc.obj' failed :\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:50: Error: attempt to use an ARM instruction on a Thumb-only processor -- `pop {r4-r8}' q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmcLib\OUTPUT\Arm\ArmSmc.iii:52: Error: attempt to use an ARM instruction on a Thumb-only processor -- `bx lr' make: *** [q:\edk2\Build\ArmJuno\DEBUG_GCC49\ARM\ArmPkg\Library\ArmSmcLib\ArmSmc Lib\OUTPUT\Arm\ArmSmc.obj] Error 1
This error is reported by: arm-none-eabi-gcc.exe (GNU Tools for ARM Embedded Processors) 4.9.3 20141119 (release) [ARM/embedded-4_9-branch revision 218278
but doesn't occur with: arm-eabi-gcc.exe (Linaro GCC 4.9-2015.05) 4.9.3 20150413 (prerelease)
, so looks like GCC internal issue.
These GCCs are simply built for different default targets.
So adding -march=armv8-a to ARM's platform flags is fine by me
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.