This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


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

an experiment



I suspect that a small change to libc-symbols.h combined with a larger
change to gcc's stddef.h may result in a 5-10min speedup of the build
(comparable to the total improvement from egcs 1.1's better handling of
iconvdata).  I can't prove it one way or the other because build times on my
machine vary by +-10min all by themselves.

So I'd like several people to try this experiment, ideally on machines that
don't need to hit swap while compiling libc:

- Time a full build of libc on an otherwise completely idle machine.

- Apply the appended patch to libc-symbols.h.  Replace
$PREFIX/lib/gcc-lib/.../include/stddef.h with the appended file.  (I think
the replacement won't break anything, but keep the old one just in case.)

- Time another full build.

- Report differences if any.

Thanks.
zw

============================================================
Index: include/libc-symbols.h
--- include/libc-symbols.h	1998/05/29 10:14:04	1.6
+++ include/libc-symbols.h	1998/10/07 15:31:30
@@ -58,6 +58,10 @@
 
 #ifndef	__ASSEMBLER__
 
+/* Speed hack.  stddef.h is included by various other headers but
+   never allowed to trigger the multiple inclusion optimization in cpp. */
+#include <stddef.h>
+
 /* Define the macros `_' and `N_' for conveniently marking translatable
    strings in the libc source code.  */
 
-- stddef.h --
/* ISO C 9x section 7.1.6: COMMON DEFINITIONS */

#ifndef _STDDEF_H

# if (defined(__need_size_t) || defined(__need_wchar_t)		\
      || defined(__need_ptrdiff_t) || defined(__need_NULL)	\
      || defined(__need_wint_t))
/* Just do one thing. */
#  define __Need
# endif

/* SunOS 4 needs this. */
# ifdef __sys_stdtypes_h
#  define __size_t_defined
#  define __ptrdiff_t_defined
#  define __wchar_t_defined
# endif

/* On Net2 derivatives, make sure machine/ansi.h is included. */
#if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) || defined(__NetBSD__)
#include <machine/ansi.h>
#endif

/* Now check if some of the work has already been done. */
#if defined _ANSI_H_ || defined _MACHINE_ANSI_H_
# if !defined _SIZE_T_ && !defined _BSD_SIZE_T_
#  define __size_t_defined
# endif
# if !defined _PTRDIFF_T_ && !defined _BSD_PTRDIFF_T_
#  define __ptrdiff_t_defined
# endif
# if !defined _WCHAR_T_ && !defined _BSD_WCHAR_T_
#  define __wchar_t_defined
# endif
#endif /* ansi.h */

#if defined _SIZE_T || defined _SYS_SIZE_T_H || defined _T_SIZE_ || \
    defined _T_SIZE || defined __SIZE_T || defined _SIZE_T_DEFINED_ || \
    defined _SIZE_T_DEFINED || defined ___int_size_t_h || \
    defined __INT_SIZE_T_H || defined _GCC_SIZE_T || \
    defined _SIZET_ || defined __size_t
# define __size_t_defined
#endif

#if defined _PTRDIFF_T || defined _SYS_PTRDIFF_T_H || defined _T_PTRDIFF_ || \
    defined _T_PTRDIFF || defined __PTRDIFF_T || defined _PTRDIFF_T_DEFINED_ || \
    defined _PTRDIFF_T_DEFINED || defined ___int_ptrdiff_t_h || \
    defined __INT_PTRDIFF_T_H || defined _GCC_PTRDIFF_T || \
    defined _PTRDIFFT_ || defined __ptrdiff_t
# define __ptrdiff_t_defined
#endif

#if defined _WCHAR_T || defined _SYS_WCHAR_T_H || defined _T_WCHAR_ || \
    defined _T_WCHAR || defined __WCHAR_T || defined _WCHAR_T_DEFINED_ || \
    defined _WCHAR_T_DEFINED || defined ___int_wchar_t_h || \
    defined __INT_WCHAR_T_H || defined _GCC_WCHAR_T || \
    defined _WCHART_ || defined __wchar_t
# define __wchar_t_defined
#endif


# if !defined __size_t_defined && (!defined __Need || defined __need_size_t)
#  define __size_t_defined

