From 472f4aaf566d1305147c46c79836ac939f71db51 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 28 Jul 2008 10:13:25 -0400 Subject: [PATCH] glibc uses regparms for internal functions on i386. Signed-off-by: Anders Kaseorg --- configure.ac | 8 ++++++++ nsswitch-internal.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/configure.ac b/configure.ac index 28790a1..5940f39 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,5 @@ AC_INIT([nss_nonlocal], [1.7], [andersk@mit.edu]) +AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PREFIX_DEFAULT([/]) @@ -7,6 +8,13 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL +case "$target_cpu" in + i386 | i486 | i586 | i686 | i786) + AC_DEFINE([USE_REGPARMS], [], + [Define if the regparm attribute shall be used for local functions (gcc on ix86 only).]) + ;; +esac + AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/nsswitch-internal.h b/nsswitch-internal.h index 54c4f3c..3d064a8 100644 --- a/nsswitch-internal.h +++ b/nsswitch-internal.h @@ -6,6 +6,15 @@ #ifndef NSSWITCH_INTERNAL_H #define NSSWITCH_INTERNAL_H +#include "config.h" + +/* glibc/config.h.in */ +#if defined USE_REGPARMS && !defined PROF && !defined __BOUNDED_POINTERS__ +# define internal_function __attribute__ ((regparm (3), stdcall)) +#else +# define internal_function +#endif + /* glibc/nss/nsswitch.h */ typedef struct service_user service_user; -- 2.45.0