Cannot Debug with Link Time Optimisations On

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Cannot Debug with Link Time Optimisations On

ソリューションへジャンプ
1,792件の閲覧回数
peterb2
Contributor III

When turning on the link time optimisations (the -flto compile option), the debug info in the elf file is being removed for all but the .S files.  If you look at the .map file you can also see that it is not listed.  Is this a consequence of having this level of optimisations on or is it a bug?

Target Info

* MPC5777C

* Using S32DS V1.2 for Power PC

* Also compiling with max optimizations on, the -O3 switch

* debug compile options are -g3 -gdwarf-4

If you have any questions please let me know.

1 解決策
1,425件の閲覧回数
martin_kovar
NXP Employee
NXP Employee

Hello,

I found some explanation at Stackoverflow website. It seems it is not possible to combine -flto with -g parameter. Please check the link below:

gcc LTO appears to strip debugging symbols - Stack Overflow 

Regards,

Martin

元の投稿で解決策を見る

2 返答(返信)
1,425件の閲覧回数
peterb2
Contributor III

To add some clarification, I mean that when I compile with the -flto option, all .c and .cpp files are missing from the debug info section in the elf file but when I remove the -flto option all those files have debug info.

0 件の賞賛
返信
1,426件の閲覧回数
martin_kovar
NXP Employee
NXP Employee

Hello,

I found some explanation at Stackoverflow website. It seems it is not possible to combine -flto with -g parameter. Please check the link below:

gcc LTO appears to strip debugging symbols - Stack Overflow 

Regards,

Martin