#  ifdef _TYPE_size_t
_TYPE_size_t;
#   undef _TYPE_size_t
#  else
#   ifndef __SIZE_TYPE__
#    define __SIZE_TYPE__ long unsigned int
#   endif
typedef __SIZE_TYPE__ size_t;
#  endif

#  undef _SIZE_T_
#  undef _BSD_SIZE_T_
#  define _SIZE_T
#  define _SYS_SIZE_T_H
#  define _T_SIZE_
#  define _T_SIZE
#  define __SIZE_T
#  define _SIZE_T_DEFINED_
#  define _SIZE_T_DEFINED
#  define ___int_size_t_h
#  define __INT_SIZE_T_H
#  define _GCC_SIZE_T
#  define _SIZET_
#  define __size_t
# endif  /* size_t */
# undef __need_size_t

# if !defined __wchar_t_defined && (!defined __Need || defined __need_wchar_t)
#  define __wchar_t_defined

#  ifdef _TYPE_wchar_t
_TYPE_wchar_t;
#  else
#   ifndef __WCHAR_TYPE__
#    define __WCHAR_TYPE__ int
#   endif
#   ifndef __cplusplus  /* C++ doesn't want wchar_t in stddef.h ? */
typedef __WCHAR_TYPE__ wchar_t;
#   endif
#  endif

/* Some BSDs assume that rune_t is defined iff wchar_t is. */
#  ifdef _BSD_RUNE_T_
#   if !defined _ANSI_SOURCE && !defined _POSIX_SOURCE
typedef _BSD_RUNE_T_ rune_t;
#   endif
#  endif

#  undef _WCHAR_T_
#  undef _BSD_WCHAR_T_
#  define _WCHAR_T
#  define _SYS_WCHAR_T_H
#  define _T_WCHAR_
#  define _T_WCHAR
#  define __WCHAR_T
#  define _WCHAR_T_DEFINED_
#  define _WCHAR_T_DEFINED
#  define _WCHAR_T_H
#  define ___int_wchar_t_h
#  define __INT_WCHAR_T_H
#  define _GCC_WCHAR_T
#  define _WCHART_
#  define __wchar_t
# endif /* wchar_t */
# undef __need_wchar_t

# if !defined __ptrdiff_t_defined && (!defined __Need || defined __need_ptrdiff_t)
#  define __ptrdiff_t_defined

#  ifdef _TYPE_ptrdiff_t
_TYPE_ptrdiff_t;
#  else
#   ifndef __PTRDIFF_TYPE__
#    define __PTRDIFF_TYPE__ long int
#   endif
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#  endif

#  undef _PTRDIFF_T_
#  undef _BSD_PTRDIFF_T_
#  define _PTRDIFF_T
#  define _SYS_PTRDIFF_T_H
#  define _T_PTRDIFF_
#  define _T_PTRDIFF
#  define __PTRDIFF_T
#  define _PTRDIFF_T_DEFINED_
#  define _PTRDIFF_T_DEFINED
#  define ___int_ptrdiff_t_h
#  define __INT_PTRDIFF_T_H
#  define _GCC_PTRDIFF_T
#  define _PTRDIFFT_
#  define __ptrdiff_t

# endif /* ptrdiff_t */
# undef __need_ptrdiff_t

# if !defined __NULL_defined && (!defined __Need || defined __need_NULL)
#  define __NULL_defined

#  undef NULL /* In case someone else defined it. */
#  ifdef __GNUG__
#   define NULL __null
#  else
#   define NULL ((void *)0)
#  endif /* G++ */
# endif /* NULL */
# undef __need_NULL

/* XXX C9x says stddef.h does not define wint_t. */
# if !defined __wint_t_defined && (!defined __Need || defined __need_wint_t)
#  define __wint_t_defined
#  define _WINT_T

#ifndef __WINT_TYPE__
#define __WINT_TYPE__ unsigned int
#endif
typedef __WINT_TYPE__ wint_t;

# endif /* wint_t */
# undef __need_wint_t

# ifdef __Need
#  undef __Need
# else  /* No special needs. */
#  define _STDDEF_H

/* snaroff@next.com says the NeXT needs this.  */
#  define _ANSI_STDDEF_H
/* Irix 5.1 needs this.  */
#  define __STDDEF_H__

#  define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

# endif  /* No special needs */

#endif /* !_STDDEF_H */


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