From 425ce2edb9d11cc1ff650fac16dfbc450241896a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 13 Mar 2009 23:53:18 +0000 Subject: * config.h.in (USE_MULTIARCH): Define. * configure.in: Handle --enable-multi-arch. * elf/dl-runtime.c (_dl_fixup): Handle STT_GNU_IFUNC. (_dl_fixup_profile): Likewise. * elf/do-lookup.c (dl_lookup_x): Likewise. * sysdeps/x86_64/dl-machine.h: Handle STT_GNU_IFUNC. * elf/elf.h (STT_GNU_IFUNC): Define. * include/libc-symbols.h (libc_ifunc): Define. * sysdeps/x86_64/cacheinfo.c: If USE_MULTIARCH is defined, use the framework in init-arch.h to get CPUID values. * sysdeps/x86_64/multiarch/Makefile: New file. * sysdeps/x86_64/multiarch/init-arch.c: New file. * sysdeps/x86_64/multiarch/init-arch.h: New file. * sysdeps/x86_64/multiarch/sched_cpucount.c: New file. * config.make.in (experimental-malloc): Define. * configure.in: Handle --enable-experimental-malloc. * malloc/Makefile: Handle experimental-malloc flag. * malloc/malloc.c: Implement PER_THREAD and ATOMIC_FASTBINS features. * malloc/arena.c: Likewise. * malloc/hooks.c: Likewise. * malloc/malloc.h: Define M_ARENA_TEST and M_ARENA_MAX. --- configure | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 4 deletions(-) (limited to 'configure') diff --git a/configure b/configure index c5c6dc4789..69af8525be 100755 --- a/configure +++ b/configure @@ -660,6 +660,8 @@ oldest_abi bindnow force_install all_warnings +multi_arch +experimental_malloc build build_cpu build_vendor @@ -1380,6 +1382,10 @@ Optional Features: --enable-kernel=VERSION compile for compatibility with kernel not older than VERSION --enable-all-warnings enable all useful warnings gcc can issue + --enable-multi-arch enable single DSO with optimizations for multiple + architectures + --enable-experimental-malloc + enable experimental malloc features Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2173,6 +2179,29 @@ fi +# Check whether --enable-multi-arch was given. +if test "${enable_multi_arch+set}" = set; then + enableval=$enable_multi_arch; multi_arch=$enableval +else + multi_arch=no +fi + +if test x"$multi_arch" = xyes; then + cat >>confdefs.h <<\_ACEOF +#define USE_MULTIARCH 1 +_ACEOF + + multi_arch_d=/multiarch +fi + + +# Check whether --enable-experimental-malloc was given. +if test "${enable_experimental_malloc+set}" = set; then + enableval=$enable_experimental_malloc; experimental_malloc=$enableval +fi + + + # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 @@ -2627,7 +2656,7 @@ for b in $base ''; do test "$v" = / && continue for o in /$ostry ''; do test "$o" = / && continue - for m in $mach ''; do + for m in $multi_arch_d $mach ''; do for d in $add_ons_pfx ''; do for a in $add_ons_sfx ''; do if test -n "$m0$m0sub$b$v$o$m$msub"; then @@ -5684,6 +5713,37 @@ _ACEOF fi +# For the multi-arch option we need support in the assembler. +if test "$multi_arch" = yes; then + if test "x$libc_cv_asm_type_prefix" != xno; then +{ echo "$as_me:$LINENO: checking for assembler gnu_indirect_function symbol type support" >&5 +echo $ECHO_N "checking for assembler gnu_indirect_function symbol type support... $ECHO_C" >&6; } +if test "${libc_cv_asm_gnu_indirect_function+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat > conftest.s <&5 2>&5; +then + libc_cv_asm_gnu_indirect_function=yes +else + libc_cv_asm_gnu_indirect_function=no +fi +rm -f conftest* +fi +{ echo "$as_me:$LINENO: result: $libc_cv_asm_gnu_indirect_function" >&5 +echo "${ECHO_T}$libc_cv_asm_gnu_indirect_function" >&6; } + else + libc_cv_asm_gnu_indirect_function=no + fi + if test x"$libc_cv_asm_gnu_indirect_function" != xyes; then + { { echo "$as_me:$LINENO: error: --enable-multi-arch support requires assembler and linker support" >&5 +echo "$as_me: error: --enable-multi-arch support requires assembler and linker support" >&2;} + { (exit 1); exit 1; }; } + fi +fi + { echo "$as_me:$LINENO: checking for .symver assembler directive" >&5 echo $ECHO_N "checking for .symver assembler directive... $ECHO_C" >&6; } if test "${libc_cv_asm_symver_directive+set}" = set; then @@ -9184,6 +9244,8 @@ oldest_abi!$oldest_abi$ac_delim bindnow!$bindnow$ac_delim force_install!$force_install$ac_delim all_warnings!$all_warnings$ac_delim +multi_arch!$multi_arch$ac_delim +experimental_malloc!$experimental_malloc$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim @@ -9235,8 +9297,6 @@ libc_cv_have_bash2!$libc_cv_have_bash2$ac_delim KSH!$KSH$ac_delim libc_cv_have_ksh!$libc_cv_have_ksh$ac_delim AWK!$AWK$ac_delim -PERL!$PERL$ac_delim -INSTALL_INFO!$INSTALL_INFO$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -9278,6 +9338,8 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +PERL!$PERL$ac_delim +INSTALL_INFO!$INSTALL_INFO$ac_delim BISON!$BISON$ac_delim VERSIONING!$VERSIONING$ac_delim libc_cv_cc_with_libunwind!$libc_cv_cc_with_libunwind$ac_delim @@ -9334,7 +9396,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 56; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -- cgit v1.2.1