Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 691488 - sys-libs/glibc-2.30[custom-cflags] CFLAGS=-flto fails with error: support for the symbol redirection needed
Summary: sys-libs/glibc-2.30[custom-cflags] CFLAGS=-flto fails with error: support for...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-05 12:28 UTC by Mike Lothian
Modified: 2019-08-22 07:22 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,10.29 KB, text/plain)
2019-08-05 12:28 UTC, Mike Lothian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lothian 2019-08-05 12:28:27 UTC
Created attachment 585760 [details]
build.log

This is the test in question:

AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl
cat > conftest.c <<\EOF
extern char *strstr (const char *, const char *) __asm ("my_strstr");
char *foo (const char *a, const char *b)
{
  return __builtin_strstr (a, b);
}
EOF
dnl
if AC_TRY_COMMAND([${CC-cc} -O3 -S conftest.c -o - | grep -F "my_strstr" > /dev/null]);
then
  libc_cv_gcc_builtin_redirection=yes
else
  libc_cv_gcc_builtin_redirection=no
fi
rm -f conftest* ])
if test "$libc_cv_gcc_builtin_redirection" = no; then
  AC_MSG_ERROR([support for the symbol redirection needed])
fi
Comment 1 Mike Lothian 2019-08-05 12:30:03 UTC
Looks like it's LTO related

x86_64-pc-linux-gnu-gcc -m32 -O3 -march=native -pipe -O3 -march=native -pipe -Wl,-O2 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--build-id=sha1 -fuse-ld=bfd -O3 -S conftest.c -o - | grep -F my_strstr
        call    my_strstr@PLT

I think the issue is we're passing all the CFLAGS into CC and the configure check isn't expecting that
Comment 2 Mike Lothian 2019-08-05 12:44:17 UTC
D'oh 

This is probably related to the new custom-cflags USE-flag
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-08-06 07:00:07 UTC
(In reply to Mike Lothian from comment #1)
> Looks like it's LTO related
> 
> x86_64-pc-linux-gnu-gcc -m32 -O3 -march=native -pipe -O3 -march=native -pipe
> -Wl,-O2 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,--build-id=sha1
> -fuse-ld=bfd -O3 -S conftest.c -o - | grep -F my_strstr
>         call    my_strstr@PLT

I think that is expected output. Can you attach failed config.log as well?
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2019-08-22 07:22:39 UTC
Let's declare it as works-as-intended for USE=custom-cflags. CFLAGS=-flto is too fragile for today's glibc ./configure.

Feel free to file upstream bug report if you think it should work.