summaryrefslogtreecommitdiffstats
path: root/abs/core/glibc
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/glibc')
-rw-r--r--abs/core/glibc/PKGBUILD110
-rw-r--r--abs/core/glibc/bz20338.patch114
-rw-r--r--abs/core/glibc/bz26534.patch11
-rw-r--r--abs/core/glibc/sdt-config.h6
-rw-r--r--abs/core/glibc/sdt.h430
5 files changed, 509 insertions, 162 deletions
diff --git a/abs/core/glibc/PKGBUILD b/abs/core/glibc/PKGBUILD
index 1da7c0a..aa8e37d 100644
--- a/abs/core/glibc/PKGBUILD
+++ b/abs/core/glibc/PKGBUILD
@@ -1,4 +1,3 @@
-# $Id$
# Maintainer: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
@@ -7,34 +6,42 @@
pkgbase=glibc
pkgname=(glibc lib32-glibc)
-pkgver=2.26
-pkgrel=11
+pkgver=2.32
+pkgrel=4
arch=(x86_64)
-url='http://www.gnu.org/software/libc'
+url='https://www.gnu.org/software/libc'
license=(GPL LGPL)
-makedepends=(git gd lib32-gcc-libs)
+makedepends=(git gd lib32-gcc-libs python)
options=(!strip staticlibs)
-_commit=de51f431ed6226ec68ca76e578f2cbd55b6262cb
-source=(git+https://sourceware.org/git/glibc.git#commit=${_commit}
+#_commit=3de512be7ea6053255afed6154db9ee31d4e557a
+#source=(git+https://sourceware.org/git/glibc.git#commit=$_commit
+source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.xz{,.sig}
locale.gen.txt
locale-gen
lib32-glibc.conf
- bz20338.patch)
-md5sums=('SKIP'
+ sdt.h sdt-config.h
+ bz26534.patch)
+validpgpkeys=(7273542B39962DF7B299931416792B4EA25340F8 # Carlos O'Donell
+ BC7C7372637EC10C57D7AA6579C43DFBF1CF2187) # Siddhesh Poyarekar
+md5sums=('720c7992861c57cf97d66a2f36d8d1fa'
+ 'SKIP'
'07ac979b6ab5eeb778d55f041529d623'
'476e9113489f93b348b21e144b6a8fcf'
'6e052f1cb693d5d3203f50f9d4e8c33b'
- 'dc0d3ad59aeaaf591b085a77de6e03e9')
+ '91fec3b7e75510ae2ac42533aa2e695e'
+ '680df504c683640b02ed4a805797c0b2'
+ 'fc57038c1297c7c11258e8dda1623ec2')
prepare() {
mkdir -p glibc-build lib32-glibc-build
+ [[ -d glibc-$pkgver ]] && ln -s glibc-$pkgver glibc
cd glibc
local i; for i in ${source[@]}; do
case ${i%::*} in
*.patch)
- msg2 "Applying ${i}"
+ echo " -> Applying ${i}"
patch -p1 -i "$srcdir/${i}"
;;
esac
@@ -48,12 +55,13 @@ build() {
--with-bugurl=https://bugs.archlinux.org/
--enable-add-ons
--enable-bind-now
+ --enable-cet
--enable-lock-elision
--enable-multi-arch
- --enable-obsolete-nsl
- --enable-obsolete-rpc
--enable-stack-protector=strong
--enable-stackguard-randomization
+ --enable-static-pie
+ --enable-systemtap
--disable-profile
--disable-werror
)
@@ -68,6 +76,11 @@ build() {
# remove fortify for building libraries
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
+ #
+ CFLAGS=${CFLAGS/-fno-plt/}
+ CXXFLAGS=${CXXFLAGS/-fno-plt/}
+ LDFLAGS=${LDFLAGS/,-z,now/}
+
"$srcdir/glibc/configure" \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
@@ -84,6 +97,9 @@ build() {
echo "CXX += -D_FORTIFY_SOURCE=2" >> configparms
make
+ # build info pages manually for reprducibility
+ make info
+
cd "$srcdir/lib32-glibc-build"
export CC="gcc -m32 -mstackrealign"
export CXX="g++ -m32 -mstackrealign"
@@ -135,7 +151,6 @@ package_glibc() {
backup=(etc/gai.conf
etc/locale.gen
etc/nscd.conf)
- groups=(base)
install -dm755 "$pkgdir/etc"
touch "$pkgdir/etc/ld.so.conf"
@@ -143,6 +158,9 @@ package_glibc() {
make -C glibc-build install_root="$pkgdir" install
rm -f "$pkgdir"/etc/ld.so.{cache,conf}
+ # Shipped in tzdata
+ rm -f "$pkgdir"/usr/bin/{tzselect,zdump,zic}
+
cd glibc
install -dm755 "$pkgdir"/usr/lib/{locale,systemd/system,tmpfiles.d}
@@ -155,41 +173,37 @@ package_glibc() {
install -m755 "$srcdir/locale-gen" "$pkgdir/usr/bin"
- # create /etc/locale.gen
+ # 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/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
-
if check_option 'debug' n; then
- cd "$pkgdir"
- strip $STRIP_BINARIES usr/bin/{gencat,getconf,getent,iconv,iconvconfig} \
- usr/bin/{ldconfig,locale,localedef,nscd,makedb} \
- usr/bin/{pcprofiledump,pldd,rpcgen,sln,sprof} \
- usr/lib/getconf/*
-
- strip $STRIP_STATIC usr/lib/lib{anl,BrokenLocale,c{,_nonshared},crypt}.a \
- usr/lib/lib{dl,g,ieee,mcheck,nsl,pthread{,_nonshared}}.a \
- usr/lib/lib{resolv,rpcsvc,rt,util}.a \
- usr/lib/lib{m-${pkgver},mvec{,_nonshared}}.a
-
- strip $STRIP_SHARED usr/lib/lib{anl,BrokenLocale,cidn,crypt}-${pkgver}.so \
- usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \
- usr/lib/lib{dl,m,nsl,resolv,rt,util}-${pkgver}.so \
- usr/lib/lib{memusage,pcprofile,SegFault}.so \
- usr/lib/{audit,gconv}/*.so usr/lib/libmvec-*.so || true
+ find "$pkgdir"/usr/bin -type f -executable -exec strip $STRIP_BINARIES {} + 2> /dev/null || true
+ find "$pkgdir"/usr/lib -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true
+
+ # Do not strip these for gdb and valgrind functionality, but strip the rest
+ find "$pkgdir"/usr/lib \
+ -not -name 'ld-*.so' \
+ -not -name 'libc-*.so' \
+ -not -name 'libpthread-*.so' \
+ -not -name 'libthread_db-*.so' \
+ -name '*-*.so' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
fi
+
+ # Provide tracing probes to libstdc++ for exceptions, possibly for other
+ # libraries too. Useful for gdb's catch command.
+ install -Dm644 "$srcdir/sdt.h" "$pkgdir/usr/include/sys/sdt.h"
+ install -Dm644 "$srcdir/sdt-config.h" "$pkgdir/usr/include/sys/sdt-config.h"
+
+ # Provided by libxcrypt; keep the old shared library for backwards compatibility
+ rm -f "$pkgdir"/usr/include/crypt.h "$pkgdir"/usr/lib/libcrypt.{a,so}
}
package_lib32-glibc() {
pkgdesc='GNU C Library (32-bit)'
depends=("glibc=$pkgver")
+ options+=('!emptydirs')
cd lib32-glibc-build
@@ -210,15 +224,15 @@ package_lib32-glibc() {
ln -s ../lib/locale "$pkgdir/usr/lib32/locale"
if check_option 'debug' n; then
- cd $pkgdir
- strip $STRIP_BINARIES usr/lib32/getconf/*
- strip $STRIP_STATIC usr/lib32/lib{anl,BrokenLocale,c{,_nonshared},crypt}.a \
- usr/lib32/lib{dl,g,ieee,mcheck,nsl,pthread{,_nonshared}}.a \
- usr/lib32/lib{resolv,rpcsvc,rt,util,m}.a
- strip $STRIP_SHARED usr/lib32/lib{anl,BrokenLocale,cidn,crypt}-${pkgver}.so \
- usr/lib32/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \
- usr/lib32/lib{dl,m,nsl,resolv,rt,util}-${pkgver}.so \
- usr/lib32/lib{memusage,pcprofile,SegFault}.so \
- usr/lib32/{audit,gconv}/*.so || true
+ find "$pkgdir"/usr/lib32 -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true
+ find "$pkgdir"/usr/lib32 \
+ -not -name 'ld-*.so' \
+ -not -name 'libc-*.so' \
+ -not -name 'libpthread-*.so' \
+ -not -name 'libthread_db-*.so' \
+ -name '*-*.so' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
fi
+
+ # Provided by lib32-libxcrypt; keep the old shared library for backwards compatibility
+ rm -f "$pkgdir"/usr/lib32/libcrypt.{a,so}
}
diff --git a/abs/core/glibc/bz20338.patch b/abs/core/glibc/bz20338.patch
deleted file mode 100644
index d223e9f..0000000
--- a/abs/core/glibc/bz20338.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From 74250a7cdf106d4ca7d9506e6d5dc7c448dc3434 Mon Sep 17 00:00:00 2001
-From: David Michael <david.michael@coreos.com>
-Date: Thu, 15 Dec 2016 15:22:57 -0800
-Subject: [PATCH] gshadow: Sync fgetsgent_r.c with grp/fgetgrent_r.c
-
- [BZ #20338]
- * gshadow/fgetsgent_r.c: Include <libio/iolibio.h>.
- (flockfile): New macro.
- (funlockfile): Likewise.
- (__fgetsgent_r): Sync with __fgetgrent_r.
- * nss/nss_files/files-sgrp.c: Fix "fgetsgent_r.c" typo.
----
- gshadow/fgetsgent_r.c | 35 ++++++++++++++++++++++++-----------
- nss/nss_files/files-sgrp.c | 2 +-
- 2 files changed, 25 insertions(+), 12 deletions(-)
-
-diff --git a/gshadow/fgetsgent_r.c b/gshadow/fgetsgent_r.c
-index b70f6fa..02cd33a 100644
---- a/gshadow/fgetsgent_r.c
-+++ b/gshadow/fgetsgent_r.c
-@@ -20,39 +20,44 @@
- #include <gshadow.h>
- #include <stdio.h>
-
-+#include <libio/iolibio.h>
-+#define flockfile(s) _IO_flockfile (s)
-+#define funlockfile(s) _IO_funlockfile (s)
-+
- /* Define a line parsing function using the common code
- used in the nss_files module. */
-
- #define STRUCTURE sgrp
- #define ENTNAME sgent
--#define EXTERN_PARSER 1
-+#define EXTERN_PARSER 1
- struct sgent_data {};
-
- #include <nss/nss_files/files-parse.c>
-
-
--/* Read one shadow entry from the given stream. */
-+/* Read one entry from the given stream. */
- int
- __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer, size_t buflen,
- struct sgrp **result)
- {
- char *p;
-+ int parse_result;
-
-- _IO_flockfile (stream);
-+ flockfile (stream);
- do
- {
- buffer[buflen - 1] = '\xff';
- p = fgets_unlocked (buffer, buflen, stream);
-- if (p == NULL && feof_unlocked (stream))
-+ if (__builtin_expect (p == NULL, 0) && feof_unlocked (stream))
- {
-- _IO_funlockfile (stream);
-+ funlockfile (stream);
- *result = NULL;
- __set_errno (ENOENT);
- return errno;
- }
-- if (p == NULL || buffer[buflen - 1] != '\xff')
-+ if (__builtin_expect (p == NULL, 0) || buffer[buflen - 1] != '\xff')
- {
-- _IO_funlockfile (stream);
-+ funlockfile (stream);
- *result = NULL;
- __set_errno (ERANGE);
- return errno;
-@@ -61,13 +66,21 @@ __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer, size_t buflen,
- /* Skip leading blanks. */
- while (isspace (*p))
- ++p;
-- } while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */
-+ } while (*p == '\0' || *p == '#' /* Ignore empty and comment lines. */
- /* Parse the line. If it is invalid, loop to
- get the next line of the file to parse. */
-- ! parse_line (buffer, (void *) resbuf, (void *) buffer, buflen,
-- &errno));
-+ || ! (parse_result = parse_line (p, resbuf,
-+ (void *) buffer, buflen,
-+ &errno)));
-+
-+ funlockfile (stream);
-
-- _IO_funlockfile (stream);
-+ if (__builtin_expect (parse_result, 0) == -1)
-+ {
-+ /* The parser ran out of space. */
-+ *result = NULL;
-+ return errno;
-+ }
-
- *result = resbuf;
- return 0;
-diff --git a/nss/nss_files/files-sgrp.c b/nss/nss_files/files-sgrp.c
-index 15dc659..05c3805 100644
---- a/nss/nss_files/files-sgrp.c
-+++ b/nss/nss_files/files-sgrp.c
-@@ -23,7 +23,7 @@
- #define DATABASE "gshadow"
- struct sgent_data {};
-
--/* Our parser function is already defined in sgetspent_r.c, so use that
-+/* Our parser function is already defined in sgetsgent_r.c, so use that
- to parse lines from the database file. */
- #define EXTERN_PARSER
- #include "files-parse.c"
---
-2.7.4
-
diff --git a/abs/core/glibc/bz26534.patch b/abs/core/glibc/bz26534.patch
new file mode 100644
index 0000000..5a2fdd8
--- /dev/null
+++ b/abs/core/glibc/bz26534.patch
@@ -0,0 +1,11 @@
+--- a/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h 2020-08-25 15:08:15.049364392 +0200
++++ b/sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h 2020-08-25 15:08:20.012697875 +0200
+@@ -32,7 +32,7 @@
+ && CPU_FEATURE_USABLE_P (cpu_features, AVX2))
+ return OPTIMIZE (fma);
+
+- if (CPU_FEATURE_USABLE_P (cpu_features, FMA))
++ if (CPU_FEATURE_USABLE_P (cpu_features, FMA4))
+ return OPTIMIZE (fma4);
+
+ return OPTIMIZE (sse2);
diff --git a/abs/core/glibc/sdt-config.h b/abs/core/glibc/sdt-config.h
new file mode 100644
index 0000000..733045a
--- /dev/null
+++ b/abs/core/glibc/sdt-config.h
@@ -0,0 +1,6 @@
+/* includes/sys/sdt-config.h. Generated from sdt-config.h.in by configure.
+
+ This file just defines _SDT_ASM_SECTION_AUTOGROUP_SUPPORT to 0 or 1 to
+ indicate whether the assembler supports "?" in .pushsection directives. */
+
+#define _SDT_ASM_SECTION_AUTOGROUP_SUPPORT 1
diff --git a/abs/core/glibc/sdt.h b/abs/core/glibc/sdt.h
new file mode 100644
index 0000000..c0c5a49
--- /dev/null
+++ b/abs/core/glibc/sdt.h
@@ -0,0 +1,430 @@
+/* <sys/sdt.h> - Systemtap static probe definition macros.
+
+ This file is dedicated to the public domain, pursuant to CC0
+ (https://creativecommons.org/publicdomain/zero/1.0/)
+*/
+
+#ifndef _SYS_SDT_H
+#define _SYS_SDT_H 1
+
+/*
+ This file defines a family of macros
+
+ STAP_PROBEn(op1, ..., opn)
+
+ that emit a nop into the instruction stream, and some data into an auxiliary
+ note section. The data in the note section describes the operands, in terms
+ of size and location. Each location is encoded as assembler operand string.
+ Consumer tools such as gdb or systemtap insert breakpoints on top of
+ the nop, and decode the location operand-strings, like an assembler,
+ to find the values being passed.
+
+ The operand strings are selected by the compiler for each operand.
+ They are constrained by gcc inline-assembler codes. The default is:
+
+ #define STAP_SDT_ARG_CONSTRAINT nor
+
+ This is a good default if the operands tend to be integral and
+ moderate in number (smaller than number of registers). In other
+ cases, the compiler may report "'asm' requires impossible reload" or
+ similar. In this case, consider simplifying the macro call (fewer
+ and simpler operands), reduce optimization, or override the default
+ constraints string via:
+
+ #define STAP_SDT_ARG_CONSTRAINT g
+ #include <sys/sdt.h>
+
+ See also:
+ https://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation
+ https://gcc.gnu.org/onlinedocs/gcc/Constraints.html
+ */
+
+
+
+#ifdef __ASSEMBLER__
+# define _SDT_PROBE(provider, name, n, arglist) \
+ _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING_1, (_SDT_DEPAREN_##n arglist)) \
+ _SDT_ASM_BASE
+# define _SDT_ASM_1(x) x;
+# define _SDT_ASM_2(a, b) a,b;
+# define _SDT_ASM_3(a, b, c) a,b,c;
+# define _SDT_ASM_5(a, b, c, d, e) a,b,c,d,e;
+# define _SDT_ASM_STRING_1(x) .asciz #x;
+# define _SDT_DEPAREN_0() /* empty */
+# define _SDT_DEPAREN_1(a) a
+# define _SDT_DEPAREN_2(a,b) a b
+# define _SDT_DEPAREN_3(a,b,c) a b c
+# define _SDT_DEPAREN_4(a,b,c,d) a b c d
+# define _SDT_DEPAREN_5(a,b,c,d,e) a b c d e
+# define _SDT_DEPAREN_6(a,b,c,d,e,f) a b c d e f
+# define _SDT_DEPAREN_7(a,b,c,d,e,f,g) a b c d e f g
+# define _SDT_DEPAREN_8(a,b,c,d,e,f,g,h) a b c d e f g h
+# define _SDT_DEPAREN_9(a,b,c,d,e,f,g,h,i) a b c d e f g h i
+# define _SDT_DEPAREN_10(a,b,c,d,e,f,g,h,i,j) a b c d e f g h i j
+# define _SDT_DEPAREN_11(a,b,c,d,e,f,g,h,i,j,k) a b c d e f g h i j k
+# define _SDT_DEPAREN_12(a,b,c,d,e,f,g,h,i,j,k,l) a b c d e f g h i j k l
+#else
+# define _SDT_PROBE(provider, name, n, arglist) \
+ do { \
+ __asm__ __volatile__ (_SDT_ASM_BODY(provider, name, _SDT_ASM_ARGS, (n)) \
+ :: _SDT_ASM_OPERANDS_##n arglist); \
+ __asm__ __volatile__ (_SDT_ASM_BASE); \
+ } while (0)
+# define _SDT_S(x) #x
+# define _SDT_ASM_1(x) _SDT_S(x) "\n"
+# define _SDT_ASM_2(a, b) _SDT_S(a) "," _SDT_S(b) "\n"
+# define _SDT_ASM_3(a, b, c) _SDT_S(a) "," _SDT_S(b) "," \
+ _SDT_S(c) "\n"
+# define _SDT_ASM_5(a, b, c, d, e) _SDT_S(a) "," _SDT_S(b) "," \
+ _SDT_S(c) "," _SDT_S(d) "," \
+ _SDT_S(e) "\n"
+# define _SDT_ASM_ARGS(n) _SDT_ASM_STRING(_SDT_ASM_TEMPLATE_##n)
+# define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x)
+
+# define _SDT_ARGFMT(no) %n[_SDT_S##no]@_SDT_ARGTMPL(_SDT_A##no)
+
+# ifndef STAP_SDT_ARG_CONSTRAINT
+# if defined __powerpc__
+# define STAP_SDT_ARG_CONSTRAINT nZr
+# else
+# define STAP_SDT_ARG_CONSTRAINT nor
+# endif
+# endif
+
+# define _SDT_STRINGIFY(x) #x
+# define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x)
+# define _SDT_ARG(n, x) \
+ [_SDT_S##n] "n" ((_SDT_ARGSIGNED (x) ? 1 : -1) * (int) _SDT_ARGSIZE (x)), \
+ [_SDT_A##n] _SDT_ARG_CONSTRAINT_STRING (STAP_SDT_ARG_CONSTRAINT) (_SDT_ARGVAL (x))
+#endif
+#define _SDT_ASM_STRING(x) _SDT_ASM_STRING_1(x)
+
+#define _SDT_ARGARRAY(x) (__builtin_classify_type (x) == 14 \
+ || __builtin_classify_type (x) == 5)
+
+#ifdef __cplusplus
+# define _SDT_ARGSIGNED(x) (!_SDT_ARGARRAY (x) \
+ && __sdt_type<__typeof (x)>::__sdt_signed)
+# define _SDT_ARGSIZE(x) (_SDT_ARGARRAY (x) \
+ ? sizeof (void *) : sizeof (x))
+# define _SDT_ARGVAL(x) (x)
+
+# include <cstddef>
+
+template<typename __sdt_T>
+struct __sdt_type
+{
+ static const bool __sdt_signed = false;
+};
+
+#define __SDT_ALWAYS_SIGNED(T) \
+template<> struct __sdt_type<T> { static const bool __sdt_signed = true; };
+#define __SDT_COND_SIGNED(T,CT) \
+template<> struct __sdt_type<T> { static const bool __sdt_signed = ((CT)(-1) < 1); };
+__SDT_ALWAYS_SIGNED(signed char)
+__SDT_ALWAYS_SIGNED(short)
+__SDT_ALWAYS_SIGNED(int)
+__SDT_ALWAYS_SIGNED(long)
+__SDT_ALWAYS_SIGNED(long long)
+__SDT_ALWAYS_SIGNED(volatile signed char)
+__SDT_ALWAYS_SIGNED(volatile short)
+__SDT_ALWAYS_SIGNED(volatile int)
+__SDT_ALWAYS_SIGNED(volatile long)
+__SDT_ALWAYS_SIGNED(volatile long long)
+__SDT_ALWAYS_SIGNED(const signed char)
+__SDT_ALWAYS_SIGNED(const short)
+__SDT_ALWAYS_SIGNED(const int)
+__SDT_ALWAYS_SIGNED(const long)
+__SDT_ALWAYS_SIGNED(const long long)
+__SDT_ALWAYS_SIGNED(const volatile signed char)
+__SDT_ALWAYS_SIGNED(const volatile short)
+__SDT_ALWAYS_SIGNED(const volatile int)
+__SDT_ALWAYS_SIGNED(const volatile long)
+__SDT_ALWAYS_SIGNED(const volatile long long)
+__SDT_COND_SIGNED(char, char)
+__SDT_COND_SIGNED(wchar_t, wchar_t)
+__SDT_COND_SIGNED(volatile char, char)
+__SDT_COND_SIGNED(volatile wchar_t, wchar_t)
+__SDT_COND_SIGNED(const char, char)
+__SDT_COND_SIGNED(const wchar_t, wchar_t)
+__SDT_COND_SIGNED(const volatile char, char)
+__SDT_COND_SIGNED(const volatile wchar_t, wchar_t)
+#if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+/* __SDT_COND_SIGNED(char16_t) */
+/* __SDT_COND_SIGNED(char32_t) */
+#endif
+
+template<typename __sdt_E>
+struct __sdt_type<__sdt_E[]> : public __sdt_type<__sdt_E *> {};
+
+template<typename __sdt_E, size_t __sdt_N>
+struct __sdt_type<__sdt_E[__sdt_N]> : public __sdt_type<__sdt_E *> {};
+
+#elif !defined(__ASSEMBLER__)
+__extension__ extern unsigned long long __sdt_unsp;
+# define _SDT_ARGINTTYPE(x) \
+ __typeof (__builtin_choose_expr (((__builtin_classify_type (x) \
+ + 3) & -4) == 4, (x), 0U))
+# define _SDT_ARGSIGNED(x) \
+ (!__extension__ \
+ (__builtin_constant_p ((((unsigned long long) \
+ (_SDT_ARGINTTYPE (x)) __sdt_unsp) \
+ & ((unsigned long long)1 << (sizeof (unsigned long long) \
+ * __CHAR_BIT__ - 1))) == 0) \
+ || (_SDT_ARGINTTYPE (x)) -1 > (_SDT_ARGINTTYPE (x)) 0))
+# define _SDT_ARGSIZE(x) \
+ (_SDT_ARGARRAY (x) ? sizeof (void *) : sizeof (x))
+# define _SDT_ARGVAL(x) (x)
+#endif
+
+#if defined __powerpc__ || defined __powerpc64__
+# define _SDT_ARGTMPL(id) %I[id]%[id]
+#elif defined __i386__
+# define _SDT_ARGTMPL(id) %w[id] /* gcc.gnu.org/PR80115 */
+#else
+# define _SDT_ARGTMPL(id) %[id]
+#endif
+
+#ifdef __LP64__
+# define _SDT_ASM_ADDR .8byte
+#else
+# define _SDT_ASM_ADDR .4byte
+#endif
+
+/* The ia64 and s390 nop instructions take an argument. */
+#if defined(__ia64__) || defined(__s390__) || defined(__s390x__)
+#define _SDT_NOP nop 0
+#else
+#define _SDT_NOP nop
+#endif
+
+#define _SDT_NOTE_NAME "stapsdt"
+#define _SDT_NOTE_TYPE 3
+
+/* If the assembler supports the necessary feature, then we can play
+ nice with code in COMDAT sections, which comes up in C++ code.
+ Without that assembler support, some combinations of probe placements
+ in certain kinds of C++ code may produce link-time errors. */
+#include "sdt-config.h"
+#if _SDT_ASM_SECTION_AUTOGROUP_SUPPORT
+# define _SDT_ASM_AUTOGROUP "?"
+#else
+# define _SDT_ASM_AUTOGROUP ""
+#endif
+
+#define _SDT_ASM_BODY(provider, name, pack_args, args) \
+ _SDT_ASM_1(990: _SDT_NOP) \
+ _SDT_ASM_3( .pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \
+ _SDT_ASM_1( .balign 4) \
+ _SDT_ASM_3( .4byte 992f-991f, 994f-993f, _SDT_NOTE_TYPE) \
+ _SDT_ASM_1(991: .asciz _SDT_NOTE_NAME) \
+ _SDT_ASM_1(992: .balign 4) \
+ _SDT_ASM_1(993: _SDT_ASM_ADDR 990b) \
+ _SDT_ASM_1( _SDT_ASM_ADDR _.stapsdt.base) \
+ _SDT_SEMAPHORE(provider,name) \
+ _SDT_ASM_STRING(provider) \
+ _SDT_ASM_STRING(name) \
+ pack_args args \
+ _SDT_ASM_1(994: .balign 4) \
+ _SDT_ASM_1( .popsection)
+
+#define _SDT_ASM_BASE \
+ _SDT_ASM_1(.ifndef _.stapsdt.base) \
+ _SDT_ASM_5( .pushsection .stapsdt.base,"aG","progbits", \
+ .stapsdt.base,comdat) \
+ _SDT_ASM_1( .weak _.stapsdt.base) \
+ _SDT_ASM_1( .hidden _.stapsdt.base) \
+ _SDT_ASM_1( _.stapsdt.base: .space 1) \
+ _SDT_ASM_2( .size _.stapsdt.base, 1) \
+ _SDT_ASM_1( .popsection) \
+ _SDT_ASM_1(.endif)
+
+#if defined _SDT_HAS_SEMAPHORES
+#define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR p##_##n##_semaphore)
+#else
+#define _SDT_SEMAPHORE(p,n) _SDT_ASM_1( _SDT_ASM_ADDR 0)
+#endif
+
+#define _SDT_ASM_TEMPLATE_0 /* no arguments */
+#define _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(1)
+#define _SDT_ASM_TEMPLATE_2 _SDT_ASM_TEMPLATE_1 _SDT_ARGFMT(2)
+#define _SDT_ASM_TEMPLATE_3 _SDT_ASM_TEMPLATE_2 _SDT_ARGFMT(3)
+#define _SDT_ASM_TEMPLATE_4 _SDT_ASM_TEMPLATE_3 _SDT_ARGFMT(4)
+#define _SDT_ASM_TEMPLATE_5 _SDT_ASM_TEMPLATE_4 _SDT_ARGFMT(5)
+#define _SDT_ASM_TEMPLATE_6 _SDT_ASM_TEMPLATE_5 _SDT_ARGFMT(6)
+#define _SDT_ASM_TEMPLATE_7 _SDT_ASM_TEMPLATE_6 _SDT_ARGFMT(7)
+#define _SDT_ASM_TEMPLATE_8 _SDT_ASM_TEMPLATE_7 _SDT_ARGFMT(8)
+#define _SDT_ASM_TEMPLATE_9 _SDT_ASM_TEMPLATE_8 _SDT_ARGFMT(9)
+#define _SDT_ASM_TEMPLATE_10 _SDT_ASM_TEMPLATE_9 _SDT_ARGFMT(10)
+#define _SDT_ASM_TEMPLATE_11 _SDT_ASM_TEMPLATE_10 _SDT_ARGFMT(11)
+#define _SDT_ASM_TEMPLATE_12 _SDT_ASM_TEMPLATE_11 _SDT_ARGFMT(12)
+#define _SDT_ASM_OPERANDS_0() [__sdt_dummy] "g" (0)
+#define _SDT_ASM_OPERANDS_1(arg1) _SDT_ARG(1, arg1)
+#define _SDT_ASM_OPERANDS_2(arg1, arg2) \
+ _SDT_ASM_OPERANDS_1(arg1), _SDT_ARG(2, arg2)
+#define _SDT_ASM_OPERANDS_3(arg1, arg2, arg3) \
+ _SDT_ASM_OPERANDS_2(arg1, arg2), _SDT_ARG(3, arg3)
+#define _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4) \
+ _SDT_ASM_OPERANDS_3(arg1, arg2, arg3), _SDT_ARG(4, arg4)
+#define _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5) \
+ _SDT_ASM_OPERANDS_4(arg1, arg2, arg3, arg4), _SDT_ARG(5, arg5)
+#define _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6) \
+ _SDT_ASM_OPERANDS_5(arg1, arg2, arg3, arg4, arg5), _SDT_ARG(6, arg6)
+#define _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
+ _SDT_ASM_OPERANDS_6(arg1, arg2, arg3, arg4, arg5, arg6), _SDT_ARG(7, arg7)
+#define _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
+ _SDT_ASM_OPERANDS_7(arg1, arg2, arg3, arg4, arg5, arg6, arg7), \
+ _SDT_ARG(8, arg8)
+#define _SDT_ASM_OPERANDS_9(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) \
+ _SDT_ASM_OPERANDS_8(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), \
+ _SDT_ARG(9, arg9)
+#define _SDT_ASM_OPERANDS_10(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
+ _SDT_ASM_OPERANDS_9(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), \
+ _SDT_ARG(10, arg10)
+#define _SDT_ASM_OPERANDS_11(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
+ _SDT_ASM_OPERANDS_10(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10), \
+ _SDT_ARG(11, arg11)
+#define _SDT_ASM_OPERANDS_12(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
+ _SDT_ASM_OPERANDS_11(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11), \
+ _SDT_ARG(12, arg12)
+
+/* These macros can be used in C, C++, or assembly code.
+ In assembly code the arguments should use normal assembly operand syntax. */
+
+#define STAP_PROBE(provider, name) \
+ _SDT_PROBE(provider, name, 0, ())
+#define STAP_PROBE1(provider, name, arg1) \
+ _SDT_PROBE(provider, name, 1, (arg1))
+#define STAP_PROBE2(provider, name, arg1, arg2) \
+ _SDT_PROBE(provider, name, 2, (arg1, arg2))
+#define STAP_PROBE3(provider, name, arg1, arg2, arg3) \
+ _SDT_PROBE(provider, name, 3, (arg1, arg2, arg3))
+#define STAP_PROBE4(provider, name, arg1, arg2, arg3, arg4) \
+ _SDT_PROBE(provider, name, 4, (arg1, arg2, arg3, arg4))
+#define STAP_PROBE5(provider, name, arg1, arg2, arg3, arg4, arg5) \
+ _SDT_PROBE(provider, name, 5, (arg1, arg2, arg3, arg4, arg5))
+#define STAP_PROBE6(provider, name, arg1, arg2, arg3, arg4, arg5, arg6) \
+ _SDT_PROBE(provider, name, 6, (arg1, arg2, arg3, arg4, arg5, arg6))
+#define STAP_PROBE7(provider, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
+ _SDT_PROBE(provider, name, 7, (arg1, arg2, arg3, arg4, arg5, arg6, arg7))
+#define STAP_PROBE8(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) \
+ _SDT_PROBE(provider, name, 8, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
+#define STAP_PROBE9(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)\
+ _SDT_PROBE(provider, name, 9, (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9))
+#define STAP_PROBE10(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10) \
+ _SDT_PROBE(provider, name, 10, \
+ (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10))
+#define STAP_PROBE11(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11) \
+ _SDT_PROBE(provider, name, 11, \
+ (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11))
+#define STAP_PROBE12(provider,name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12) \
+ _SDT_PROBE(provider, name, 12, \
+ (arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12))
+
+/* This STAP_PROBEV macro can be used in variadic scenarios, where the
+ number of probe arguments is not known until compile time. Since
+ variadic macro support may vary with compiler options, you must
+ pre-#define SDT_USE_VARIADIC to enable this type of probe.
+
+ The trick to count __VA_ARGS__ was inspired by this post by
+ Laurent Deniau <laurent.deniau@cern.ch>:
+ http://groups.google.com/group/comp.std.c/msg/346fc464319b1ee5
+
+ Note that our _SDT_NARG is called with an extra 0 arg that's not
+ counted, so we don't have to worry about the behavior of macros
+ called without any arguments. */
+
+#ifdef SDT_USE_VARIADIC
+#define _SDT_NARG(...) __SDT_NARG(__VA_ARGS__, 12,11,10,9,8,7,6,5,4,3,2,1,0)
+#define __SDT_NARG(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, N, ...) N
+#define _SDT_PROBE_N(provider, name, N, ...) \
+ _SDT_PROBE(provider, name, N, (__VA_ARGS__))
+#define STAP_PROBEV(provider, name, ...) \
+ _SDT_PROBE_N(provider, name, _SDT_NARG(0, ##__VA_ARGS__), ##__VA_ARGS__)
+#endif
+
+/* These macros are for use in asm statements. You must compile
+ with -std=gnu99 or -std=c99 to use the STAP_PROBE_ASM macro.
+
+ The STAP_PROBE_ASM macro generates a quoted string to be used in the
+ template portion of the asm statement, concatenated with strings that
+ contain the actual assembly code around the probe site.
+
+ For example:
+
+ asm ("before\n"
+ STAP_PROBE_ASM(provider, fooprobe, %eax 4(%esi))
+ "after");
+
+ emits the assembly code for "before\nafter", with a probe in between.
+ The probe arguments are the %eax register, and the value of the memory
+ word located 4 bytes past the address in the %esi register. Note that
+ because this is a simple asm, not a GNU C extended asm statement, these
+ % characters do not need to be doubled to generate literal %reg names.
+
+ In a GNU C extended asm statement, the probe arguments can be specified
+ using the macro STAP_PROBE_ASM_TEMPLATE(n) for n arguments. The paired
+ macro STAP_PROBE_ASM_OPERANDS gives the C values of these probe arguments,
+ and appears in the input operand list of the asm statement. For example:
+
+ asm ("someinsn %0,%1\n" // %0 is output operand, %1 is input operand
+ STAP_PROBE_ASM(provider, fooprobe, STAP_PROBE_ASM_TEMPLATE(3))
+ "otherinsn %[namedarg]"
+ : "r" (outvar)
+ : "g" (some_value), [namedarg] "i" (1234),
+ STAP_PROBE_ASM_OPERANDS(3, some_value, some_ptr->field, 1234));
+
+ This is just like writing:
+
+ STAP_PROBE3(provider, fooprobe, some_value, some_ptr->field, 1234));
+
+ but the probe site is right between "someinsn" and "otherinsn".
+
+ The probe arguments in STAP_PROBE_ASM can be given as assembly
+ operands instead, even inside a GNU C extended asm statement.
+ Note that these can use operand templates like %0 or %[name],
+ and likewise they must write %%reg for a literal operand of %reg. */
+
+#if __STDC_VERSION__ >= 199901L
+# define STAP_PROBE_ASM(provider, name, ...) \
+ _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (__VA_ARGS__)) \
+ _SDT_ASM_BASE
+# define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__)
+#else
+# define STAP_PROBE_ASM(provider, name, args) \
+ _SDT_ASM_BODY(provider, name, _SDT_ASM_STRING, (args)) \
+ _SDT_ASM_BASE
+#endif
+#define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n
+
+
+/* DTrace compatible macro names. */
+#define DTRACE_PROBE(provider,probe) \
+ STAP_PROBE(provider,probe)
+#define DTRACE_PROBE1(provider,probe,parm1) \
+ STAP_PROBE1(provider,probe,parm1)
+#define DTRACE_PROBE2(provider,probe,parm1,parm2) \
+ STAP_PROBE2(provider,probe,parm1,parm2)
+#define DTRACE_PROBE3(provider,probe,parm1,parm2,parm3) \
+ STAP_PROBE3(provider,probe,parm1,parm2,parm3)
+#define DTRACE_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \
+ STAP_PROBE4(provider,probe,parm1,parm2,parm3,parm4)
+#define DTRACE_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \
+ STAP_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5)
+#define DTRACE_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) \
+ STAP_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6)
+#define DTRACE_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \
+ STAP_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7)
+#define DTRACE_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \
+ STAP_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8)
+#define DTRACE_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \
+ STAP_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9)
+#define DTRACE_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \
+ STAP_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10)
+#define DTRACE_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11) \
+ STAP_PROBE11(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11)
+#define DTRACE_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11,parm12) \
+ STAP_PROBE12(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10,parm11,parm12)
+
+
+#endif /* sys/sdt.h */