[OE-core] [PATCH] glibc: add -fno-builtin-strlen when not using -O2

Huang, Jie (Jackie) Jackie.Huang at windriver.com
Mon Dec 12 07:41:12 UTC 2016



> -----Original Message-----
> From: Khem Raj [mailto:raj.khem at gmail.com]
> Sent: Monday, December 12, 2016 2:37 PM
> To: Huang, Jie (Jackie)
> Cc: Patches and discussions about the oe-core layer
> Subject: Re: [OE-core] [PATCH] glibc: add -fno-builtin-strlen when not using -O2
> 
> On Sun, Dec 11, 2016 at 9:42 PM,  <jackie.huang at windriver.com> wrote:
> > From: Jackie Huang <jackie.huang at windriver.com>
> >
> > The strlen will be inlined when compile with -O, -O1 or -Os,
> > so there is no symbol for strlen in ld-linux-x86-64.so.2,
> > causing a fatal error in valgrind:
> >
> > valgrind: Fatal error at startup: a function redirection
> > valgrind: which is mandatory for this platform-tool combination
> > valgrind: cannot be set up. Details of the redirection are:
> > valgrind:
> > valgrind: A must-be-redirected function
> > valgrind: whose name matches the pattern: strlen
> > valgrind: in an object with soname matching: ld-linux-x86-64.so.2
> >
> > so add -fno-builtin-strlen when compile with -O, -O1 or -Os.
> 
> This is a bug in valgrind, I read the same on forums. KDE has proposed a fix
> https://bugsfiles.kde.org/attachment.cgi?id=82043
> can you check if this fixes the issue

Thanks, I will check that and change to patch for valgrind if it works.

Thanks,
Jackie

> 
> >
> > Signed-off-by: Jackie Huang <jackie.huang at windriver.com>
> > ---
> >  meta/recipes-core/glibc/glibc.inc | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> > index e85c704..7f3e0f6 100644
> > --- a/meta/recipes-core/glibc/glibc.inc
> > +++ b/meta/recipes-core/glibc/glibc.inc
> > @@ -16,8 +16,8 @@ python () {
> >      if opt_effective == "-O0":
> >          bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN', True), opt_effective))
> >      if opt_effective in ("-O", "-O1", "-Os"):
> > -        bb.note("%s doesn't build cleanly with %s, adding -Wno-error to SELECTED_OPTIMIZATION" %
> (d.getVar('PN', True), opt_effective))
> > -        d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")
> > +        bb.note("%s doesn't build cleanly with %s, adding -Wno-error and -fno-builtin-strlen to
> SELECTED_OPTIMIZATION" % (d.getVar('PN', True), opt_effective))
> > +        d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error -fno-builtin-strlen")
> >  }
> >
> >  # siteconfig.bbclass runs configure which needs a working compiler
> > --
> > 2.8.3
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core


More information about the Openembedded-core mailing list