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

Khem Raj raj.khem at gmail.com
Mon Dec 12 06:37:15 UTC 2016


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

>
> 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