How to resolve undefined references to "__stack_chk_fail" in S32DS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to resolve undefined references to "__stack_chk_fail" in S32DS

2,897 Views
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 Kudos
Reply
5 Replies

2,852 Views
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 Kudos
Reply

2,847 Views
xiongsl
Contributor I

Hi,

I have the same configuration as you, GCC version 6.3

xiongsl_0-1728465872978.png

xiongsl_1-1728466077647.png

 

 

0 Kudos
Reply

2,844 Views
xiongsl
Contributor I
 
0 Kudos
Reply

2,839 Views
jiri_kral
NXP Employee
NXP Employee

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

0 Kudos
Reply

2,820 Views
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 Kudos
Reply