[RTEMS Project] #3103: rtems-tools on CentOS 7 Build Failure
RTEMS trac
trac at rtems.org
Sat Aug 19 17:07:50 UTC 2017
#3103: rtems-tools on CentOS 7 Build Failure
---------------------------+----------------------
Reporter: Joel Sherrill | Owner: chrisj@…
Type: defect | Status: new
Priority: normal | Milestone: 4.12.0
Component: tools | Version: 4.12
Severity: critical | Keywords:
---------------------------+----------------------
A build failure for rtems-tools on the master has been reported on CentOS
7. This is my notes as I try to reproduce it.
[joel at localhost rtems-tools]$ ./waf configure
Setting top to : /home/joel/rtems-work/rtems-
tools
Setting out to : /home/joel/rtems-work/rtems-
tools/build
Version : 4.12.78bbe4c1a31d (4.12)
Checking for program 'python' : /usr/bin/python
Checking for python version >= 2.6.6 : 2.7.5
Checking for 'gcc' (C compiler) : /usr/bin/gcc
Checking for 'g++' (C++ compiler) : /usr/bin/g++
Checking for header alloca.h : yes
Checking for header fcntl.h : yes
Checking for header process.h : not found
Checking for header stdlib.h : yes
Checking for header string.h : yes
Checking for header strings.h : yes
Checking for header sys/file.h : yes
Checking for header sys/stat.h : yes
Checking for header sys/time.h : yes
Checking for header sys/types.h : yes
Checking for header sys/wait.h : yes
Checking for header unistd.h : yes
Checking for header vfork.h : not found
Checking for function getrusage : yes
Checking for program 'm4' : /usr/bin/m4
Checking for header sys/wait.h : yes
Checking for function kill : yes
Checking for 'gcc' (C compiler) : /usr/bin/gcc
Checking for 'g++' (C++ compiler) : /usr/bin/g++
Checking for 'g++' (C++ compiler) : /usr/bin/g++
Checking for function open64 : not found
Checking for function stat64 : not found
'configure' finished successfully (0.786s)
=========================================================
[joel at localhost rtems-tools]$ ./waf -j 1 --verbose
Waf: Entering directory `/home/joel/rtems-work/rtems-tools/build'
[ 88/151] Compiling rtemstoolkit/rld-process.cpp
11:58:16 runner ['/usr/bin/g++', '-pipe', '-g', '-O2', '-Wall', '-Wextra',
'-pedantic', '-Irtemstoolkit', '-I../rtemstoolkit',
'-Irtemstoolkit/elftoolchain/libelf',
'-I../rtemstoolkit/elftoolchain/libelf',
'-Irtemstoolkit/elftoolchain/common',
'-I../rtemstoolkit/elftoolchain/common', '-Irtemstoolkit/libiberty',
'-I../rtemstoolkit/libiberty', '-DHAVE_CONFIG_H=1',
'-DRTEMS_VERSION="4.12"', '-DRTEMS_RELEASE="4.12.78bbe4c1a31d"',
'-DFASTLZ_LEVEL=1', '../rtemstoolkit/rld-process.cpp', '-c', '-o/home/joel
/rtems-work/rtems-tools/build/rtemstoolkit/rld-process.cpp.7.o']
In file included from ../rtemstoolkit/libiberty/libiberty.h:42:0,
from ../rtemstoolkit/rld-process.cpp:64:
../rtemstoolkit/libiberty/ansidecl.h:169:64: error: new declaration ‘char*
basename(const char*)’
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
^
../rtemstoolkit/libiberty/libiberty.h:112:64: note: in expansion of macro
‘ATTRIBUTE_NONNULL’
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL
ATTRIBUTE_NONNULL(1);
^
In file included from ../rtemstoolkit/rld-process.cpp:24:0:
/usr/include/string.h:599:26: error: ambiguates old declaration ‘const
char* basename(const char*)’
extern "C++" const char *basename (const char *__filename)
^
In file included from ../rtemstoolkit/libiberty/libiberty.h:42:0,
from ../rtemstoolkit/rld-process.cpp:64:
../rtemstoolkit/libiberty/ansidecl.h:169:64: error: declaration of ‘int
vasprintf(char**, const char*, __va_list_tag*)’ has a different exception
specifier
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
^
../rtemstoolkit/libiberty/ansidecl.h:198:80: note: in expansion of macro
‘ATTRIBUTE_NONNULL’
#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m,
n))) ATTRIBUTE_NONNULL(m)
^
../rtemstoolkit/libiberty/libiberty.h:651:55: note: in expansion of macro
‘ATTRIBUTE_PRINTF’
extern int vasprintf (char **, const char *, va_list)
ATTRIBUTE_PRINTF(2,0);
^
In file included from ../rtemstoolkit/rld-process.cpp:23:0:
/usr/include/stdio.h:399:12: error: from previous declaration ‘int
vasprintf(char**, const char*, __va_list_tag*) throw ()’
extern int vasprintf (char **__restrict __ptr, const char *__restrict
__f,
^
Waf: Leaving directory `/home/joel/rtems-work/rtems-tools/build'
Build failed
-> task in 'rld' failed with exit status 1:
{task 23048432: cxx rld-process.cpp -> rld-process.cpp.7.o}
['/usr/bin/g++', '-pipe', '-g', '-O2', '-Wall', '-Wextra', '-pedantic',
'-Irtemstoolkit', '-I../rtemstoolkit',
'-Irtemstoolkit/elftoolchain/libelf',
'-I../rtemstoolkit/elftoolchain/libelf',
'-Irtemstoolkit/elftoolchain/common',
'-I../rtemstoolkit/elftoolchain/common', '-Irtemstoolkit/libiberty',
'-I../rtemstoolkit/libiberty', '-DHAVE_CONFIG_H=1',
'-DRTEMS_VERSION="4.12"', '-DRTEMS_RELEASE="4.12.78bbe4c1a31d"',
'-DFASTLZ_LEVEL=1', '../rtemstoolkit/rld-process.cpp', '-c', '-o/home/joel
/rtems-work/rtems-tools/build/rtemstoolkit/rld-process.cpp.7.o']
==================================================================
Looking down into libiberty.h, I picked on basename()
/* HAVE_DECL_* is a three-state macro: undefined, 0 or 1. If it is
undefined, we haven't run the autoconf check so provide the
declaration without arguments. If it is 0, we checked and failed
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
#if !HAVE_DECL_BASENAME
#if defined (__GNU_LIBRARY__ ) || defined (__linux__) \
|| defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__)
\
|| defined (__CYGWIN__) || defined (__CYGWIN32__) || defined
(__MINGW32__) \
|| defined (__DragonFly__) || defined (HAVE_DECL_BASENAME)
extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL
ATTRIBUTE_NONNULL(1);
#else
/* Do not allow basename to be used if there is no prototype seen. We
either need to use the above prototype or have one from
autoconf which would result in HAVE_DECL_BASENAME being set. */
#define basename basename_cannot_be_used_without_a_prototype
#endif
#endif
============================================
The native CentOS 7 has this definition of basename:
# ifndef basename
/* Return the file name within directory of FILENAME. We don't
declare the function if the `basename' macro is available (defined
in <libgen.h>) which makes the XPG version of this function
available. */
# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
extern "C++" char *basename (char *__filename)
__THROW __asm ("basename") __nonnull ((1));
extern "C++" const char *basename (const char *__filename)
__THROW __asm ("basename") __nonnull ((1));
# else
extern char *basename (const char *__filename) __THROW __nonnull ((1));
# endif
# endif
#endif
==============================
I think we are getting the C++ prototype from string.h and a conflicting C
prototype from libiberty.h
--
Ticket URL: <http://devel.rtems.org/ticket/3103>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list