How to resolve undefined references to "__stack_chk_fail" in S32DS

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to resolve undefined references to "__stack_chk_fail" in S32DS

2,976 次查看
xiongsl
Contributor I

Hi,

I create a new application project and add the command -fstack-protector-all. The compilation fails with the following message:

undefined reference to `__stack_chk_fail'

undefined reference to `__stack_chk_guard'

 

S32DS projects created from Example support the -fstack-protector-all command.

I didn't find any difference in the stack protection configuration between these two projects,Can you help me with this?

MCU:FS32K146, IDE:S32DS

1700.png

0 项奖励
回复
5 回复数

2,931 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

is into your non-example project properly linked STD C library? What version of gcc are you using? 

jiri_kral_0-1728464247821.png

 

 

0 项奖励
回复

2,926 次查看
xiongsl
Contributor I

Hi,

I have the same configuration as you, GCC version 6.3

xiongsl_0-1728465872978.png

xiongsl_1-1728466077647.png

 

 

0 项奖励
回复

2,923 次查看
xiongsl
Contributor I
 
0 项奖励
回复

2,918 次查看
jiri_kral
NXP Employee
NXP Employee

I tested your project and it can be build without any issue. What's your S32DS version? 

0 项奖励
回复

2,899 次查看
xiongsl
Contributor I

S32DS version is 3.4

 

xiongsl_0-1728524682595.png

xiongsl_1-1728524731469.png

xiongsl_2-1728524773526.png

xiongsl_3-1728525105024.png

 

 

 

0 项奖励
回复