From: Roland McGrath Date: Thu, 15 Aug 2002 07:02:19 +0000 (+0000) Subject: * locale/locarchive.h (struct locale_category_data): Give this name to X-Git-Tag: upstream/2.30~21429 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac8f8c53f04f2aaf204f559bdaf8af43952f0273;p=external%2Fglibc.git * locale/locarchive.h (struct locale_category_data): Give this name to the type of locale_data_t's elements. * locale/programs/locarchive.c (cmpcategorysize): New static function. (add_locale): Use that to sort the categories by size and put all those that fit into two pages into the LC_ALL block, instead of hard-coding it to do everything but LC_CTYPE and LC_COLLATE. (show_archive_content): Detect categories inside LC_ALL block directly, instead of hard-coding. 2002-08-14 Jakub Jelinek * locale/programs/locarchive.c (struct oldlocrecent): New. (oldlocrecentcmp): New. (enlarge_archive): Re-add locales in the order they were added to the archive. (add_locale): Put all the small locale files together, if the small locale file block would occupy less pages if page size aligned, align it. (show_archive_content): Adjust for locale archives optimized for speed. 2002-08-14 Roland McGrath * configure.in: Use "MISSING" as not-found value for MIG. * sysdeps/mach/configure.in: Fatal if mig not found. * configure, sysdeps/mach/configure: Regenerated. --- diff --git a/ChangeLog b/ChangeLog index 3949d11..ebfadb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2002-08-14 Roland McGrath + + * locale/locarchive.h (struct locale_category_data): Give this name to + the type of locale_data_t's elements. + * locale/programs/locarchive.c (cmpcategorysize): New static function. + (add_locale): Use that to sort the categories by size and put all + those that fit into two pages into the LC_ALL block, instead of + hard-coding it to do everything but LC_CTYPE and LC_COLLATE. + (show_archive_content): Detect categories inside LC_ALL block + directly, instead of hard-coding. + +2002-08-14 Jakub Jelinek + + * locale/programs/locarchive.c (struct oldlocrecent): New. + (oldlocrecentcmp): New. + (enlarge_archive): Re-add locales in the order they were added + to the archive. + (add_locale): Put all the small locale files together, if the small + locale file block would occupy less pages if page size aligned, align + it. + (show_archive_content): Adjust for locale archives optimized for speed. + +2002-08-14 Roland McGrath + + * configure.in: Use "MISSING" as not-found value for MIG. + * sysdeps/mach/configure.in: Fatal if mig not found. + * configure, sysdeps/mach/configure: Regenerated. + 2002-08-13 Jakub Jelinek * locale/loadarchive.c (archfname): Add missing slash. diff --git a/configure b/configure index 4d33b8d..830627b 100755 --- a/configure +++ b/configure @@ -2071,7 +2071,6 @@ else fi done IFS="$ac_save_ifs" - test -z "$ac_cv_prog_MIG" && ac_cv_prog_MIG="mig" fi fi MIG="$ac_cv_prog_MIG" @@ -2082,6 +2081,42 @@ else fi +if test -z "$ac_cv_prog_MIG"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "mig", so it can be a program name with args. +set dummy mig; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2090: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$MIG"; then + ac_cv_prog_MIG="$MIG" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_MIG="mig" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_MIG" && ac_cv_prog_MIG="MISSING" +fi +fi +MIG="$ac_cv_prog_MIG" +if test -n "$MIG"; then + echo "$ac_t""$MIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + MIG="MISSING" +fi +fi # Accept binutils 2.10.1 or newer (and also any ia64 2.9 version) @@ -2111,7 +2146,7 @@ fi # check if ranlib is necessary echo $ac_n "checking whether ranlib is necessary""... $ac_c" 1>&6 -echo "configure:2115: checking whether ranlib is necessary" >&5 +echo "configure:2150: checking whether ranlib is necessary" >&5 if eval "test \"`echo '$''{'libc_cv_ranlib_necessary'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2145,7 +2180,7 @@ fi # - two terminals occur directly after each other # - the path contains an element with a dot in it echo $ac_n "checking LD_LIBRARY_PATH variable""... $ac_c" 1>&6 -echo "configure:2149: checking LD_LIBRARY_PATH variable" >&5 +echo "configure:2184: checking LD_LIBRARY_PATH variable" >&5 case ${LD_LIBRARY_PATH} in [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* ) ld_library_path_setting="contains current directory" @@ -2163,7 +2198,7 @@ if test "$ld_library_path_setting" != "ok"; then fi echo $ac_n "checking whether GCC supports -static-libgcc""... $ac_c" 1>&6 -echo "configure:2167: checking whether GCC supports -static-libgcc" >&5 +echo "configure:2202: checking whether GCC supports -static-libgcc" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_static_libgcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2180,7 +2215,7 @@ echo "$ac_t""$libc_cv_gcc_static_libgcc" 1>&6 # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2184: checking for $ac_word" >&5 +echo "configure:2219: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2226,7 +2261,7 @@ if test "$BASH" = no; then # Extract the first word of "ksh", so it can be a program name with args. set dummy ksh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2230: checking for $ac_word" >&5 +echo "configure:2265: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2276,7 +2311,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2280: checking for $ac_word" >&5 +echo "configure:2315: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2308,7 +2343,7 @@ done # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2312: checking for $ac_word" >&5 +echo "configure:2347: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2348,7 +2383,7 @@ fi # Extract the first word of "install-info", so it can be a program name with args. set dummy install-info; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2352: checking for $ac_word" >&5 +echo "configure:2387: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_INSTALL_INFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2383,7 +2418,7 @@ fi if test "$INSTALL_INFO" != "no"; then echo $ac_n "checking for old Debian install-info""... $ac_c" 1>&6 -echo "configure:2387: checking for old Debian install-info" >&5 +echo "configure:2422: checking for old Debian install-info" >&5 if eval "test \"`echo '$''{'libc_cv_old_debian_install_info'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2418,7 +2453,7 @@ fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2422: checking for $ac_word" >&5 +echo "configure:2457: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2453,7 +2488,7 @@ fi echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6 -echo "configure:2457: checking for signed size_t type" >&5 +echo "configure:2492: checking for signed size_t type" >&5 if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2477,12 +2512,12 @@ EOF fi echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6 -echo "configure:2481: checking for libc-friendly stddef.h" >&5 +echo "configure:2516: checking for libc-friendly stddef.h" >&5 if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_friendly_stddef=yes else @@ -2516,7 +2551,7 @@ override stddef.h = # The installed seems to be libc-friendly." fi echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6 -echo "configure:2520: checking whether we need to use -P to assemble .S files" >&5 +echo "configure:2555: checking whether we need to use -P to assemble .S files" >&5 if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2539,7 +2574,7 @@ asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives." fi echo $ac_n "checking whether .text pseudo-op must be used""... $ac_c" 1>&6 -echo "configure:2543: checking whether .text pseudo-op must be used" >&5 +echo "configure:2578: checking whether .text pseudo-op must be used" >&5 if eval "test \"`echo '$''{'libc_cv_dot_text'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2560,7 +2595,7 @@ else fi echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6 -echo "configure:2564: checking for assembler global-symbol directive" >&5 +echo "configure:2599: checking for assembler global-symbol directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2590,7 +2625,7 @@ EOF fi echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6 -echo "configure:2594: checking for .set assembler directive" >&5 +echo "configure:2629: checking for .set assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2633,7 +2668,7 @@ EOF esac echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6 -echo "configure:2637: checking for .symver assembler directive" >&5 +echo "configure:2672: checking for .symver assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2652,7 +2687,7 @@ fi echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6 echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6 -echo "configure:2656: checking for ld --version-script" >&5 +echo "configure:2691: checking for ld --version-script" >&5 if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2675,7 +2710,7 @@ EOF if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o -nostartfiles -nostdlib -Wl,--version-script,conftest.map - 1>&5'; { (eval echo configure:2679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; + 1>&5'; { (eval echo configure:2714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_ld_version_script_option=yes else @@ -2714,7 +2749,7 @@ if test $elf = yes && test $shared != no && test $VERSIONING = no; then fi if test $elf = yes; then echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6 -echo "configure:2718: checking for .previous assembler directive" >&5 +echo "configure:2753: checking for .previous assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2722,7 +2757,7 @@ else .section foo_section .previous EOF - if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_asm_previous_directive=yes else libc_cv_asm_previous_directive=no @@ -2738,7 +2773,7 @@ EOF else echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6 -echo "configure:2742: checking for .popsection assembler directive" >&5 +echo "configure:2777: checking for .popsection assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2746,7 +2781,7 @@ else .pushsection foo_section .popsection EOF - if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_asm_popsection_directive=yes else libc_cv_asm_popsection_directive=no @@ -2763,7 +2798,7 @@ EOF fi fi echo $ac_n "checking for .protected and .hidden assembler directive""... $ac_c" 1>&6 -echo "configure:2767: checking for .protected and .hidden assembler directive" >&5 +echo "configure:2802: checking for .protected and .hidden assembler directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_protected_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2773,7 +2808,7 @@ foo: .hidden bar bar: EOF - if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_asm_protected_directive=yes else libc_cv_asm_protected_directive=no @@ -2794,7 +2829,7 @@ EOF if test $libc_cv_asm_protected_directive = yes; then echo $ac_n "checking whether __attribute__((visibility())) is supported""... $ac_c" 1>&6 -echo "configure:2798: checking whether __attribute__((visibility())) is supported" >&5 +echo "configure:2833: checking whether __attribute__((visibility())) is supported" >&5 if eval "test \"`echo '$''{'libc_cv_visibility_attribute'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2825,7 +2860,7 @@ EOF if test $libc_cv_visibility_attribute = yes; then echo $ac_n "checking for broken __attribute__((visibility()))""... $ac_c" 1>&6 -echo "configure:2829: checking for broken __attribute__((visibility()))" >&5 +echo "configure:2864: checking for broken __attribute__((visibility()))" >&5 if eval "test \"`echo '$''{'libc_cv_broken_visibility_attribute'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2854,7 +2889,7 @@ EOF fi echo $ac_n "checking for broken __attribute__((alias()))""... $ac_c" 1>&6 -echo "configure:2858: checking for broken __attribute__((alias()))" >&5 +echo "configure:2893: checking for broken __attribute__((alias()))" >&5 if eval "test \"`echo '$''{'libc_cv_broken_alias_attribute'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2887,7 +2922,7 @@ EOF if test $libc_cv_visibility_attribute = yes -a $gnu_ld = yes; then echo $ac_n "checking whether to put _rtld_local into .sdata section""... $ac_c" 1>&6 -echo "configure:2891: checking whether to put _rtld_local into .sdata section" >&5 +echo "configure:2926: checking whether to put _rtld_local into .sdata section" >&5 if eval "test \"`echo '$''{'libc_cv_have_sdata_section'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2911,7 +2946,7 @@ EOF fi echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6 -echo "configure:2915: checking for .preinit_array/.init_array/.fini_array support" >&5 +echo "configure:2950: checking for .preinit_array/.init_array/.fini_array support" >&5 if eval "test \"`echo '$''{'libc_cv_initfinit_array'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2922,7 +2957,7 @@ int foo (void) { return 1; } int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; EOF if { ac_try='${CC-cc} -o conftest conftest.c - -static -nostartfiles -nostdlib 1>&5'; { (eval echo configure:2926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + -static -nostartfiles -nostdlib 1>&5'; { (eval echo configure:2961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then if readelf -S conftest | fgrep INIT_ARRAY > /dev/null; then libc_cv_initfinit_array=yes @@ -2945,7 +2980,7 @@ EOF fi echo $ac_n "checking for -z nodelete option""... $ac_c" 1>&6 -echo "configure:2949: checking for -z nodelete option" >&5 +echo "configure:2984: checking for -z nodelete option" >&5 if eval "test \"`echo '$''{'libc_cv_z_nodelete'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2954,7 +2989,7 @@ int _start (void) { return 42; } EOF if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -nostartfiles -nostdlib - -Wl,--enable-new-dtags,-z,nodelete 1>&5'; { (eval echo configure:2958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + -Wl,--enable-new-dtags,-z,nodelete 1>&5'; { (eval echo configure:2993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then libc_cv_z_nodelete=yes else @@ -2967,7 +3002,7 @@ echo "$ac_t""$libc_cv_z_nodelete" 1>&6 echo $ac_n "checking for -z nodlopen option""... $ac_c" 1>&6 -echo "configure:2971: checking for -z nodlopen option" >&5 +echo "configure:3006: checking for -z nodlopen option" >&5 if eval "test \"`echo '$''{'libc_cv_z_nodlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2976,7 +3011,7 @@ int _start (void) { return 42; } EOF if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -nostartfiles -nostdlib - -Wl,--enable-new-dtags,-z,nodlopen 1>&5'; { (eval echo configure:2980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + -Wl,--enable-new-dtags,-z,nodlopen 1>&5'; { (eval echo configure:3015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then libc_cv_z_nodlopen=yes else @@ -2989,7 +3024,7 @@ echo "$ac_t""$libc_cv_z_nodlopen" 1>&6 echo $ac_n "checking for -z initfirst option""... $ac_c" 1>&6 -echo "configure:2993: checking for -z initfirst option" >&5 +echo "configure:3028: checking for -z initfirst option" >&5 if eval "test \"`echo '$''{'libc_cv_z_initfirst'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2998,7 +3033,7 @@ int _start (void) { return 42; } EOF if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -nostartfiles -nostdlib - -Wl,--enable-new-dtags,-z,initfirst 1>&5'; { (eval echo configure:3002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + -Wl,--enable-new-dtags,-z,initfirst 1>&5'; { (eval echo configure:3037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then libc_cv_z_initfirst=yes else @@ -3011,14 +3046,14 @@ echo "$ac_t""$libc_cv_z_initfirst" 1>&6 echo $ac_n "checking for -Bgroup option""... $ac_c" 1>&6 -echo "configure:3015: checking for -Bgroup option" >&5 +echo "configure:3050: checking for -Bgroup option" >&5 if eval "test \"`echo '$''{'libc_cv_Bgroup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } + if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -Wl,-Bgroup -nostdlib 1>&5'; { (eval echo configure:3057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then libc_cv_Bgroup=yes else @@ -3031,7 +3066,7 @@ echo "$ac_t""$libc_cv_Bgroup" 1>&6 echo $ac_n "checking for -z combreloc""... $ac_c" 1>&6 -echo "configure:3035: checking for -z combreloc" >&5 +echo "configure:3070: checking for -z combreloc" >&5 if eval "test \"`echo '$''{'libc_cv_z_combreloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3042,7 +3077,7 @@ int foo (void) { return bar (mumble); } EOF if { ac_try='${CC-cc} -shared -o conftest.so conftest.c -nostdlib -nostartfiles - -Wl,-z,combreloc 1>&5'; { (eval echo configure:3046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } + -Wl,-z,combreloc 1>&5'; { (eval echo configure:3081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } then if readelf -S conftest.so | grep '\.rel\(a\|\)\.dyn' > /dev/null; then libc_cv_z_combreloc=yes @@ -3067,12 +3102,12 @@ fi if test $elf != yes; then echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6 -echo "configure:3071: checking for .init and .fini sections" >&5 +echo "configure:3106: checking for .init and .fini sections" >&5 if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_have_initfini=yes else @@ -3104,7 +3139,7 @@ fi if test $elf = yes -a $gnu_ld = yes; then echo $ac_n "checking whether cc puts quotes around section names""... $ac_c" 1>&6 -echo "configure:3108: checking whether cc puts quotes around section names" >&5 +echo "configure:3143: checking whether cc puts quotes around section names" >&5 if eval "test \"`echo '$''{'libc_cv_have_section_quotes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3141,19 +3176,19 @@ if test $elf = yes; then else if test $ac_cv_prog_cc_works = yes; then echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6 -echo "configure:3145: checking for _ prefix on C symbol names" >&5 +echo "configure:3180: checking for _ prefix on C symbol names" >&5 if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* libc_cv_asm_underscores=yes else @@ -3168,17 +3203,17 @@ fi echo "$ac_t""$libc_cv_asm_underscores" 1>&6 else echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6 -echo "configure:3172: checking for _ prefix on C symbol names" >&5 +echo "configure:3207: checking for _ prefix on C symbol names" >&5 if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if grep _underscore_test conftest* >/dev/null; then rm -f conftest* libc_cv_asm_underscores=yes @@ -3210,7 +3245,7 @@ if test $elf = yes; then fi echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6 -echo "configure:3214: checking for assembler .weak directive" >&5 +echo "configure:3249: checking for assembler .weak directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3233,7 +3268,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6 if test $libc_cv_asm_weak_directive = no; then echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6 -echo "configure:3237: checking for assembler .weakext directive" >&5 +echo "configure:3272: checking for assembler .weakext directive" >&5 if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3280,14 +3315,14 @@ EOF ;; hppa*linux*) echo $ac_n "checking for assembler line separator""... $ac_c" 1>&6 -echo "configure:3284: checking for assembler line separator" >&5 +echo "configure:3319: checking for assembler line separator" >&5 if eval "test \"`echo '$''{'libc_cv_asm_line_sep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.s <&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:3326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_asm_line_sep='!' else if test -z "$enable_hacker_mode"; then @@ -3309,7 +3344,7 @@ EOF esac echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6 -echo "configure:3313: checking for ld --no-whole-archive" >&5 +echo "configure:3348: checking for ld --no-whole-archive" >&5 if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3320,7 +3355,7 @@ __throw () {} EOF if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles -Wl,--no-whole-archive - -o conftest conftest.c 1>&5'; { (eval echo configure:3324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c 1>&5'; { (eval echo configure:3359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_ld_no_whole_archive=yes else libc_cv_ld_no_whole_archive=no @@ -3334,7 +3369,7 @@ if test $libc_cv_ld_no_whole_archive = yes; then fi echo $ac_n "checking for gcc -fexceptions""... $ac_c" 1>&6 -echo "configure:3338: checking for gcc -fexceptions" >&5 +echo "configure:3373: checking for gcc -fexceptions" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_exceptions'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3345,7 +3380,7 @@ __throw () {} EOF if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles -fexceptions - -o conftest conftest.c 1>&5'; { (eval echo configure:3349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c 1>&5'; { (eval echo configure:3384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_exceptions=yes else libc_cv_gcc_exceptions=no @@ -3360,14 +3395,14 @@ fi if test "$base_machine" = alpha ; then echo $ac_n "checking for function ..ng prefix""... $ac_c" 1>&6 -echo "configure:3364: checking for function ..ng prefix" >&5 +echo "configure:3399: checking for function ..ng prefix" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_alpha_ng_prefix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <<\EOF foo () { } EOF -if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:3371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; +if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:3406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_alpha_ng_prefix=yes else @@ -3394,19 +3429,19 @@ if test "$host_cpu" = powerpc ; then # Check for a bug present in at least versions 2.8.x of GCC # and versions 1.0.x of EGCS. echo $ac_n "checking whether clobbering cr0 causes problems""... $ac_c" 1>&6 -echo "configure:3398: checking whether clobbering cr0 causes problems" >&5 +echo "configure:3433: checking whether clobbering cr0 causes problems" >&5 if eval "test \"`echo '$''{'libc_cv_c_asmcr0_bug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_c_asmcr0_bug='no' else @@ -3428,12 +3463,12 @@ fi fi echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6 -echo "configure:3432: checking for DWARF2 unwind info support" >&5 +echo "configure:3467: checking for DWARF2 unwind info support" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_dwarf2_unwind_info=static else libc_cv_gcc_dwarf2_unwind_info=no fi if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles - -o conftest conftest.c -lgcc -lgcc_eh >&5'; { (eval echo configure:3471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc -lgcc_eh >&5'; { (eval echo configure:3506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then if ${CC-cc} $CFLAGS -DCHECK__register_frame_info -nostdlib -nostartfiles \ -o conftest conftest.c -lgcc -lgcc_eh -v 2>&1 >/dev/null \ | grep -q -- --eh-frame-hdr; then @@ -3481,7 +3516,7 @@ fi if test $libc_cv_gcc_dwarf2_unwind_info = no; then if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame -nostdlib -nostartfiles - -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_dwarf2_unwind_info=yes else libc_cv_gcc_dwarf2_unwind_info=no @@ -3511,12 +3546,12 @@ EOF esac echo $ac_n "checking for __builtin_expect""... $ac_c" 1>&6 -echo "configure:3515: checking for __builtin_expect" >&5 +echo "configure:3550: checking for __builtin_expect" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_builtin_expect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_builtin_expect=yes else libc_cv_gcc_builtin_expect=no @@ -3541,7 +3576,7 @@ EOF fi echo $ac_n "checking for __builtin_memset""... $ac_c" 1>&6 -echo "configure:3545: checking for __builtin_memset" >&5 +echo "configure:3580: checking for __builtin_memset" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_builtin_memset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3551,7 +3586,7 @@ void zero (void *x) __builtin_memset (x, 0, 1000); } EOF -if { ac_try='${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null'; { (eval echo configure:3555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; +if { ac_try='${CC-cc} -O3 -S conftest.c -o - | fgrep "memset" > /dev/null'; { (eval echo configure:3590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_builtin_memset=no else @@ -3569,12 +3604,12 @@ EOF fi echo $ac_n "checking for local label subtraction""... $ac_c" 1>&6 -echo "configure:3573: checking for local label subtraction" >&5 +echo "configure:3608: checking for local label subtraction" >&5 if eval "test \"`echo '$''{'libc_cv_gcc_subtract_local_labels'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; }; then + -o conftest conftest.c -lgcc >&5'; { (eval echo configure:3626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc_subtract_local_labels=yes else libc_cv_gcc_subtract_local_labels=no @@ -3604,14 +3639,14 @@ EOF fi echo $ac_n "checking for __thread""... $ac_c" 1>&6 -echo "configure:3608: checking for __thread" >&5 +echo "configure:3643: checking for __thread" >&5 if eval "test \"`echo '$''{'libc_cv_gcc___thread'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.c <&5; (eval $ac_try) 2>&5; }; }; then +if { ac_try='${CC-cc} $CFLAGS -c conftest.c >&5'; { (eval echo configure:3650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then libc_cv_gcc___thread=yes else libc_cv_gcc___thread=no @@ -3629,7 +3664,7 @@ fi echo $ac_n "checking for libgd""... $ac_c" 1>&6 -echo "configure:3633: checking for libgd" >&5 +echo "configure:3668: checking for libgd" >&5 if test "$with_gd" != "no"; then old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $libgd_include" @@ -3638,14 +3673,14 @@ if test "$with_gd" != "no"; then old_LIBS="$LIBS" LIBS="$LIBS -lgd -lpng -lz -lm" cat > conftest.$ac_ext < int main() { gdImagePng (0, 0) ; return 0; } EOF -if { (eval echo configure:3649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBGD=yes else @@ -3665,7 +3700,7 @@ echo "$ac_t""$LIBGD" 1>&6 echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:3669: checking size of long double" >&5 +echo "configure:3704: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3673,7 +3708,7 @@ else ac_cv_sizeof_long_double=0 else cat > conftest.$ac_ext < int main() @@ -3684,7 +3719,7 @@ int main() return(0); } EOF -if { (eval echo configure:3688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_double=`cat conftestval` else @@ -3762,7 +3797,7 @@ if test "$uname" = "sysdeps/generic"; then fi echo $ac_n "checking OS release for uname""... $ac_c" 1>&6 -echo "configure:3766: checking OS release for uname" >&5 +echo "configure:3801: checking OS release for uname" >&5 if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3784,7 +3819,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6 uname_release="$libc_cv_uname_release" echo $ac_n "checking OS version for uname""... $ac_c" 1>&6 -echo "configure:3788: checking OS version for uname" >&5 +echo "configure:3823: checking OS version for uname" >&5 if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3813,7 +3848,7 @@ EOF # Test for old glibc 2.0.x headers so that they can be removed properly # Search only in includedir. echo $ac_n "checking for old glibc 2.0.x headers""... $ac_c" 1>&6 -echo "configure:3817: checking for old glibc 2.0.x headers" >&5 +echo "configure:3852: checking for old glibc 2.0.x headers" >&5 if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h" then old_glibc_headers=yes @@ -3874,7 +3909,7 @@ if test $shared = default; then fi echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6 -echo "configure:3878: checking whether -fPIC is default" >&5 +echo "configure:3913: checking whether -fPIC is default" >&5 if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff --git a/configure.in b/configure.in index 808e52b..cf4927c 100644 --- a/configure.in +++ b/configure.in @@ -614,7 +614,7 @@ fi AC_SUBST(cross_compiling) AC_PROG_CPP LIBC_PROG_BINUTILS -AC_CHECK_TOOL(MIG, mig) +AC_CHECK_TOOL(MIG, mig, MISSING) # Accept binutils 2.10.1 or newer (and also any ia64 2.9 version) # XXX Commented out because it filters out too many good versions. diff --git a/locale/locarchive.h b/locale/locarchive.h index f43a6b6..e94bc2b 100644 --- a/locale/locarchive.h +++ b/locale/locarchive.h @@ -88,7 +88,7 @@ struct locarhandle /* In memory data for the locales with their checksums. */ -typedef struct +typedef struct locale_category_data { off64_t size; void *addr; diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c index 267d7ba..057fab8 100644 --- a/locale/programs/locarchive.c +++ b/locale/programs/locarchive.c @@ -167,6 +167,46 @@ create_archive (const char *archivefname, struct locarhandle *ah) ah->len = total; } + +struct oldlocrecent +{ + unsigned int cnt; + struct locrecent *locrec; +}; + +static int +oldlocrecentcmp (const void *a, const void *b) +{ + struct locrecent *la = ((const struct oldlocrecent *) a)->locrec; + struct locrecent *lb = ((const struct oldlocrecent *) b)->locrec; + + if (la->record[LC_ALL].offset < lb->record[LC_ALL].offset) + return -1; + if (la->record[LC_ALL].offset > lb->record[LC_ALL].offset) + return 1; + + if (la->record[LC_CTYPE].offset < lb->record[LC_CTYPE].offset) + return -1; + if (la->record[LC_CTYPE].offset > lb->record[LC_CTYPE].offset) + return 1; + + if (la->record[LC_COLLATE].offset < lb->record[LC_COLLATE].offset) + return -1; + if (la->record[LC_COLLATE].offset > lb->record[LC_COLLATE].offset) + return 1; + + if (((const struct oldlocrecent *) a)->cnt + < ((const struct oldlocrecent *) b)->cnt) + return -1; + + if (((const struct oldlocrecent *) a)->cnt + > ((const struct oldlocrecent *) b)->cnt) + return 1; + + return 0; +} + + /* forward decl for below */ static uint32_t add_locale (struct locarhandle *ah, const char *name, locale_data_t data, bool replace); @@ -179,13 +219,14 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) struct locarhead newhead; size_t total; void *p; - unsigned int cnt; + unsigned int cnt, loccnt; struct namehashent *oldnamehashtab; struct locrecent *oldlocrectab; struct locarhandle new_ah; size_t prefix_len = output_prefix ? strlen (output_prefix) : 0; char archivefname[prefix_len + sizeof (ARCHIVE_NAME)]; char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1]; + struct oldlocrecent *oldlocrecarray; if (output_prefix) memcpy (archivefname, output_prefix, prefix_len); @@ -282,34 +323,46 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) + head->namehash_offset); oldlocrectab = (struct locrecent *) ((char *) ah->addr + head->locrectab_offset); - for (cnt = 0; cnt < head->namehash_size; ++cnt) + oldlocrecarray = (struct oldlocrecent *) + alloca (head->namehash_size + * sizeof (struct oldlocrecent)); + + for (cnt = 0, loccnt = 0; cnt < head->namehash_size; ++cnt) if (oldnamehashtab[cnt].locrec_offset != 0) { - /* Insert this entry in the new hash table. */ - locale_data_t old_data; - unsigned int idx; - struct locrecent *oldlocrec; + oldlocrecarray[loccnt].cnt = cnt; + oldlocrecarray[loccnt++].locrec + = (struct locrecent *) ((char *) ah->addr + + oldnamehashtab[cnt].locrec_offset); + } - oldlocrec = (struct locrecent *) ((char *) ah->addr - + oldnamehashtab[cnt].locrec_offset); + qsort (oldlocrecarray, loccnt, sizeof (struct oldlocrecent), + oldlocrecentcmp); - for (idx = 0; idx < __LC_LAST; ++idx) - if (idx != LC_ALL) - { - old_data[idx].size = oldlocrec->record[idx].len; - old_data[idx].addr - = ((char *) ah->addr + oldlocrec->record[idx].offset); + for (cnt = 0; cnt < loccnt; ++cnt) + { + /* Insert this entry in the new hash table. */ + locale_data_t old_data; + unsigned int idx; + struct locrecent *oldlocrec = oldlocrecarray[cnt].locrec; - __md5_buffer (old_data[idx].addr, old_data[idx].size, - old_data[idx].sum); - } + for (idx = 0; idx < __LC_LAST; ++idx) + if (idx != LC_ALL) + { + old_data[idx].size = oldlocrec->record[idx].len; + old_data[idx].addr + = ((char *) ah->addr + oldlocrec->record[idx].offset); - if (add_locale (&new_ah, - ((char *) ah->addr + oldnamehashtab[cnt].name_offset), - old_data, 0) == 0) - error (EXIT_FAILURE, 0, _("cannot extend locale archive file")); - } + __md5_buffer (old_data[idx].addr, old_data[idx].size, + old_data[idx].sum); + } + if (add_locale (&new_ah, + ((char *) ah->addr + + oldnamehashtab[oldlocrecarray[cnt].cnt].name_offset), + old_data, 0) == 0) + error (EXIT_FAILURE, 0, _("cannot extend locale archive file")); + } /* Make the file globally readable. */ if (fchmod (fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) == -1) @@ -487,6 +540,13 @@ insert_name (struct locarhandle *ah, break; } + if (namehashtab[idx].hashval == hval) + { + error (0, 0, "hash collision (%u) %s, %s", + hval, name, (char *) ah->addr + namehashtab[idx].name_offset); + } + + /* Remember the first place we can insert the new entry. */ if (namehashtab[idx].locrec_offset == 0 && insert_idx == -1) insert_idx = idx; @@ -560,6 +620,16 @@ add_alias (struct locarhandle *ah, const char *alias, bool replace, namehashent->locrec_offset = locrec_offset; } +static int /* qsort comparator used below */ +cmpcategorysize (const void *a, const void *b) +{ + if (*(const void **) a == NULL) + return 1; + if (*(const void **) b == NULL) + return -1; + return ((*(const struct locale_category_data **) a)->size + - (*(const struct locale_category_data **) b)->size); +} /* Check the content of the archive for duplicates. Add the content of the files if necessary. Returns the locrec_offset. */ @@ -575,25 +645,70 @@ add_locale (struct locarhandle *ah, unsigned int num_new_offsets = 0; struct sumhashent *sumhashtab; uint32_t hval; - unsigned int cnt; - unsigned int idx; + unsigned int cnt, idx; struct locarhead *head; struct namehashent *namehashent; unsigned int incr; struct locrecent *locrecent; + off64_t lastoffset; + char *ptr; + struct locale_category_data *size_order[__LC_LAST]; + const size_t pagesz = getpagesize (); + int small_mask; head = ah->addr; sumhashtab = (struct sumhashent *) ((char *) ah->addr + head->sumhash_offset); + memset (file_offsets, 0, sizeof (file_offsets)); + + size_order[LC_ALL] = NULL; + for (cnt = 0; cnt < __LC_LAST; ++cnt) + if (cnt != LC_ALL) + size_order[cnt] = &data[cnt]; + + /* Sort the array in ascending order of data size. */ + qsort (size_order, __LC_LAST, sizeof size_order[0], cmpcategorysize); + + small_mask = 0; + data[LC_ALL].size = 0; + for (cnt = 0; cnt < __LC_LAST; ++cnt) + if (size_order[cnt] != NULL) + { + const size_t rounded_size = (size_order[cnt]->size + 15) & -16; + if (data[LC_ALL].size + rounded_size > 2 * pagesz) + { + /* This category makes the small-categories block + stop being small, so this is the end of the road. */ + do + size_order[cnt++] = NULL; + while (cnt < __LC_LAST); + break; + } + data[LC_ALL].size += rounded_size; + small_mask |= 1 << (size_order[cnt] - data); + } + + /* Copy the data for all the small categories into the LC_ALL + pseudo-category. */ + + data[LC_ALL].addr = alloca (data[LC_ALL].size); + memset (data[LC_ALL].addr, 0, data[LC_ALL].size); + + ptr = data[LC_ALL].addr; + for (cnt = 0; cnt < __LC_LAST; ++cnt) + if (small_mask & (1 << cnt)) + { + memcpy (ptr, data[cnt].addr, data[cnt].size); + ptr += (data[cnt].size + 15) & -16; + } + __md5_buffer (data[LC_ALL].addr, data[LC_ALL].size, data[LC_ALL].sum); /* For each locale category data set determine whether the same data is already somewhere in the archive. */ for (cnt = 0; cnt < __LC_LAST; ++cnt) - if (cnt != LC_ALL) + if (small_mask == 0 ? cnt != LC_ALL : !(small_mask & (1 << cnt))) { - /* By default signal that we have no data. */ - file_offsets[cnt] = 0; ++num_new_offsets; /* Compute the hash value of the checksum to determine a @@ -638,8 +753,9 @@ add_locale (struct locarhandle *ah, } /* Add the locale data which is not yet in the archive. */ - for (cnt = 0; cnt < __LC_LAST; ++cnt) - if (cnt != LC_ALL && file_offsets[cnt] == 0) + for (cnt = 0, lastoffset = 0; cnt < __LC_LAST; ++cnt) + if ((small_mask == 0 ? cnt != LC_ALL : !(small_mask & (1 << cnt))) + && file_offsets[cnt] == 0) { /* The data for this section is not yet available in the archive. Append it. */ @@ -650,6 +766,24 @@ add_locale (struct locarhandle *ah, if (lastpos == (off64_t) -1) error (EXIT_FAILURE, errno, _("cannot add to locale archive")); + /* If block of small categories would cross page boundary, + align it unless it immediately follows a large category. */ + if (cnt == LC_ALL && lastoffset != lastpos + && ((((lastpos & (pagesz - 1)) + data[cnt].size + pagesz - 1) + & -pagesz) + > ((data[cnt].size + pagesz - 1) & -pagesz))) + { + size_t sz = pagesz - (lastpos & (pagesz - 1)); + char *zeros = alloca (sz); + + memset (zeros, 0, sz); + if (TEMP_FAILURE_RETRY (write (ah->fd, zeros, sz) != sz)) + error (EXIT_FAILURE, errno, + _("cannot add to locale archive")); + + lastpos += sz; + } + /* Align all data to a 16 byte boundary. */ if ((lastpos & 15) != 0) { @@ -664,6 +798,7 @@ add_locale (struct locarhandle *ah, /* Remember the position. */ file_offsets[cnt] = lastpos; + lastoffset = lastpos + data[cnt].size; /* Write the data. */ if (TEMP_FAILURE_RETRY (write (ah->fd, data[cnt].addr, data[cnt].size)) @@ -689,6 +824,14 @@ add_locale (struct locarhandle *ah, ++head->sumhash_used; } + lastoffset = file_offsets[LC_ALL]; + for (cnt = 0; cnt < __LC_LAST; ++cnt) + if (small_mask & (1 << cnt)) + { + file_offsets[cnt] = lastoffset; + lastoffset += (data[cnt].size + 15) & -16; + } + if (namehashent->name_offset == 0) { /* Add the name string. */ @@ -730,11 +873,10 @@ add_locale (struct locarhandle *ah, /* Fill in the table with the locations of the locale data. */ for (cnt = 0; cnt < __LC_LAST; ++cnt) - if (cnt != LC_ALL) - { - locrecent->record[cnt].offset = file_offsets[cnt]; - locrecent->record[cnt].len = data[cnt].size; - } + { + locrecent->record[cnt].offset = file_offsets[cnt]; + locrecent->record[cnt].len = data[cnt].size; + } return namehashent->locrec_offset; } @@ -1292,7 +1434,14 @@ show_archive_content (int verbose) locrec = (struct locrecent *) ((char *) ah.addr + names[cnt].locrec_offset); for (idx = 0; idx < __LC_LAST; ++idx) - if (idx != LC_ALL) + if (locrec->record[LC_ALL].offset != 0 + ? (idx == LC_ALL + || (locrec->record[idx].offset + < locrec->record[LC_ALL].offset) + || (locrec->record[idx].offset + locrec->record[idx].len + > (locrec->record[LC_ALL].offset + + locrec->record[LC_ALL].len))) + : idx != LC_ALL) { struct dataent *data, dataent; @@ -1319,12 +1468,21 @@ show_archive_content (int verbose) struct dataent *data, dataent; dataent.file_offset = locrec->record[idx].offset; + if (locrec->record[LC_ALL].offset != 0 + && dataent.file_offset >= locrec->record[LC_ALL].offset + && (dataent.file_offset + locrec->record[idx].len + <= (locrec->record[LC_ALL].offset + + locrec->record[LC_ALL].len))) + dataent.file_offset = locrec->record[LC_ALL].offset; + data = (struct dataent *) bsearch (&dataent, files, sumused, sizeof (struct dataent), dataentcmp); - printf ("%6d %7x %3d ", + printf ("%6d %7x %3d%c ", locrec->record[idx].len, locrec->record[idx].offset, - data->nlink); + data->nlink, + dataent.file_offset == locrec->record[LC_ALL].offset + ? '+' : ' '); for (i = 0; i < 16; i += 4) printf ("%02x%02x%02x%02x", data->sum[i], data->sum[i + 1], diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure index 7238378..6f10132 100644 --- a/sysdeps/mach/configure +++ b/sysdeps/mach/configure @@ -1,18 +1,22 @@ +if test "x$MIG" = xMISSING; then + { echo "configure: error: cannot find required build tool mig" 1>&2; exit 1; } +fi + ### Sanity checks for Mach header installation ac_safe=`echo "mach/mach_types.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for mach/mach_types.h""... $ac_c" 1>&6 -echo "configure:6: checking for mach/mach_types.h" >&5 +echo "configure:10: checking for mach/mach_types.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:20: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -36,17 +40,17 @@ fi ac_safe=`echo "mach/mach_types.defs" | sed 'y%./+-%__p_%'` echo $ac_n "checking for mach/mach_types.defs""... $ac_c" 1>&6 -echo "configure:40: checking for mach/mach_types.defs" >&5 +echo "configure:44: checking for mach/mach_types.defs" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:50: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:54: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -72,19 +76,19 @@ fi echo $ac_n "checking for task_t in mach/mach_types.h""... $ac_c" 1>&6 -echo "configure:76: checking for task_t in mach/mach_types.h" >&5 +echo "configure:80: checking for task_t in mach/mach_types.h" >&5 if eval "test \"`echo '$''{'libc_cv_mach_task_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { extern task_t foo; ; return 0; } EOF -if { (eval echo configure:88: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:92: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_mach_task_t=task_t else @@ -101,19 +105,19 @@ if test $libc_cv_mach_task_t != task_t; then DEFINES="$DEFINES -Dtask_t=task_port_t" fi echo $ac_n "checking for thread_t in mach/mach_types.h""... $ac_c" 1>&6 -echo "configure:105: checking for thread_t in mach/mach_types.h" >&5 +echo "configure:109: checking for thread_t in mach/mach_types.h" >&5 if eval "test \"`echo '$''{'libc_cv_mach_thread_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { extern thread_t foo; ; return 0; } EOF -if { (eval echo configure:117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_mach_thread_t=thread_t else @@ -131,12 +135,12 @@ if test $libc_cv_mach_thread_t != thread_t; then fi echo $ac_n "checking for creation_time in task_basic_info""... $ac_c" 1>&6 -echo "configure:135: checking for creation_time in task_basic_info" >&5 +echo "configure:139: checking for creation_time in task_basic_info" >&5 if eval "test \"`echo '$''{'libc_cv_mach_task_creation_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -146,7 +150,7 @@ long s = i->creation_time.seconds; ; return 0; } EOF -if { (eval echo configure:150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* libc_cv_mach_task_creation_time=yes else @@ -172,17 +176,17 @@ for ifc in mach mach4 \ ; do ac_safe=`echo "mach/${ifc}.defs" | sed 'y%./+-%__p_%'` echo $ac_n "checking for mach/${ifc}.defs""... $ac_c" 1>&6 -echo "configure:176: checking for mach/${ifc}.defs" >&5 +echo "configure:180: checking for mach/${ifc}.defs" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -209,12 +213,12 @@ if test "x$mach_interface_list" = x; then fi echo $ac_n "checking for host_page_size in mach_host.defs""... $ac_c" 1>&6 -echo "configure:213: checking for host_page_size in mach_host.defs" >&5 +echo "configure:217: checking for host_page_size in mach_host.defs" >&5 if eval "test \"`echo '$''{'libc_cv_mach_host_page_size'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -240,17 +244,17 @@ fi ac_safe=`echo "mach/machine/ndr_def.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for mach/machine/ndr_def.h""... $ac_c" 1>&6 -echo "configure:244: checking for mach/machine/ndr_def.h" >&5 +echo "configure:248: checking for mach/machine/ndr_def.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -271,17 +275,17 @@ else echo "$ac_t""no" 1>&6 ac_safe=`echo "machine/ndr_def.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/ndr_def.h""... $ac_c" 1>&6 -echo "configure:275: checking for machine/ndr_def.h" >&5 +echo "configure:279: checking for machine/ndr_def.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -306,12 +310,12 @@ fi echo $ac_n "checking for i386_io_perm_modify in mach_i386.defs""... $ac_c" 1>&6 -echo "configure:310: checking for i386_io_perm_modify in mach_i386.defs" >&5 +echo "configure:314: checking for i386_io_perm_modify in mach_i386.defs" >&5 if eval "test \"`echo '$''{'libc_cv_mach_i386_ioports'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF diff --git a/sysdeps/mach/configure.in b/sysdeps/mach/configure.in index fca2063..6efd39f 100644 --- a/sysdeps/mach/configure.in +++ b/sysdeps/mach/configure.in @@ -1,6 +1,12 @@ sinclude(./aclocal.m4)dnl Autoconf lossage. GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +dnl Autoconf weirdness requires that AC_CHECK_TOOL be in the main configure.in, +dnl but only on Mach-based configurations is the tool needed. +if test "x$MIG" = xMISSING; then + AC_MSG_ERROR([cannot find required build tool mig]) +fi + ### Sanity checks for Mach header installation AC_CHECK_HEADER(mach/mach_types.h,, [AC_MSG_ERROR([cannot find Mach headers])]) AC_CHECK_HEADER(mach/mach_types.defs,, [dnl