public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Error In libssp, But Disabled in Configuration
@ 2018-02-18  7:42 R0b0t1
  2018-02-19  9:22 ` R0b0t1
  0 siblings, 1 reply; 2+ messages in thread
From: R0b0t1 @ 2018-02-18  7:42 UTC (permalink / raw)
  To: GCC Development

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
‘<string.h>’ 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
‘<string.h>’ 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Error In libssp, But Disabled in Configuration
  2018-02-18  7:42 Error In libssp, But Disabled in Configuration R0b0t1
@ 2018-02-19  9:22 ` R0b0t1
  0 siblings, 0 replies; 2+ messages in thread
From: R0b0t1 @ 2018-02-19  9:22 UTC (permalink / raw)
  To: GCC Development

On Sun, Feb 18, 2018 at 1:42 AM, R0b0t1 <r030t1@gmail.com> wrote:
> 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
> ‘<string.h>’ 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
> ‘<string.h>’ 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."
>

All I've found is this has some interaction with the selection of
target (arm-none-eabi), but I don't know why or how to fix it.

> Thanks in advance,
>      R0b0t1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-19  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-18  7:42 Error In libssp, But Disabled in Configuration R0b0t1
2018-02-19  9:22 ` R0b0t1

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).