patches/glibc/2.9/190-queue-header-updates.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
changeset 2461 ec30b191f0e3
parent 1201 c9967a6e3b25
permissions -rw-r--r--
complibs/ppl: build only C and C++ interfaces for PPL

By default, PPL wants to build interfaces for any of a variety of
langauges it finds on the local host (python, java, possibly perl, also
more esoteric languages such as ocaml and prolog).

These extra interfaces can double the compile time for the library. For
single-process builds, I found a savings of more than 40%:

default / j1: 716s total, 143.2s avg, 0.52s stdev
just_c / j1: 406s total, 81.2s avg, 0.33s stdev
just_c_cpp / j1: 413s total, 82.6s avg, 0.22s stdev

And for multi-process builds, it approached 50%:

default / j4: 625s total, 125.0s avg, 0.57s stdev
just_c / j4: 338s total, 67.6s avg, 1.25s stdev
just_c_cpp / j4: 327s total, 65.4s avg, 0.36s stdev

Since the PPL we build within ct-ng is only used by GCC, we only need to
build the C and C++ interfaces.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
     1 Original patch from: gentoo/src/patchsets/glibc/2.9/1010_all_glibc-queue-header-updates.patch
     2 
     3 -= BEGIN original header =-
     4 grab some updates from FreeBSD
     5 
     6 http://bugs.gentoo.org/201979
     7 
     8 -= END original header =-
     9 
    10 diff -durN glibc-2_9.orig/misc/sys/queue.h glibc-2_9/misc/sys/queue.h
    11 --- glibc-2_9.orig/misc/sys/queue.h	2008-03-05 06:50:30.000000000 +0100
    12 +++ glibc-2_9/misc/sys/queue.h	2009-02-02 22:00:48.000000000 +0100
    13 @@ -136,6 +136,11 @@
    14  		(var);							\
    15  		(var) = ((var)->field.le_next))
    16  
    17 +#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
    18 +	for ((var) = LIST_FIRST((head));				\
    19 +	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
    20 +	    (var) = (tvar))
    21 +
    22  /*
    23   * List access methods.
    24   */
    25 @@ -197,6 +202,16 @@
    26  #define	SLIST_FOREACH(var, head, field)					\
    27  	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
    28  
    29 +#define	SLIST_FOREACH_SAFE(var, head, field, tvar)			\
    30 +	for ((var) = SLIST_FIRST((head));				\
    31 +	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
    32 +	    (var) = (tvar))
    33 +
    34 +#define	SLIST_FOREACH_PREVPTR(var, varp, head, field)			\
    35 +	for ((varp) = &SLIST_FIRST((head));				\
    36 +	    ((var) = *(varp)) != NULL;					\
    37 +	    (varp) = &SLIST_NEXT((var), field))
    38 +
    39  /*
    40   * Singly-linked List access methods.
    41   */
    42 @@ -242,6 +257,12 @@
    43  	(head)->stqh_last = &(elm)->field.stqe_next;			\
    44  } while (/*CONSTCOND*/0)
    45  
    46 +#define	STAILQ_LAST(head, type, field)					\
    47 +	(STAILQ_EMPTY((head)) ?						\
    48 +		NULL :							\
    49 +	        ((struct type *)(void *)				\
    50 +		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
    51 +
    52  #define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
    53  	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
    54  		(head)->stqh_last = &(elm)->field.stqe_next;		\
    55 @@ -286,6 +307,11 @@
    56  #define	STAILQ_FIRST(head)	((head)->stqh_first)
    57  #define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
    58  
    59 +#define	STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
    60 +	for ((var) = STAILQ_FIRST((head));				\
    61 +	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
    62 +	    (var) = (tvar))
    63 +
    64  
    65  /*
    66   * Simple queue definitions.
    67 @@ -437,11 +463,22 @@
    68  		(var);							\
    69  		(var) = ((var)->field.tqe_next))
    70  
    71 +#define	TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
    72 +	for ((var) = TAILQ_FIRST((head));				\
    73 +	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
    74 +	    (var) = (tvar))
    75 +
    76  #define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
    77  	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
    78  		(var);							\
    79  		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
    80  
    81 +#define	TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)	\
    82 +	for ((var) = TAILQ_LAST((head), headname);			\
    83 +	    (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
    84 +	    (var) = (tvar))
    85 +
    86 +
    87  #define	TAILQ_CONCAT(head1, head2, field) do {				\
    88  	if (!TAILQ_EMPTY(head2)) {					\
    89  		*(head1)->tqh_last = (head2)->tqh_first;		\