https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127914
Bug ID: 127914
Summary: Bootstrap on FreeBSD dies with libiberty issue
Product: gcc
Version: 14.4.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: bootstrap
Assignee: unassigned at gcc dot gnu.org
Reporter: kargl at gcc dot gnu.org
Target Milestone: ---
I have tried bootstrapping master with both FreeBSD default compiler
infrastructure, which llvm 21, and with GCC 16.1.0 installed from the
FreeBSD ports collection. Both attempts die in libiberty with the
following type of error:
libtool: compile: /home/kargl/gcc/obj/./gcc/xgcc -B/home/kargl/gcc/obj/./gcc/
-B/home/kargl/work/x/x86_64-unknown-freebsd16.0/bin/
-B/home/kargl/work/x/x86_64-unknown-freebsd16.0/lib/ -isystem
/home/kargl/work/x/x86_64-unknown-freebsd16.0/include -isystem
/home/kargl/work/x/x86_64-unknown-freebsd16.0/sys-include -fno-checking
-DHAVE_CONFIG_H -I.. -I/home/kargl/gcc/gcc/libstdc++-v3/../libiberty
-I/home/kargl/gcc/gcc/libstdc++-v3/../include -D_GLIBCXX_SHARED
-I/home/kargl/gcc/obj/x86_64-unknown-freebsd16.0/libstdc++-v3/include/x86_64-unknown-freebsd16.0
-I/home/kargl/gcc/obj/x86_64-unknown-freebsd16.0/libstdc++-v3/include
-I/home/kargl/gcc/gcc/libstdc++-v3/libsupc++ -O -g -DIN_GLIBCPP_V3 -Wno-error
-c cp-demangle.c -fPIC -DPIC -o cp-demangle.o
In file included from /usr/include/stdio.h:38,
from cp-demangle.c:109:
/home/kargl/gcc/gcc/libstdc++-v3/../include/libiberty.h:226:14: error: expected
identifier or '(' before '_Generic'
226 | extern void *memrchr(const void *, int, size_t);
| ^~~~~~~
FreeBSD manpage shows a memrchr comes from strings.h with a prototype of the
form
QVoid *memrchr(QVoid *b, int c, size_t len);