Hi,
On 7 December 2012 13:19, Shivamurthy Shastri shiva.linuxworks@gmail.com wrote:
Hi,
I am trying to compile UEFI code with linaro toolchain version:
# arm-linux-gnueabi-gcc --version arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.1-5ubuntu1~ppa1) 4.7.1 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I got the erros as follows:
"/usr/bin/arm-linux-gnueabi-gcc" -mthumb -march=armv7-a -I/home/shiva/workspace/arndale/edk2/SamsungPlatformPkg/ExynosPkg/Exynos5250/Include/Platform -g -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-array-bounds -c -include AutoGen.h -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -O0 -o /home/shiva/workspace/arndale/edk2/Build/Arndale-Exynos/DEBUG_ARMLINUXGCC/ARM/SamsungPlatformPkg/ExynosPkg/Exynos5250/Sec/Sec/OUTPUT/./Smc.obj -I/home/shiva/workspace/arndale/edk2/SamsungPlatformPkg/ExynosPkg/Exynos5250/Sec -I/home/shiva/workspace/arndale/edk2/Build/Arndale-Exynos/DEBUG_ARMLINUXGCC/ARM/SamsungPlatformPkg/ExynosPkg/Exynos5250/Sec/Sec/DEBUG -I/home/shiva/workspace/arndale/edk2/MdePkg -I/home/shiva/workspace/arndale/edk2/MdePkg/Include -I/home/shiva/workspace/arndale/edk2/MdePkg/Include/Arm -I/home/shiva/workspace/arndale/edk2/MdeModulePkg -I/home/shiva/workspace/arndale/edk2/MdeModulePkg/Include -I/home/shiva/workspace/arndale/edk2/ArmPkg -I/home/shiva/workspace/arndale/edk2/ArmPkg/Include -I/home/shiva/workspace/arndale/edk2/ArmPlatformPkg -I/home/shiva/workspace/arndale/edk2/ArmPlatformPkg/Include -I/home/shiva/workspace/arndale/edk2/SamsungPlatformPkg/ExynosPkg/Exynos5250 -I/home/shiva/workspace/arndale/edk2/SamsungPlatformPkg/ExynosPkg/Exynos5250/Include /home/shiva/workspace/arndale/edk2/SamsungPlatformPkg/ExynosPkg/Exynos5250/Sec/Smc.c Smc.s: Assembler messages: Smc.s:51: Error: selected processor does not support Thumb mode `smc 0'
Is there any issue with the toolchain or any flags I am using?
The issue is the -march=armv7-a option. Technically, baseline ARMv7-A does not support the 'smc' instruction - it is added by the Security Extensions.
Gas (which is the program producing your error message) is following this behaviour. Gas does expose -march=armv7-a+sec which does allow 'smc', unfortunately GCC does not understand this option.
There are two ways around this:
1) Use -mcpu=<some ARMv7-A core> instead of -march=armv7-a. If all you want is 'smc', using -mcpu=cortex-a8 will do.
2) If you are using inline assembly to generate the 'smc' instruction, add '.arch_extension sec' to the assembly before the sec instruction.
I hope this helps.
Thanks,
Matt
-- Matthew Gretton-Dann Linaro Toolchain Working Group matthew.gretton-dann@linaro.org