设为首页收藏本站
查看: 16538|回复: 0

ARM Compiler 6编译error'#pragma push/pop' is an ARM Compiler 5...[-Werror,-Wa...

[复制链接]

231

主题

64

回帖

2145

积分

管理员

积分
2145
玉米糊 发表于 2015-11-4 14:41:54 | 显示全部楼层 |阅读模式
ARM Compiler 6编译错误:
[mw_shl_code=bash,true]/home/system2/BSP_QC8992/Dev_env/trustzone_images/core/securemsm/trustzone/qsee/include/tzbsp_syscall.h:37:9: error: '#pragma diag_suppress' is an ARM Compiler 5 extension, and is not supported by ARM Compiler 6 [-Werror,-Warmcc-pragma-diag]
#pragma diag_suppress 1295 /* Allow argument less function prototypes. */
        ^
/home/system2/BSP_QC8992/Dev_env/trustzone_images/core/securemsm/trustzone/armlib/v7/inc/tzbsp_mcrmrc.h:64:9: error: '#pragma push' is an ARM Compiler 5 extension, and is not supported by ARM Compiler 6 [-Warmcc-pragma-push-pop]
#pragma push
        ^
/home/system2/BSP_QC8992/Dev_env/trustzone_images/core/securemsm/trustzone/armlib/v7/inc/tzbsp_mcrmrc.h:65:9: error: '#pragma arm' is an ARM Compiler 5 extension, and is not supported by ARM Compiler 6 [-Warmcc-pragma-arm]
#pragma arm
        ^
/home/system2/BSP_QC8992/Dev_env/trustzone_images/core/securemsm/trustzone/armlib/v7/inc/tzbsp_mcrmrc.h:91:9: error: '#pragma pop' is an ARM Compiler 5 extension, and is not supported by ARM Compiler 6 [-Warmcc-pragma-push-pop]
#pragma pop
        ^
4 errors generated.
scons: *** [/home/system2/BSP_QC8992/Dev_env/trustzone_images/core/securemsm/trustzone/qsee/kernel/build/qsee/scorpion/BAWAANAA/src/tzbsp_dload_mode.o] Error 1[/mw_shl_code]

这个错误包含了"#pragma push"、"#pragma arm" 和 "#pragma pop" 等错误。
当前的程序指定用于ARM Compiler 5及其早起版本,默认情况下会被ARM Compiler 6.00忽略,包括
  • ARM Compiler 6.00 (build 18)
  • ARM Compiler 6.00 update1(build 21)
  • ARM Compiler 6.00 update2(build 46)

为了帮助用户从ARM Compiler 5迁移到 ARM Compiler 5时,尽量识别潜在的重要问题,ARM Compiler 6.01 (build 22)后更改了一些行为。

ARM Compiler 6.01 迁移和兼容性指南请参考:http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0742b/chr1398871316050.html

这个页面描述如何使用“-Wno-error=<diag-group>”选项,从而降级错误为警告级别:
  • -Wno-error=armcc-pragma-push-pop 解决错误:#pragma push、#pragma pop
  • -Wno-error=armcc-pragma-arm 解决错误:#pragma arm
  • -Wno-error=armcc-pragma-diag 解决错误:#pragma diag_suppress

例如:
[mw_shl_code=c,true]
#pragma push
#pragma arm

int fn(int x) {
  return 2 * x;
}

#pragma pop[/mw_shl_code]


编译会出错:
[mw_shl_code=bash,true]$ armclang --target=aarch64-arm-none-eabi -c foo.c

foo.c:2:9: error: '#pragma push' is an ARM Compiler 5 extension, and is not
      supported by ARM Compiler 6 [-Warmcc-pragma-push-pop]
#pragma push
        ^
foo.c:3:9: error: '#pragma arm' is an ARM Compiler 5 extension, and is not
      supported by ARM Compiler 6 [-Warmcc-pragma-arm]
#pragma arm
        ^
foo.c:9:9: error: '#pragma pop' is an ARM Compiler 5 extension, and is not
      supported by ARM Compiler 6 [-Warmcc-pragma-push-pop]
#pragma pop
        ^
3 errors generated.[/mw_shl_code]


加上编译选项后:
[mw_shl_code=bash,true]$ armclang --target=aarch64-arm-none-eabi -c foo.c -Wno-error=armcc-pragma-push-pop -Wno-error=armcc-pragma-arm
foo.c:2:9: warning: '#pragma push' is an ARM Compiler 5 extension, and is not
      supported by ARM Compiler 6 [-Warmcc-pragma-push-pop]
#pragma push
        ^
foo.c:3:9: warning: '#pragma arm' is an ARM Compiler 5 extension, and is not
      supported by ARM Compiler 6 [-Warmcc-pragma-arm]
#pragma arm
        ^
foo.c:9:9: warning: '#pragma pop' is an ARM Compiler 5 extension, and is not
      supported by ARM Compiler 6 [-Warmcc-pragma-push-pop]
#pragma pop
        ^
3 warnings generated.[/mw_shl_code]



回复

使用道具 举报

您需要登录后才可以回帖 登录

本版积分规则

Archiver|手机版|小黑屋|米尔科技论坛   

GMT+8, 2024-11-24 12:15 , Processed in 0.050752 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表