Kai Ruottu - Re: should _GNU_SOURCE be used in libiberty if glibc is present? (original) (raw)

This is the mail archive of the gcc@gcc.gnu.orgmailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Rafael Ávila de Espíndola wrote:

I noticed that in the config.h generated for libiberty has HAVE_DECL_ASPRINTF defined as 0. This hapens because _GNU_SOURCE is not used when running the test programs.

Another long-staying bug in the libiberty configure system is that it claims newlib missing 'asprintf()', 'strdup()' and 'vasprintf()' and therefore tries to produce these although one has used the '--with-newlib' in the GCC configure ! AFAIK, only those functions which are missing from the C library, should be built into libiberty. The result from this has been the GCC build crashing with the clashing newlib headers prototypes and the function reimplementations in libiberty. Sometimes I even made diffs for the fixes in 'configure.ac':

*** configure.ac.orig 2004-01-10 04:17:41.000000000 +0200 --- configure.ac 2005-05-02 18:36:18.000000000 +0300


*** 265,280 **** # newlib provide and which ones we will be expected to provide.

if test "x${with_newlib}" = "xyes"; then

for f in $funcs; do
case "$f" in
! asprintf | basename | insque | random | strdup | vasprintf)
;;
*)
n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
--- 265,277 ----
# newlib provide and which ones we will be expected to provide.

if test "x${with_newlib}" = "xyes"; then
  AC_LIBOBJ([basename])
  AC_LIBOBJ([insque])
  AC_LIBOBJ([random])

for f in $funcs; do
case "$f" in
! basename | insque | random)
;;
*)
n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]