Yocto Project Discussions
 help / color / mirror / Atom feed
* Having issue using gcc-sanitizer
@ 2024-11-20 14:47 Ninad Palsule
  2024-11-20 15:53 ` [yocto] " Gyorgy Sarvari
  0 siblings, 1 reply; 3+ messages in thread
From: Ninad Palsule @ 2024-11-20 14:47 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]

Hello,

I want to add *-sanitize* option to my application. I performed following changes.
I see that *gcc-sanitize* target is pulled and compiled by application is not linking the correct files.
I am trying to use this target: meta/recipes-devtools/gcc/gcc-sanitizers_13.2.bb
Am I missing some changes to include this target for my app.

*+++ b/meta-ibm/recipes-phosphor/mboxd/mboxd_%.bbappend*
+FULL_OPTIMIZATION:append=" -Og -fsanitize=address,undefined "
+TARGET_CPPFLAGS:append=" -O0 "

*+++ b/meta-ibm/recipes-phosphor/images/obmc-phosphor-image.bbappend*
-OBMC_IMAGE_EXTRA_INSTALL:append:p10bmc = " mboxd"
+OBMC_IMAGE_EXTRA_INSTALL:append:p10bmc = " mboxd mboxd-src mboxd-dbg libasan libubsan"

*I am getting following errors in the mbox configure.*
openbmc/build/p10bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/mboxd/1.0+git/recipe-sysroot-native/usr/bin/arm-openbmc-linux-gnueabi/../../libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/13.2.0/ld: cannot find libasan_preinit.o: No such file or directory
openbmc/build/p10bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/mboxd/1.0+git/recipe-sysroot-native/usr/bin/arm-openbmc-linux-gnueabi/../../libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/13.2.0/ld: cannot find -lasan: No such file or directory
openbmc/build/p10bmc/tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/mboxd/1.0+git/recipe-sysroot-native/usr/bin/arm-openbmc-linux-gnueabi/../../libexec/arm-openbmc-linux-gnueabi/gcc/arm-openbmc-linux-gnueabi/13.2.0/ld: cannot find -lubsan: No such file or directory
collect2: error: ld returned 1 exit status
configure:4101: $? = 1
configure:4142: result: no
configure: failed program was:

I appreciate your help!

Thanks & Regards,
Ninad Palsule

[-- Attachment #2: Type: text/html, Size: 2154 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [yocto] Having issue using gcc-sanitizer
  2024-11-20 14:47 Having issue using gcc-sanitizer Ninad Palsule
@ 2024-11-20 15:53 ` Gyorgy Sarvari
  2024-11-20 19:34   ` Ninad Palsule
  0 siblings, 1 reply; 3+ messages in thread
From: Gyorgy Sarvari @ 2024-11-20 15:53 UTC (permalink / raw)
  To: yocto, ninad

Try adding "gcc-sanitizers" to the compile time dependencies of your 
application's recipe (DEPENDS variable)




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [yocto] Having issue using gcc-sanitizer
  2024-11-20 15:53 ` [yocto] " Gyorgy Sarvari
@ 2024-11-20 19:34   ` Ninad Palsule
  0 siblings, 0 replies; 3+ messages in thread
From: Ninad Palsule @ 2024-11-20 19:34 UTC (permalink / raw)
  To: Gyorgy Sarvari, yocto

[-- Attachment #1: Type: text/plain, Size: 48 bytes --]

Hi Gyorgy, Thanks a lot! That solved my issue.

[-- Attachment #2: Type: text/html, Size: 59 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-20 19:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-20 14:47 Having issue using gcc-sanitizer Ninad Palsule
2024-11-20 15:53 ` [yocto] " Gyorgy Sarvari
2024-11-20 19:34   ` Ninad Palsule

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox