Date: Monday, January 21, 2013 @ 16:14:33
  Author: allan
Revision: 175767

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  glibc/repos/testing-i686/
  glibc/repos/testing-i686/PKGBUILD
    (from rev 175766, glibc/trunk/PKGBUILD)
  glibc/repos/testing-i686/glibc-2.17-sync-with-linux37.patch
    (from rev 175766, glibc/trunk/glibc-2.17-sync-with-linux37.patch)
  glibc/repos/testing-i686/glibc.install
    (from rev 175766, glibc/trunk/glibc.install)
  glibc/repos/testing-i686/locale-gen
    (from rev 175766, glibc/trunk/locale-gen)
  glibc/repos/testing-i686/locale.gen.txt
    (from rev 175766, glibc/trunk/locale.gen.txt)
  glibc/repos/testing-i686/nscd.service
    (from rev 175766, glibc/trunk/nscd.service)
  glibc/repos/testing-i686/nscd.tmpfiles
    (from rev 175766, glibc/trunk/nscd.tmpfiles)
  glibc/repos/testing-x86_64/
  glibc/repos/testing-x86_64/PKGBUILD
    (from rev 175766, glibc/trunk/PKGBUILD)
  glibc/repos/testing-x86_64/glibc-2.17-sync-with-linux37.patch
    (from rev 175766, glibc/trunk/glibc-2.17-sync-with-linux37.patch)
  glibc/repos/testing-x86_64/glibc.install
    (from rev 175766, glibc/trunk/glibc.install)
  glibc/repos/testing-x86_64/locale-gen
    (from rev 175766, glibc/trunk/locale-gen)
  glibc/repos/testing-x86_64/locale.gen.txt
    (from rev 175766, glibc/trunk/locale.gen.txt)
  glibc/repos/testing-x86_64/nscd.service
    (from rev 175766, glibc/trunk/nscd.service)
  glibc/repos/testing-x86_64/nscd.tmpfiles
    (from rev 175766, glibc/trunk/nscd.tmpfiles)

---------------------------------------------------+
 testing-i686/PKGBUILD                             |  142 ++++++++++++++++++++
 testing-i686/glibc-2.17-sync-with-linux37.patch   |  130 ++++++++++++++++++
 testing-i686/glibc.install                        |   19 ++
 testing-i686/locale-gen                           |   42 +++++
 testing-i686/locale.gen.txt                       |   23 +++
 testing-i686/nscd.service                         |   17 ++
 testing-i686/nscd.tmpfiles                        |    1 
 testing-x86_64/PKGBUILD                           |  142 ++++++++++++++++++++
 testing-x86_64/glibc-2.17-sync-with-linux37.patch |  130 ++++++++++++++++++
 testing-x86_64/glibc.install                      |   19 ++
 testing-x86_64/locale-gen                         |   42 +++++
 testing-x86_64/locale.gen.txt                     |   23 +++
 testing-x86_64/nscd.service                       |   17 ++
 testing-x86_64/nscd.tmpfiles                      |    1 
 14 files changed, 748 insertions(+)

Copied: glibc/repos/testing-i686/PKGBUILD (from rev 175766, 
glibc/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD                               (rev 0)
+++ testing-i686/PKGBUILD       2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,142 @@
+# $Id$
+# Maintainer: Allan McRae <[email protected]>
+
+# toolchain build order: 
linux-api-headers->glibc->binutils->gcc->binutils->glibc
+# NOTE: valgrind requires rebuilt with each major glibc version
+
+pkgname=glibc
+pkgver=2.17
+pkgrel=2
+pkgdesc="GNU C Library"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/libc";
+license=('GPL' 'LGPL')
+groups=('base')
+depends=('linux-api-headers>=3.7' 'tzdata')
+makedepends=('gcc>=4.7')
+backup=(etc/gai.conf
+        etc/locale.gen
+        etc/nscd.conf)
+options=('!strip')
+install=glibc.install
+source=(http://ftp.gnu.org/gnu/libc/${pkgname}-${pkgver}.tar.xz{,.sig}
+        glibc-2.17-sync-with-linux37.patch
+        nscd.service
+        nscd.tmpfiles
+        locale.gen.txt
+        locale-gen)
+md5sums=('87bf675c8ee523ebda4803e8e1cec638'
+         '6db4d1661cf34282755dc90330465f6d'
+         'fb99380d94598cc76d793deebf630022'
+         'c1e07c0bec0fe89791bfd9d13fc85edf'
+         'bccbe5619e75cf1d97312ec3681c605c'
+         '07ac979b6ab5eeb778d55f041529d623'
+         '476e9113489f93b348b21e144b6a8fcf')
+
+
+build() {
+  cd ${srcdir}/${pkgname}-${pkgver}
+
+  # combination of upstream commits 318cd0b, b540704 and fc1abbe
+  patch -p1 -i ${srcdir}/glibc-2.17-sync-with-linux37.patch
+
+  cd ${srcdir}
+  mkdir glibc-build
+  cd glibc-build
+
+  if [[ ${CARCH} = "i686" ]]; then
+    # Hack to fix NPTL issues with Xen, only required on 32bit platforms
+    # TODO: make separate glibc-xen package for i686
+    export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
+  fi
+
+  echo "slibdir=/usr/lib" >> configparms
+
+  # remove hardening options from CFLAGS for building libraries
+  CFLAGS=${CFLAGS/-fstack-protector/}
+  CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
+
+  ${srcdir}/${pkgname}-${pkgver}/configure --prefix=/usr \
+      --libdir=/usr/lib --libexecdir=/usr/lib \
+      --with-headers=/usr/include \
+      --with-bugurl=https://bugs.archlinux.org/ \
+      --enable-add-ons=nptl,libidn \
+      --enable-obsolete-rpc \
+      --enable-kernel=2.6.32 \
+      --enable-bind-now --disable-profile \
+      --enable-stackguard-randomization \
+      --enable-multi-arch
+
+  # build libraries with hardening disabled
+  echo "build-programs=no" >> configparms
+  make
+  
+  # re-enable hardening for programs
+  sed -i "/build-programs=/s#no#yes#" configparms
+  echo "CC += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
+  echo "CXX += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
+  make
+
+  # remove harding in preparation to run test-suite
+  sed -i '2,4d' configparms
+}
+
+check() {
+  # bug to file - the linker commands need to be reordered
+  LDFLAGS=${LDFLAGS/--as-needed,/}
+
+  cd ${srcdir}/glibc-build
+  make check
+}
+
+package() {
+  cd ${srcdir}/glibc-build
+
+  install -dm755 ${pkgdir}/etc
+  touch ${pkgdir}/etc/ld.so.conf
+
+  make install_root=${pkgdir} install
+
+  rm -f ${pkgdir}/etc/ld.so.{cache,conf}
+
+  install -dm755 ${pkgdir}/usr/lib/{locale,systemd/system,tmpfiles.d}
+
+  install -m644 ${srcdir}/${pkgname}-${pkgver}/nscd/nscd.conf 
${pkgdir}/etc/nscd.conf
+  install -m644 ${srcdir}/nscd.service ${pkgdir}/usr/lib/systemd/system
+  install -m644 ${srcdir}/nscd.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/nscd.conf
+
+  install -m644 ${srcdir}/${pkgname}-${pkgver}/posix/gai.conf 
${pkgdir}/etc/gai.conf
+
+  install -m755 ${srcdir}/locale-gen ${pkgdir}/usr/bin
+
+  # temporary symlink
+  ln -s ../../sbin/ldconfig ${pkgdir}/usr/bin/ldconfig
+
+  # create /etc/locale.gen
+  install -m644 ${srcdir}/locale.gen.txt ${pkgdir}/etc/locale.gen
+  sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
+    ${srcdir}/glibc-${pkgver}/localedata/SUPPORTED >> ${pkgdir}/etc/locale.gen
+
+  # Do not strip the following files for improved debugging support
+  # ("improved" as in not breaking gdb and valgrind...):
+  #   ld-${pkgver}.so
+  #   libc-${pkgver}.so
+  #   libpthread-${pkgver}.so
+  #   libthread_db-1.0.so
+
+  cd $pkgdir
+  strip $STRIP_BINARIES sbin/{ldconfig,sln} \
+                        usr/bin/{gencat,getconf,getent,iconv,locale,localedef} 
\
+                        usr/bin/{makedb,pcprofiledump,pldd,rpcgen,sprof} \
+                        usr/lib/getconf/* \
+                        usr/sbin/{iconvconfig,nscd}
+  [[ $CARCH = "i686" ]] && strip $STRIP_BINARIES usr/bin/lddlibc4
+
+  strip $STRIP_STATIC usr/lib/*.a
+
+  strip $STRIP_SHARED usr/lib/{libanl,libBrokenLocale,libcidn,libcrypt}-*.so \
+                      
usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \
+                      usr/lib/{libdl,libm,libnsl,libresolv,librt,libutil}-*.so 
\
+                      usr/lib/{libmemusage,libpcprofile,libSegFault}.so \
+                      usr/lib/{pt_chown,{audit,gconv}/*.so}
+}

Copied: glibc/repos/testing-i686/glibc-2.17-sync-with-linux37.patch (from rev 
175766, glibc/trunk/glibc-2.17-sync-with-linux37.patch)
===================================================================
--- testing-i686/glibc-2.17-sync-with-linux37.patch                             
(rev 0)
+++ testing-i686/glibc-2.17-sync-with-linux37.patch     2013-01-21 15:14:33 UTC 
(rev 175767)
@@ -0,0 +1,130 @@
+diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h
+index 06e8414..b62a696 100644
+--- a/sysdeps/gnu/netinet/tcp.h
++++ b/sysdeps/gnu/netinet/tcp.h
+@@ -37,20 +37,29 @@
+ /*
+  * User-settable options (used with setsockopt).
+  */
+-#define       TCP_NODELAY      1      /* Don't delay send to coalesce packets 
 */
+-#define       TCP_MAXSEG       2      /* Set maximum segment size  */
+-#define TCP_CORK       3      /* Control sending of partial frames  */
+-#define TCP_KEEPIDLE   4      /* Start keeplives after this period */
+-#define TCP_KEEPINTVL  5      /* Interval between keepalives */
+-#define TCP_KEEPCNT    6      /* Number of keepalives before death */
+-#define TCP_SYNCNT     7      /* Number of SYN retransmits */
+-#define TCP_LINGER2    8      /* Life time of orphaned FIN-WAIT-2 state */
+-#define TCP_DEFER_ACCEPT 9    /* Wake up listener only when data arrive */
+-#define TCP_WINDOW_CLAMP 10   /* Bound advertised window */
+-#define TCP_INFO       11     /* Information about this connection. */
+-#define       TCP_QUICKACK     12     /* Bock/reenable quick ACKs.  */
+-#define TCP_CONGESTION         13     /* Congestion control algorithm.  */
+-#define TCP_MD5SIG     14     /* TCP MD5 Signature (RFC2385) */
++#define       TCP_NODELAY              1  /* Don't delay send to coalesce 
packets  */
++#define       TCP_MAXSEG               2  /* Set maximum segment size  */
++#define TCP_CORK               3  /* Control sending of partial frames  */
++#define TCP_KEEPIDLE           4  /* Start keeplives after this period */
++#define TCP_KEEPINTVL          5  /* Interval between keepalives */
++#define TCP_KEEPCNT            6  /* Number of keepalives before death */
++#define TCP_SYNCNT             7  /* Number of SYN retransmits */
++#define TCP_LINGER2            8  /* Life time of orphaned FIN-WAIT-2 state */
++#define TCP_DEFER_ACCEPT       9  /* Wake up listener only when data arrive */
++#define TCP_WINDOW_CLAMP       10 /* Bound advertised window */
++#define TCP_INFO               11 /* Information about this connection. */
++#define       TCP_QUICKACK             12 /* Bock/reenable quick ACKs.  */
++#define TCP_CONGESTION                 13 /* Congestion control algorithm.  */
++#define TCP_MD5SIG             14 /* TCP MD5 Signature (RFC2385) */
++#define TCP_COOKIE_TRANSACTIONS        15 /* TCP Cookie Transactions */
++#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
++#define TCP_THIN_DUPACK                17 /* Fast retrans. after 1 dupack */
++#define TCP_USER_TIMEOUT       18 /* How long for loss retry before timeout */
++#define TCP_REPAIR             19 /* TCP sock is under repair right now */
++#define TCP_REPAIR_QUEUE       20 /* Set TCP queue to repair */
++#define TCP_QUEUE_SEQ          21 /* Set sequence number of repaired queue. */
++#define TCP_REPAIR_OPTIONS     22 /* Repair TCP connection options */
++#define TCP_FASTOPEN           23 /* Enable FastOpen on listeners */
+ 
+ #ifdef __USE_MISC
+ # include <sys/types.h>
+@@ -173,7 +182,9 @@ enum
+ # define TCPI_OPT_TIMESTAMPS  1
+ # define TCPI_OPT_SACK                2
+ # define TCPI_OPT_WSCALE      4
+-# define TCPI_OPT_ECN         8
++# define TCPI_OPT_ECN         8  /* ECN was negociated at TCP session init */
++# define TCPI_OPT_ECN_SEEN    16 /* we received at least one packet with ECT 
*/
++# define TCPI_OPT_SYN_DATA    32 /* SYN-ACK acked data in SYN sent or rcvd */
+ 
+ /* Values for tcpi_state.  */
+ enum tcp_ca_state
+@@ -241,6 +252,49 @@ struct tcp_md5sig
+   u_int8_t    tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary).  */
+ };
+ 
++/* For socket repair options.  */
++struct tcp_repair_opt
++{
++  u_int32_t   opt_code;
++  u_int32_t   opt_val;
++};
++
++/* Queue to repair, for TCP_REPAIR_QUEUE.  */
++enum
++{
++  TCP_NO_QUEUE,
++  TCP_RECV_QUEUE,
++  TCP_SEND_QUEUE,
++  TCP_QUEUES_NR,
++};
++
++/* For cookie transactions socket options.  */
++#define TCP_COOKIE_MIN                8               /*  64-bits */
++#define TCP_COOKIE_MAX                16              /* 128-bits */
++#define TCP_COOKIE_PAIR_SIZE  (2*TCP_COOKIE_MAX)
++
++/* Flags for both getsockopt and setsockopt */
++#define TCP_COOKIE_IN_ALWAYS  (1 << 0)        /* Discard SYN without cookie */
++#define TCP_COOKIE_OUT_NEVER  (1 << 1)        /* Prohibit outgoing cookies,
++                                               * supercedes everything. */
++
++/* Flags for getsockopt */
++#define TCP_S_DATA_IN         (1 << 2)        /* Was data received? */
++#define TCP_S_DATA_OUT                (1 << 3)        /* Was data sent? */
++
++#define TCP_MSS_DEFAULT                536U   /* IPv4 (RFC1122, RFC2581) */
++#define TCP_MSS_DESIRED               1220U   /* IPv6 (tunneled), EDNS0 
(RFC3226) */
++
++struct tcp_cookie_transactions
++{
++  u_int16_t   tcpct_flags;
++  u_int8_t    __tcpct_pad1;
++  u_int8_t    tcpct_cookie_desired;
++  u_int16_t   tcpct_s_data_desired;
++  u_int16_t   tcpct_used;
++  u_int8_t    tcpct_value[TCP_MSS_DEFAULT];
++};
++
+ #endif /* Misc.  */
+ 
+ #endif /* netinet/tcp.h */
+diff --git a/sysdeps/unix/sysv/linux/bits/socket.h 
b/sysdeps/unix/sysv/linux/bits/socket.h
+index df8f167..eadd7d9 100644
+--- a/sysdeps/unix/sysv/linux/bits/socket.h
++++ b/sysdeps/unix/sysv/linux/bits/socket.h
+@@ -1,6 +1,5 @@
+ /* System-specific socket constants and types.  Linux version.
+-   Copyright (C) 1991, 1992, 1994-2001, 2004, 2006-2010, 2011, 2012
+-   Free Software Foundation, Inc.
++   Copyright (C) 1991-2013 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+    The GNU C Library is free software; you can redistribute it and/or
+@@ -208,6 +207,8 @@ enum
+ #define       MSG_MORE        MSG_MORE
+     MSG_WAITFORONE    = 0x10000, /* Wait for at least one packet to return.*/
+ #define MSG_WAITFORONE        MSG_WAITFORONE
++    MSG_FASTOPEN      = 0x20000000, /* Send data in TCP SYN.  */
++#define MSG_FASTOPEN  MSG_FASTOPEN
+ 
+     MSG_CMSG_CLOEXEC  = 0x40000000    /* Set close_on_exit for file
+                                          descriptor received through

Copied: glibc/repos/testing-i686/glibc.install (from rev 175766, 
glibc/trunk/glibc.install)
===================================================================
--- testing-i686/glibc.install                          (rev 0)
+++ testing-i686/glibc.install  2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,19 @@
+infodir=usr/share/info
+filelist=(libc.info{,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11})
+
+post_upgrade() {
+  ldconfig -r .
+  locale-gen
+  
+  [[ -x usr/bin/install-info ]] || return 0
+  for file in ${filelist[@]}; do
+    install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+  done
+}
+
+pre_remove() {
+  [[ -x usr/bin/install-info ]] || return 0
+  for file in ${filelist[@]}; do
+    install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+  done
+}

Copied: glibc/repos/testing-i686/locale-gen (from rev 175766, 
glibc/trunk/locale-gen)
===================================================================
--- testing-i686/locale-gen                             (rev 0)
+++ testing-i686/locale-gen     2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+LOCALEGEN=/etc/locale.gen
+LOCALES=/usr/share/i18n/locales
+if [ -n "$POSIXLY_CORRECT" ]; then
+  unset POSIXLY_CORRECT
+fi
+
+
+[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0;
+
+# Remove all old locale dir and locale-archive before generating new
+# locale data.
+rm -rf /usr/lib/locale/* || true
+
+umask 022
+
+is_entry_ok() {
+  if [ -n "$locale" -a -n "$charset" ] ; then
+    true
+  else
+    echo "error: Bad entry '$locale $charset'"
+    false
+  fi
+}
+
+echo "Generating locales..."
+while read locale charset; do \
+       case $locale in \#*) continue;; "") continue;; esac; \
+       is_entry_ok || continue
+       echo -n "  `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \
+       echo -n ".$charset"; \
+       echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
+       echo -n '...'; \
+        if [ -f $LOCALES/$locale ]; then input=$locale; else \
+        input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \
+       localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias 
$locale; \
+       echo ' done'; \
+done < $LOCALEGEN
+echo "Generation complete."

Copied: glibc/repos/testing-i686/locale.gen.txt (from rev 175766, 
glibc/trunk/locale.gen.txt)
===================================================================
--- testing-i686/locale.gen.txt                         (rev 0)
+++ testing-i686/locale.gen.txt 2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,23 @@
+# Configuration file for locale-gen
+#
+# lists of locales that are to be generated by the locale-gen command.
+#
+# Each line is of the form:
+#
+#     <locale> <charset>
+#
+#  where <locale> is one of the locales given in /usr/share/i18n/locales
+#  and <charset> is one of the character sets listed in 
/usr/share/i18n/charmaps
+#
+#  Examples:
+#  en_US ISO-8859-1
+#  en_US.UTF-8 UTF-8
+#  de_DE ISO-8859-1
+#  de_DE@euro ISO-8859-15
+#
+#  The locale-gen command will generate all the locales,
+#  placing them in /usr/lib/locale.
+#
+#  A list of supported locales is included in this file.
+#  Uncomment the ones you need.
+#

Copied: glibc/repos/testing-i686/nscd.service (from rev 175766, 
glibc/trunk/nscd.service)
===================================================================
--- testing-i686/nscd.service                           (rev 0)
+++ testing-i686/nscd.service   2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,17 @@
+[Unit]
+Description=Name Service Cache Daemon
+After=syslog.target
+ 
+[Service]
+Type=forking
+ExecStart=/usr/sbin/nscd
+ExecStop=/usr/sbin/nscd --shutdown
+ExecReload=/usr/sbin/nscd -i passwd
+ExecReload=/usr/sbin/nscd -i group
+ExecReload=/usr/sbin/nscd -i hosts
+ExecReload=/usr/sbin/nscd -i services
+Restart=always
+PIDFile=/run/nscd/nscd.pid
+ 
+[Install]
+WantedBy=multi-user.target

Copied: glibc/repos/testing-i686/nscd.tmpfiles (from rev 175766, 
glibc/trunk/nscd.tmpfiles)
===================================================================
--- testing-i686/nscd.tmpfiles                          (rev 0)
+++ testing-i686/nscd.tmpfiles  2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1 @@
+d /run/nscd 0755 root root

Copied: glibc/repos/testing-x86_64/PKGBUILD (from rev 175766, 
glibc/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD                             (rev 0)
+++ testing-x86_64/PKGBUILD     2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,142 @@
+# $Id$
+# Maintainer: Allan McRae <[email protected]>
+
+# toolchain build order: 
linux-api-headers->glibc->binutils->gcc->binutils->glibc
+# NOTE: valgrind requires rebuilt with each major glibc version
+
+pkgname=glibc
+pkgver=2.17
+pkgrel=2
+pkgdesc="GNU C Library"
+arch=('i686' 'x86_64')
+url="http://www.gnu.org/software/libc";
+license=('GPL' 'LGPL')
+groups=('base')
+depends=('linux-api-headers>=3.7' 'tzdata')
+makedepends=('gcc>=4.7')
+backup=(etc/gai.conf
+        etc/locale.gen
+        etc/nscd.conf)
+options=('!strip')
+install=glibc.install
+source=(http://ftp.gnu.org/gnu/libc/${pkgname}-${pkgver}.tar.xz{,.sig}
+        glibc-2.17-sync-with-linux37.patch
+        nscd.service
+        nscd.tmpfiles
+        locale.gen.txt
+        locale-gen)
+md5sums=('87bf675c8ee523ebda4803e8e1cec638'
+         '6db4d1661cf34282755dc90330465f6d'
+         'fb99380d94598cc76d793deebf630022'
+         'c1e07c0bec0fe89791bfd9d13fc85edf'
+         'bccbe5619e75cf1d97312ec3681c605c'
+         '07ac979b6ab5eeb778d55f041529d623'
+         '476e9113489f93b348b21e144b6a8fcf')
+
+
+build() {
+  cd ${srcdir}/${pkgname}-${pkgver}
+
+  # combination of upstream commits 318cd0b, b540704 and fc1abbe
+  patch -p1 -i ${srcdir}/glibc-2.17-sync-with-linux37.patch
+
+  cd ${srcdir}
+  mkdir glibc-build
+  cd glibc-build
+
+  if [[ ${CARCH} = "i686" ]]; then
+    # Hack to fix NPTL issues with Xen, only required on 32bit platforms
+    # TODO: make separate glibc-xen package for i686
+    export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
+  fi
+
+  echo "slibdir=/usr/lib" >> configparms
+
+  # remove hardening options from CFLAGS for building libraries
+  CFLAGS=${CFLAGS/-fstack-protector/}
+  CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
+
+  ${srcdir}/${pkgname}-${pkgver}/configure --prefix=/usr \
+      --libdir=/usr/lib --libexecdir=/usr/lib \
+      --with-headers=/usr/include \
+      --with-bugurl=https://bugs.archlinux.org/ \
+      --enable-add-ons=nptl,libidn \
+      --enable-obsolete-rpc \
+      --enable-kernel=2.6.32 \
+      --enable-bind-now --disable-profile \
+      --enable-stackguard-randomization \
+      --enable-multi-arch
+
+  # build libraries with hardening disabled
+  echo "build-programs=no" >> configparms
+  make
+  
+  # re-enable hardening for programs
+  sed -i "/build-programs=/s#no#yes#" configparms
+  echo "CC += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
+  echo "CXX += -fstack-protector -D_FORTIFY_SOURCE=2" >> configparms
+  make
+
+  # remove harding in preparation to run test-suite
+  sed -i '2,4d' configparms
+}
+
+check() {
+  # bug to file - the linker commands need to be reordered
+  LDFLAGS=${LDFLAGS/--as-needed,/}
+
+  cd ${srcdir}/glibc-build
+  make check
+}
+
+package() {
+  cd ${srcdir}/glibc-build
+
+  install -dm755 ${pkgdir}/etc
+  touch ${pkgdir}/etc/ld.so.conf
+
+  make install_root=${pkgdir} install
+
+  rm -f ${pkgdir}/etc/ld.so.{cache,conf}
+
+  install -dm755 ${pkgdir}/usr/lib/{locale,systemd/system,tmpfiles.d}
+
+  install -m644 ${srcdir}/${pkgname}-${pkgver}/nscd/nscd.conf 
${pkgdir}/etc/nscd.conf
+  install -m644 ${srcdir}/nscd.service ${pkgdir}/usr/lib/systemd/system
+  install -m644 ${srcdir}/nscd.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/nscd.conf
+
+  install -m644 ${srcdir}/${pkgname}-${pkgver}/posix/gai.conf 
${pkgdir}/etc/gai.conf
+
+  install -m755 ${srcdir}/locale-gen ${pkgdir}/usr/bin
+
+  # temporary symlink
+  ln -s ../../sbin/ldconfig ${pkgdir}/usr/bin/ldconfig
+
+  # create /etc/locale.gen
+  install -m644 ${srcdir}/locale.gen.txt ${pkgdir}/etc/locale.gen
+  sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
+    ${srcdir}/glibc-${pkgver}/localedata/SUPPORTED >> ${pkgdir}/etc/locale.gen
+
+  # Do not strip the following files for improved debugging support
+  # ("improved" as in not breaking gdb and valgrind...):
+  #   ld-${pkgver}.so
+  #   libc-${pkgver}.so
+  #   libpthread-${pkgver}.so
+  #   libthread_db-1.0.so
+
+  cd $pkgdir
+  strip $STRIP_BINARIES sbin/{ldconfig,sln} \
+                        usr/bin/{gencat,getconf,getent,iconv,locale,localedef} 
\
+                        usr/bin/{makedb,pcprofiledump,pldd,rpcgen,sprof} \
+                        usr/lib/getconf/* \
+                        usr/sbin/{iconvconfig,nscd}
+  [[ $CARCH = "i686" ]] && strip $STRIP_BINARIES usr/bin/lddlibc4
+
+  strip $STRIP_STATIC usr/lib/*.a
+
+  strip $STRIP_SHARED usr/lib/{libanl,libBrokenLocale,libcidn,libcrypt}-*.so \
+                      
usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \
+                      usr/lib/{libdl,libm,libnsl,libresolv,librt,libutil}-*.so 
\
+                      usr/lib/{libmemusage,libpcprofile,libSegFault}.so \
+                      usr/lib/{pt_chown,{audit,gconv}/*.so}
+}

Copied: glibc/repos/testing-x86_64/glibc-2.17-sync-with-linux37.patch (from rev 
175766, glibc/trunk/glibc-2.17-sync-with-linux37.patch)
===================================================================
--- testing-x86_64/glibc-2.17-sync-with-linux37.patch                           
(rev 0)
+++ testing-x86_64/glibc-2.17-sync-with-linux37.patch   2013-01-21 15:14:33 UTC 
(rev 175767)
@@ -0,0 +1,130 @@
+diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h
+index 06e8414..b62a696 100644
+--- a/sysdeps/gnu/netinet/tcp.h
++++ b/sysdeps/gnu/netinet/tcp.h
+@@ -37,20 +37,29 @@
+ /*
+  * User-settable options (used with setsockopt).
+  */
+-#define       TCP_NODELAY      1      /* Don't delay send to coalesce packets 
 */
+-#define       TCP_MAXSEG       2      /* Set maximum segment size  */
+-#define TCP_CORK       3      /* Control sending of partial frames  */
+-#define TCP_KEEPIDLE   4      /* Start keeplives after this period */
+-#define TCP_KEEPINTVL  5      /* Interval between keepalives */
+-#define TCP_KEEPCNT    6      /* Number of keepalives before death */
+-#define TCP_SYNCNT     7      /* Number of SYN retransmits */
+-#define TCP_LINGER2    8      /* Life time of orphaned FIN-WAIT-2 state */
+-#define TCP_DEFER_ACCEPT 9    /* Wake up listener only when data arrive */
+-#define TCP_WINDOW_CLAMP 10   /* Bound advertised window */
+-#define TCP_INFO       11     /* Information about this connection. */
+-#define       TCP_QUICKACK     12     /* Bock/reenable quick ACKs.  */
+-#define TCP_CONGESTION         13     /* Congestion control algorithm.  */
+-#define TCP_MD5SIG     14     /* TCP MD5 Signature (RFC2385) */
++#define       TCP_NODELAY              1  /* Don't delay send to coalesce 
packets  */
++#define       TCP_MAXSEG               2  /* Set maximum segment size  */
++#define TCP_CORK               3  /* Control sending of partial frames  */
++#define TCP_KEEPIDLE           4  /* Start keeplives after this period */
++#define TCP_KEEPINTVL          5  /* Interval between keepalives */
++#define TCP_KEEPCNT            6  /* Number of keepalives before death */
++#define TCP_SYNCNT             7  /* Number of SYN retransmits */
++#define TCP_LINGER2            8  /* Life time of orphaned FIN-WAIT-2 state */
++#define TCP_DEFER_ACCEPT       9  /* Wake up listener only when data arrive */
++#define TCP_WINDOW_CLAMP       10 /* Bound advertised window */
++#define TCP_INFO               11 /* Information about this connection. */
++#define       TCP_QUICKACK             12 /* Bock/reenable quick ACKs.  */
++#define TCP_CONGESTION                 13 /* Congestion control algorithm.  */
++#define TCP_MD5SIG             14 /* TCP MD5 Signature (RFC2385) */
++#define TCP_COOKIE_TRANSACTIONS        15 /* TCP Cookie Transactions */
++#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
++#define TCP_THIN_DUPACK                17 /* Fast retrans. after 1 dupack */
++#define TCP_USER_TIMEOUT       18 /* How long for loss retry before timeout */
++#define TCP_REPAIR             19 /* TCP sock is under repair right now */
++#define TCP_REPAIR_QUEUE       20 /* Set TCP queue to repair */
++#define TCP_QUEUE_SEQ          21 /* Set sequence number of repaired queue. */
++#define TCP_REPAIR_OPTIONS     22 /* Repair TCP connection options */
++#define TCP_FASTOPEN           23 /* Enable FastOpen on listeners */
+ 
+ #ifdef __USE_MISC
+ # include <sys/types.h>
+@@ -173,7 +182,9 @@ enum
+ # define TCPI_OPT_TIMESTAMPS  1
+ # define TCPI_OPT_SACK                2
+ # define TCPI_OPT_WSCALE      4
+-# define TCPI_OPT_ECN         8
++# define TCPI_OPT_ECN         8  /* ECN was negociated at TCP session init */
++# define TCPI_OPT_ECN_SEEN    16 /* we received at least one packet with ECT 
*/
++# define TCPI_OPT_SYN_DATA    32 /* SYN-ACK acked data in SYN sent or rcvd */
+ 
+ /* Values for tcpi_state.  */
+ enum tcp_ca_state
+@@ -241,6 +252,49 @@ struct tcp_md5sig
+   u_int8_t    tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary).  */
+ };
+ 
++/* For socket repair options.  */
++struct tcp_repair_opt
++{
++  u_int32_t   opt_code;
++  u_int32_t   opt_val;
++};
++
++/* Queue to repair, for TCP_REPAIR_QUEUE.  */
++enum
++{
++  TCP_NO_QUEUE,
++  TCP_RECV_QUEUE,
++  TCP_SEND_QUEUE,
++  TCP_QUEUES_NR,
++};
++
++/* For cookie transactions socket options.  */
++#define TCP_COOKIE_MIN                8               /*  64-bits */
++#define TCP_COOKIE_MAX                16              /* 128-bits */
++#define TCP_COOKIE_PAIR_SIZE  (2*TCP_COOKIE_MAX)
++
++/* Flags for both getsockopt and setsockopt */
++#define TCP_COOKIE_IN_ALWAYS  (1 << 0)        /* Discard SYN without cookie */
++#define TCP_COOKIE_OUT_NEVER  (1 << 1)        /* Prohibit outgoing cookies,
++                                               * supercedes everything. */
++
++/* Flags for getsockopt */
++#define TCP_S_DATA_IN         (1 << 2)        /* Was data received? */
++#define TCP_S_DATA_OUT                (1 << 3)        /* Was data sent? */
++
++#define TCP_MSS_DEFAULT                536U   /* IPv4 (RFC1122, RFC2581) */
++#define TCP_MSS_DESIRED               1220U   /* IPv6 (tunneled), EDNS0 
(RFC3226) */
++
++struct tcp_cookie_transactions
++{
++  u_int16_t   tcpct_flags;
++  u_int8_t    __tcpct_pad1;
++  u_int8_t    tcpct_cookie_desired;
++  u_int16_t   tcpct_s_data_desired;
++  u_int16_t   tcpct_used;
++  u_int8_t    tcpct_value[TCP_MSS_DEFAULT];
++};
++
+ #endif /* Misc.  */
+ 
+ #endif /* netinet/tcp.h */
+diff --git a/sysdeps/unix/sysv/linux/bits/socket.h 
b/sysdeps/unix/sysv/linux/bits/socket.h
+index df8f167..eadd7d9 100644
+--- a/sysdeps/unix/sysv/linux/bits/socket.h
++++ b/sysdeps/unix/sysv/linux/bits/socket.h
+@@ -1,6 +1,5 @@
+ /* System-specific socket constants and types.  Linux version.
+-   Copyright (C) 1991, 1992, 1994-2001, 2004, 2006-2010, 2011, 2012
+-   Free Software Foundation, Inc.
++   Copyright (C) 1991-2013 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+    The GNU C Library is free software; you can redistribute it and/or
+@@ -208,6 +207,8 @@ enum
+ #define       MSG_MORE        MSG_MORE
+     MSG_WAITFORONE    = 0x10000, /* Wait for at least one packet to return.*/
+ #define MSG_WAITFORONE        MSG_WAITFORONE
++    MSG_FASTOPEN      = 0x20000000, /* Send data in TCP SYN.  */
++#define MSG_FASTOPEN  MSG_FASTOPEN
+ 
+     MSG_CMSG_CLOEXEC  = 0x40000000    /* Set close_on_exit for file
+                                          descriptor received through

Copied: glibc/repos/testing-x86_64/glibc.install (from rev 175766, 
glibc/trunk/glibc.install)
===================================================================
--- testing-x86_64/glibc.install                                (rev 0)
+++ testing-x86_64/glibc.install        2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,19 @@
+infodir=usr/share/info
+filelist=(libc.info{,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11})
+
+post_upgrade() {
+  ldconfig -r .
+  locale-gen
+  
+  [[ -x usr/bin/install-info ]] || return 0
+  for file in ${filelist[@]}; do
+    install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+  done
+}
+
+pre_remove() {
+  [[ -x usr/bin/install-info ]] || return 0
+  for file in ${filelist[@]}; do
+    install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+  done
+}

Copied: glibc/repos/testing-x86_64/locale-gen (from rev 175766, 
glibc/trunk/locale-gen)
===================================================================
--- testing-x86_64/locale-gen                           (rev 0)
+++ testing-x86_64/locale-gen   2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+LOCALEGEN=/etc/locale.gen
+LOCALES=/usr/share/i18n/locales
+if [ -n "$POSIXLY_CORRECT" ]; then
+  unset POSIXLY_CORRECT
+fi
+
+
+[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0;
+
+# Remove all old locale dir and locale-archive before generating new
+# locale data.
+rm -rf /usr/lib/locale/* || true
+
+umask 022
+
+is_entry_ok() {
+  if [ -n "$locale" -a -n "$charset" ] ; then
+    true
+  else
+    echo "error: Bad entry '$locale $charset'"
+    false
+  fi
+}
+
+echo "Generating locales..."
+while read locale charset; do \
+       case $locale in \#*) continue;; "") continue;; esac; \
+       is_entry_ok || continue
+       echo -n "  `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \
+       echo -n ".$charset"; \
+       echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
+       echo -n '...'; \
+        if [ -f $LOCALES/$locale ]; then input=$locale; else \
+        input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \
+       localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias 
$locale; \
+       echo ' done'; \
+done < $LOCALEGEN
+echo "Generation complete."

Copied: glibc/repos/testing-x86_64/locale.gen.txt (from rev 175766, 
glibc/trunk/locale.gen.txt)
===================================================================
--- testing-x86_64/locale.gen.txt                               (rev 0)
+++ testing-x86_64/locale.gen.txt       2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,23 @@
+# Configuration file for locale-gen
+#
+# lists of locales that are to be generated by the locale-gen command.
+#
+# Each line is of the form:
+#
+#     <locale> <charset>
+#
+#  where <locale> is one of the locales given in /usr/share/i18n/locales
+#  and <charset> is one of the character sets listed in 
/usr/share/i18n/charmaps
+#
+#  Examples:
+#  en_US ISO-8859-1
+#  en_US.UTF-8 UTF-8
+#  de_DE ISO-8859-1
+#  de_DE@euro ISO-8859-15
+#
+#  The locale-gen command will generate all the locales,
+#  placing them in /usr/lib/locale.
+#
+#  A list of supported locales is included in this file.
+#  Uncomment the ones you need.
+#

Copied: glibc/repos/testing-x86_64/nscd.service (from rev 175766, 
glibc/trunk/nscd.service)
===================================================================
--- testing-x86_64/nscd.service                         (rev 0)
+++ testing-x86_64/nscd.service 2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1,17 @@
+[Unit]
+Description=Name Service Cache Daemon
+After=syslog.target
+ 
+[Service]
+Type=forking
+ExecStart=/usr/sbin/nscd
+ExecStop=/usr/sbin/nscd --shutdown
+ExecReload=/usr/sbin/nscd -i passwd
+ExecReload=/usr/sbin/nscd -i group
+ExecReload=/usr/sbin/nscd -i hosts
+ExecReload=/usr/sbin/nscd -i services
+Restart=always
+PIDFile=/run/nscd/nscd.pid
+ 
+[Install]
+WantedBy=multi-user.target

Copied: glibc/repos/testing-x86_64/nscd.tmpfiles (from rev 175766, 
glibc/trunk/nscd.tmpfiles)
===================================================================
--- testing-x86_64/nscd.tmpfiles                                (rev 0)
+++ testing-x86_64/nscd.tmpfiles        2013-01-21 15:14:33 UTC (rev 175767)
@@ -0,0 +1 @@
+d /run/nscd 0755 root root

Reply via email to