this include generates a translation unit too large for clang to process

关键词

嵌入式、C语言、autosar

平台说明

项目Value
OSautosar OS
芯片厂商TI
编程语言C,C++
编译器LLVM

在这里插入图片描述

一、BUG背景

1.场景

1.添加或者删除task。
2.添加module。
3.section相关改动。

2.现象

编译错误:this include generates a translation unit too large for clang to process
在这里插入图片描述

二、问题分析

1.MemMap_compatibility.h

除了指定的内存映射头文件之外,MICROSAR MemMap还提供了生成一个名为MemMap_Compatibility.h的文件,用于兼容内存映射的头文件,可以理解为一个额外的扩展文件。根据vector和TI的回复综合考虑,初步判定为改文件中的section map 越界。后期核实确定问题点后更新。

2.Activation

To activate the generation of the compatibility memory mapping header file, the following
parameter must be set to a value other than NON:
/MICROSAR/MemMap/MemMapGeneral/MemMapCompatibilityGeneration

3.Empty File Generation

For testing purposes, the MICROSAR MemMap supports the generation of either empty
memory mapping header files or memory allocation keywords without pragma statements.
This can be useful to reduce build times during development of a project or to build the
project for tests on a host, where memory mapping is not applicable (e.g. VTT).

3.1Activation

To activate the empty memory mapping header file generation, the following parameter
must be set to EMPTY:
/MICROSAR/MemMap/MemMapGeneral/MemMapGeneration
To activate the generation of memory allocation keywords without pragma statements,
the following parameter must be set to FALSE:
/MICROSAR/MemMap/MemMapGeneral/MemMapGeneratePragmas

三、解决方案

1.临时解决方案

1.把MemMapCompatibilityGeneration 设置为NON,MemMapGeneration设置为EMPTY。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2.裁剪demo中的MemMap.h,适配于实际工程。该文件为vector给的一个demo文件,可以适当根据实际项目修改。
3.生成后效果如图,会清空XX_MemMap.h文件
在这里插入图片描述

四、结果

编译通过且功能正常,对比生成的文件差异在可控范围内。

小结

该方案为临时方案,可能会导致后续的MPU功能以及功能安全设计。欢迎各位大佬探讨另外的解决方案。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

老灰╮(╯-╰)╭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值