Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GCC 7.3.0 Build Fails to Build libssp (Outside of Portage)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 249

PostPosted: Mon Feb 19, 2018 1:33 am    Post subject: GCC 7.3.0 Build Fails to Build libssp (Outside of Portage) Reply with quote

This is part of an attempt to generate an arm-none-eabi toolchain, and then integrate those changes back into crossdev (TARGET=arm-none-eabi):
Code:
   ../../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}

   make -j${NCPU} -l${NCPU}
   make install


This occurs, also for 7.2.0, with or without the Gentoo-provided patches applied:
Code:
../../../../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


Notably libssp is disabled. Searching for this issue that seems to be the proposed solution (GCC 6.x era). Changing the configure script calls to avoid a custom directory should work, the only thing generated before this that had the TARGET set was binutils:

Code:
   ../../source/${dname}/configure \
      --target=${TARGET} \
      --prefix=`realpath ../../${DIR_PREFIX}` \
      --docdir=`realpath ../../${DIR_PREFIX}/share/doc` \
      --disable-nls \
      --enable-interwork \
      --enable-multilib \
      --enable-plugins \
      --with-system-zlib \
      --with-pkgversion=${VERSION}
   
   make -j${NCPU} -l${NCPU}
   make install
Back to top
View user's profile Send private message
R0b0t1
Apprentice
Apprentice


Joined: 05 Jun 2008
Posts: 249

PostPosted: Tue Feb 20, 2018 10:00 pm    Post subject: Reply with quote

I needed to add:
Code:

      --with-multilib-list=rmprofile
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum