https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127914

--- Comment #10 from Steve Kargl <kargl at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #9)
> Created attachment 65863 [details]
> Make libstdc++ configure check for memrchr
> 
> Does this fix it?
> 
> If it fails the same way for another function, we can check for that too,
> but this might be enough.

The patch applied cleanly.  Currently, bootstrapping with FreeBSD
toolchain, which appears to be llvm 21.1.8.  From the gcc/ directory
I see

%  find ../obj -name config.log | xargs grep memrchr
../obj/gcc/config.log:configure:10522: checking for memrchr
../obj/gcc/config.log:ac_cv_func_memrchr=yes
../obj/libiberty/config.log:configure:7096: checking for memrchr
../obj/libiberty/config.log:ac_cv_func_memrchr=yes
../obj/build-x86_64-unknown-freebsd16.0/libiberty/config.log:configure:7096:
checking for memrchr
../obj/build-x86_64-unknown-freebsd16.0/libiberty/config.log:ac_cv_func_memrchr=yes

Hmmm, just died with

/home/kargl/work/x/x86_64-unknown-freebsd16.0/sys-include -fno-checking
-DHAVE_CONFIG_H -I. -I../../gcc/lto-plugin -I../../gcc/lto-plugin/../include
-DHAVE_CONFIG_H -Wall -DBASE_VERSION=\"17.0.0\" -g -O2 -fno-checking -gtoggle
-c ../../gcc/lto-plugin/lto-plugin.c  -fPIC -DPIC -o .libs/lto-plugin.o
In file included from /usr/include/stdint.h:32,
                 from /home/kargl/gcc/obj/prev-gcc/include/stdint.h:11,
                 from ../../gcc/lto-plugin/lto-plugin.c:45:
../../gcc/lto-plugin/../include/libiberty.h:226:14: error: expected identifier
or '(' before '_Generic'
  226 | extern void *memrchr(const void *, int, size_t);
      |              ^~~~~~~


% grep MEMR libiberty/config.h
#define HAVE_MEMRCHR 1

So, configure in libiberty defines MEMRCHR.  Do we need to update the 
configury in lto-plugin?

Reply via email to