This is the mail archive of the gcc-help@gcc.gnu.org mailing 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]

Gcc 4.2.2 build failure (fixincludes breaks limits.h)


I'm in the process of upgrading the Syllable port of Gcc 4.1.2 to 4.2.2
but have run into a build failure. The stage2 configure tests for mmap()
always pass, although mmap() is not available on Syllable. This produces
a stage2 xgcc which fails during the stage3 build with:

"virtual memory exhausted: Function not implemented"

I've tracked this down to a problem where fixincludes has produced a
local limits.h file. This is the file which the configure tests include
before checking for the __stub_mmap macro.

In the normal case the Glibc limits.h includes features.h, which
includes stubs.h which then defines these stub macros, but the limits.h
which is produced by fixincludes does not include features.h, so the
macro is never defined and the simple conftest incorrectly passes.

This is obviously also a problem for all of the other functions which
are tested for in the same manner, although mmap() is the one I'm
specifically having trouble with.

I've pulled the test out of the configure script to test this
(attached), and built it with

/boot/home/root/Build/gcc/_gcc-4.2.2/./prev-gcc/xgcc
-B/boot/home/root/Build/gcc/_gcc-4.2.2/./prev-gcc/
-B/usr/gcc/i586-pc-syllable/bin/ -o conftest -O2 -g -fomit-frame-pointer
-v  conftest.c

Is there any way I can stop fixincludes from mangling limits.h, or at
least ensuring it always keeps the include for features.h?

-- 
Vanders
http://www.syllable.org
#define mmap innocuous_mmap

/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char mmap (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

#undef mmap

/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
   builtin and then its argument prototype would still apply.  */
char mmap ();
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_mmap) || defined (__stub___mmap)
choke me
#else
char (*f) () = mmap;
#endif
#ifdef __cplusplus
}
#endif

int
main ()
{
return f != mmap;
  ;
  return 0;
}

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