Taking inspiration from
https://github.com/FreddieChopin/bleeding-edge-toolchain, I have a
script which runs:
../../source/${dname}/configure \
--target=${TARGET} \
--enable-languages=c \
--without-headers \
--prefix=`realpath ../../${DIR_PREFIX}` \
--libexecdir=`realpath ../../${DIR_PREFIX}/lib`
--disable-decimal-float \
--disable-libffi \
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-nls \
--disable-shared \
--disable-threads \
--disable-tls \
--with-newlib \
--with-gnu-as \
--with-gnu-ld \
--with-sysroot=`realpath ../../${DIR_PREFIX}/${TARGET}` \
--with-system-zlib \
--with-gmp=`realpath ../../${DIR_PREFIX}/host/${gmp_dname}` \
--with-mpfr=`realpath ../../${DIR_PREFIX}/host/${mpfr_dname}` \
--with-mpc=`realpath ../../${DIR_PREFIX}/host/${mpc_dname}` \
--with-isl=`realpath ../../${DIR_PREFIX}/host/${isl_dname}` \
--with-pkgversion=${VERSION}
(libssp is disabled as it is provided by newlib.) When compiling GCC,
an attempt to build libssp is made, and this fails with the following:
../../../../source/gcc-7.3.0/libssp/ssp.c: In function ‘__guard_setup’:
../../../../source/gcc-7.3.0/libssp/ssp.c:93:12: warning: implicit
declaration of function ‘open’ [-Wimplicit-function-declaration]
int fd = open ("/dev/urandom", O_RDONLY);
^~~~
../../../../source/gcc-7.3.0/libssp/ssp.c:93:34: error: ‘O_RDONLY’
undeclared (first use in this function)
int fd = open ("/dev/urandom", O_RDONLY);
^~~~
../../../../source/gcc-7.3.0/libssp/ssp.c:93:34: note: each undeclared
identifier is reported only once for each function it appears in
../../../../source/gcc-7.3.0/libssp/ssp.c:96:7: error: unknown type
name ‘ssize_t’
ssize_t size = read (fd, &__stack_chk_guard,
^~~
../../../../source/gcc-7.3.0/libssp/ssp.c:96:22: warning: implicit
declaration of function ‘read’ [-Wimplicit-function-declaration]
ssize_t size = read (fd, &__stack_chk_guard,
^~~~
../../../../source/gcc-7.3.0/libssp/ssp.c:98:7: warning: implicit
declaration of function ‘close’ [-Wimplicit-function-declaration]
close (fd);
^
../../../../source/gcc-7.3.0/libssp/ssp.c: At top level:
../../../../source/gcc-7.3.0/libssp/ssp.c:113:25: error: unknown type
name ‘size_t’
fail (const char *msg1, size_t msg1len, const char *msg3)
^~
../../../../source/gcc-7.3.0/libssp/ssp.c: In function ‘__stack_chk_fail’:
../../../../source/gcc-7.3.0/libssp/ssp.c:185:3: warning: implicit
declaration of function ‘fail’ [-Wimplicit-function-declaration]
fail (msg, strlen (msg), "stack smashing detected: terminated");
^~~~
../../../../source/gcc-7.3.0/libssp/ssp.c:185:14: warning: implicit
declaration of function ‘strlen’ [-Wimplicit-function-declaration]
fail (msg, strlen (msg), "stack smashing detected: terminated");
^~
../../../../source/gcc-7.3.0/libssp/ssp.c:185:14: warning:
incompatible implicit declaration of built-in function ‘strlen’
../../../../source/gcc-7.3.0/libssp/ssp.c:185:14: note: include
‘’ or provide a declaration of ‘strlen’
../../../../source/gcc-7.3.0/libssp/ssp.c: In function ‘__chk_fail’:
../../../../source/gcc-7.3.0/libssp/ssp.c:192:14: warning:
incompatible implicit declaration of built-in function ‘strlen’
fail (msg, strlen (msg), "buffer overflow detected: terminated");
^~
../../../../source/gcc-7.3.0/libssp/ssp.c:192:14: note: include
‘’ or provide a declaration of ‘strlen’
make[2]: *** [Makefile:487: ssp.lo] Error 1
I've attempted to search for a solution, but they were all more or
less "disable libssp."
Thanks in advance,
R0b0t1