I receive the following when trying to build gcc using --disable-checking. 

gcc (GCC) 4.2.0 20060421 (experimental)

gcc -DIN_GCC   -O2 -g0 -DGENERATOR_FILE -s -o build/genextract \
    build/genextract.o build/rtl.o build/read-rtl.o build/ggc-none.o
build/min-insn-modes.o build/gensupport.o build/pri
nt-rtl.o build/errors.o build/vec.o
../build-i686-pc-linux-gnu/libiberty/libiberty.a
build/genextract.o(.text+0x370): In function `gen_insn':
: undefined reference to `vec_assert_fail'
build/genextract.o(.text+0x46b): In function `VEC_safe_set_locstr':
: undefined reference to `vec_assert_fail'
build/genextract.o(.text+0x6e3): In function `walk_rtx':
: undefined reference to `vec_assert_fail'
collect2: ld returned 1 exit status
make[2]: *** [build/genextract] Error 1





After quickly looking into it, here is my initial theory:

1. 
build=i686-pc-linux-gnu
host=i686-pc-mingw32
target=i686-pc-mingw32

2. 
configure with --disable-checking

3.
from gcc/configure:

# auto-host.h is the file containing items generated by autoconf and is
# the first file included by config.h.
# If host=build, it is correct to have bconfig include auto-host.h
# as well.  If host!=build, we are in error and need to do more
# work to find out the build config parameters.
if test x$host = x$build
then
  build_auto=auto-host.h
else
  # We create a subdir, then run autoconf in the subdir.
  # To prevent recursion we set host and build for the new
  # invocation of configure to the build for this invocation
  # of configure.
  tempdir=build.$$
  rm -rf $tempdir
  mkdir $tempdir
  cd $tempdir
  case ${srcdir} in
  /* | A-Za-z:\\/* ) realsrcdir=${srcdir};;
  *) realsrcdir=../${srcdir};;
  esac
  saved_CFLAGS="${CFLAGS}"
  CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
  ${realsrcdir}/configure \
    --enable-languages=${enable_languages-all} \
    --target=$target_alias --host=$build_alias --build=$build_alias
  CFLAGS="${saved_CFLAGS}"

  # We just finished tests for the build machine, so rename
  # the file auto-build.h in the gcc directory.
  mv auto-host.h ../auto-build.h
  cd ..
  rm -rf $tempdir
  build_auto=auto-build.h
fi 

4. 
This creates an auto-build.h with enable_checking 1

#ifndef USED_FOR_TARGET
#define ENABLE_CHECKING 1 
#endif

5.  
bconfig.h includes it

#ifndef GCC_BCONFIG_H
#define GCC_BCONFIG_H
#include "auto-build.h"
#ifdef IN_GCC
# include "ansidecl.h"
#endif
#endif /* GCC_BCONFIG_H */

6. 
gcc/genextract.c is compiled with checking since it includes "bconfig.h"
it also includes "vec.h", and consequently vec_assert_fail

gcc -c -DIN_GCC   -O2 -g0 -DGENERATOR_FILE -I. -Ibuild -I/home/gcc/gcc/gcc
-I/home/gcc/gcc/gcc/build -I/home/gcc/gcc/gcc/../include
-I/home/gcc/gcc/gcc/../libcpp/include  -I/home/gcc/gcc/gcc/../libdecnumber
-I../libdecnumber    -o build/genextract.o /home/gcc/gcc/gcc/genextract.c

7. 
gcc/vec.c is compiled without checking, so it will not define vec_assert_fail:

gcc -c -DIN_GCC   -O2 -g0 -DGENERATOR_FILE -I. -Ibuild -I/home/gcc/gcc/gcc
-I/home/gcc/gcc/gcc/build -I/home/gcc/gcc/gcc/../include
-I/home/gcc/gcc/gcc/../libcpp/include  -I/home/gcc/gcc/gcc/../libdecnumber
-I../libdecnumber    -o build/vec.o /home/gcc/gcc/gcc/vec.c

8. 
vec_assert_fail isn't defined. 

gcc -DIN_GCC   -O2 -g0 -DGENERATOR_FILE -s -o build/genextract \
    build/genextract.o build/rtl.o build/read-rtl.o build/ggc-none.o
build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/errors.o
build/vec.o ../build-i686-pc-linux-gnu/libiberty/libiberty.a
build/genextract.o(.text+0x370): In function `gen_insn':
: undefined reference to `vec_assert_fail'
build/genextract.o(.text+0x46b): In function `VEC_safe_set_locstr':
: undefined reference to `vec_assert_fail'
build/genextract.o(.text+0x6e3): In function `walk_rtx':
: undefined reference to `vec_assert_fail'
collect2: ld returned 1 exit status
make[2]: *** [build/genextract] Error 1


-- 
           Summary: undefined reference to `vec_assert_fail' with --disable-
                    checking
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: r_ovidius at eml dot cc
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27251

Reply via email to