diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-12 04:54:42 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-12 04:54:42 +0000 |
commit | 901dfcc7f6e0550e46d865befe0f4da4ccc60988 (patch) | |
tree | 9381534d80452c32494066d2511c5ca33135ba29 | |
parent | 3b853ab87d4a626bf5229082903fd2bb891f1ecf (diff) | |
download | gcc-901dfcc7f6e0550e46d865befe0f4da4ccc60988.tar.gz |
2001-01-11 Zack Weinberg <zack@wolery.stanford.edu>
* aclocal.m4 (AC_FUNC_MMAP_ANYWHERE): Completely rewritten.
Now defines HAVE_MMAP_DEV_ZERO and/or HAVE_MMAP_ANON depending
which you have.
(AC_FUNC_MMAP_FILE): Don't AC_REQUIRE AC_FUNC_MMAP_ANYWHERE.
* configure.in: Set GGC to ggc-page if any of mmap_dev_zero,
mmap_anon, and valloc is available.
* ggc-page.c: Restructure ifdef logic to match new autoconf
spec. Don't throw away the test page in init_ggc.
* configure, config.in: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38934 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 403 | ||||
-rw-r--r-- | gcc/aclocal.m4 | 266 | ||||
-rw-r--r-- | gcc/config.in | 7 | ||||
-rwxr-xr-x | gcc/configure | 563 | ||||
-rw-r--r-- | gcc/configure.in | 3 | ||||
-rw-r--r-- | gcc/ggc-page.c | 90 |
6 files changed, 876 insertions, 456 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 078f431ac6f..50f9c20055d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2001-01-11 Zack Weinberg <zack@wolery.stanford.edu> + + * aclocal.m4 (AC_FUNC_MMAP_ANYWHERE): Completely rewritten. + Now defines HAVE_MMAP_DEV_ZERO and/or HAVE_MMAP_ANON depending + which you have. + (AC_FUNC_MMAP_FILE): Don't AC_REQUIRE AC_FUNC_MMAP_ANYWHERE. + * configure.in: Set GGC to ggc-page if any of mmap_dev_zero, + mmap_anon, and valloc is available. + * ggc-page.c: Restructure ifdef logic to match new autoconf + spec. Don't throw away the test page in init_ggc. + + * configure, config.in: Regenerate. + 2001-01-12 Michael Hayes <mhayes@redhat.com> * loop.h (total_biv_increment): Constify iv_class pointer. @@ -44,10 +57,10 @@ Fri Jan 12 00:04:00 MET 2001 Jan Hubicka <jh@suse.cz> * builtins.c (std_expand_builtin_va_start): Handle varargs when sizeof (int) is larger than sizeof(__word__). - + 2001-01-11 Neil Booth <neil@daikokuya.demon.co.uk> - * cppinit.c (do_includes): Fix typo. + * cppinit.c (do_includes): Fix typo. 2001-01-11 Stephane Carrez <Stephane.Carrez@worldnet.fr> @@ -63,27 +76,27 @@ Fri Jan 12 00:04:00 MET 2001 Jan Hubicka <jh@suse.cz> (lshrdi_const1, lshrsi3_const16): Likewise. (*addhi3, lshrsi3_const1, lshrqi3_const1): Likewise. (*movhi_68hc12, *movqi_68hc12): Likewise. - (movstrictqi): Make sure reloading in D_REGS as a destination + (movstrictqi): Make sure reloading in D_REGS as a destination does not happen. 2001-01-11 Neil Booth <neil@daikokuya.demon.co.uk> - * cppspec.c (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -MQ. + * cppspec.c (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -MQ. 2001-01-11 Neil Booth <neil@daikokuya.demon.co.uk> - * cppinit.c (cpp_start_read): If -fpreprocessed, ignore - -D, -U and -A, and don't initialize the builtins. + * cppinit.c (cpp_start_read): If -fpreprocessed, ignore + -D, -U and -A, and don't initialize the builtins. (do_includes): Error if -include or -imacros with -fpreprocessed. - * cppmain.c (cb_define, cb_undef): Unconditionally process - the callback. - * tradcpp.c (main): Fix typo. + * cppmain.c (cb_define, cb_undef): Unconditionally process + the callback. + * tradcpp.c (main): Fix typo. 2000-01-11 Mark Elbrecht <snowball3@bigfoot.com> - + * cppfiles.c (cpp_included, find_include_file, _cpp_execute_include) (read_name_map): Use IS_ABSOLUTE_PATH. - * tradcpp.c (get_filename): Likewise. + * tradcpp.c (get_filename): Likewise. 2001-01-11 Stephane Carrez <Stephane.Carrez@worldnet.fr> @@ -104,7 +117,7 @@ Fri Jan 12 00:04:00 MET 2001 Jan Hubicka <jh@suse.cz> 2001-01-11 Neil Booth <neil@daikokuya.demon.co.uk> - * invoke.texi: Restore documentation of the drivers' switches -MD + * invoke.texi: Restore documentation of the drivers' switches -MD and -MMD. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> @@ -155,22 +168,22 @@ Fri Jan 12 00:04:00 MET 2001 Jan Hubicka <jh@suse.cz> 2001-01-10 Neil Booth <neil@daikokuya.demon.co.uk> - * Makefile.in (tradcpp0): Depend on mkdeps.h. Link mkdeps.o - * cppinit.c (cpp_start_read): Update comment, remove unneeded - if statement. - * tradcpp.c: Include mkdeps.h. - (deps, print_deps_phony_targets, deps_append, output_deps, - init_dependency_output, output_deps): New. - (deps_buffer, deps_allocated_size, deps_size, deps_column, - deps_output): Delete. - (print_deps_missing_files): Rename deps_missing_files. - (inhibit_output): Make global. - (main): Delete inhibit_output, deps_stream, deps_target. - Use mkdeps functionality in the same way as cpplib. Remove - -g3 handling. Handle -MF, -MP, -MQ, -MT. Update handling of - -M and -MM. Remove old handling of deps via deps_out, and - old reading of environment variables. - (get_filename): Update to use deps_add_dep. + * Makefile.in (tradcpp0): Depend on mkdeps.h. Link mkdeps.o + * cppinit.c (cpp_start_read): Update comment, remove unneeded + if statement. + * tradcpp.c: Include mkdeps.h. + (deps, print_deps_phony_targets, deps_append, output_deps, + init_dependency_output, output_deps): New. + (deps_buffer, deps_allocated_size, deps_size, deps_column, + deps_output): Delete. + (print_deps_missing_files): Rename deps_missing_files. + (inhibit_output): Make global. + (main): Delete inhibit_output, deps_stream, deps_target. + Use mkdeps functionality in the same way as cpplib. Remove + -g3 handling. Handle -MF, -MP, -MQ, -MT. Update handling of + -M and -MM. Remove old handling of deps via deps_out, and + old reading of environment variables. + (get_filename): Update to use deps_add_dep. 2001-01-10 Mark Mitchell <mark@codesourcery.com> @@ -215,7 +228,7 @@ Fri Jan 12 00:04:00 MET 2001 Jan Hubicka <jh@suse.cz> restore_machine_status. * emit-rtl.c (init_emit_once): Amend comment describing - {init|mark|free}_machine_status. + {init|mark|free}_machine_status. * tm.texi (Per-Function Data): New node. Describe the INIT_EXPANDERS macro and the {init|mark|free}_machine_status @@ -223,17 +236,17 @@ Fri Jan 12 00:04:00 MET 2001 Jan Hubicka <jh@suse.cz> 2001-01-10 Neil Booth <neil@daikokuya.demon.co.uk> - * cppinit.c (OPT_g): Remove. - (cpp_handle_option): Update for removed -g3. - (print_help): Update. - * cpplib.h (struct cpp_options): Remove debug_output. - * cppmain.c (setup_callbacks, cb_define): Update. - * gcc.c (cpp_options): Translate -g3 to -dD. + * cppinit.c (OPT_g): Remove. + (cpp_handle_option): Update for removed -g3. + (print_help): Update. + * cpplib.h (struct cpp_options): Remove debug_output. + * cppmain.c (setup_callbacks, cb_define): Update. + * gcc.c (cpp_options): Translate -g3 to -dD. 2001-01-10 Aldy Hernandez <aldyh@redhat.com> * config/i960/i960.md: Change modifier to + on the zero_extract - pattern after the (rotate -2 reg) canonicalization pattern. + pattern after the (rotate -2 reg) canonicalization pattern. 2001-01-10 Richard Henderson <rth@redhat.com> @@ -282,14 +295,14 @@ Wed Jan 10 16:38:31 MET 2001 Jan Hubicka <jh@suse.cz> @w. 2001-01-10 Nathan Sidwell <nathan@codesourcery.com> - - * gcc.c (cpp_options): Set MD file name from output - filename, if specified. - (suffix_subst): New static variable. - (do_spec): Clear it. - (do_spec_1, case '.'): Handle new `%.suffix' spec. - Clear it. - (give_switch): Handle suffix_subst. + + * gcc.c (cpp_options): Set MD file name from output + filename, if specified. + (suffix_subst): New static variable. + (do_spec): Clear it. + (do_spec_1, case '.'): Handle new `%.suffix' spec. + Clear it. + (give_switch): Handle suffix_subst. 2001-01-10 Phil Edwards <pme@sources.redhat.com> @@ -301,28 +314,28 @@ Wed Jan 10 16:38:31 MET 2001 Jan Hubicka <jh@suse.cz> 2001-01-10 Neil Booth <neil@daikokuya.demon.co.uk> - * c-lang.c (lang_hooks): Update. - (lang_decode_option): Remove. - (lang_init_options): Rename c_init_options. - * toplev.c (main): Use lang_hooks for lang_init_options - and lang_decode_option. - * toplev.h (lang_hooks): Add 2 new hooks. - * tree.h: Remove lang_init_options and lang_decode_option. - * cp/cp-tree.h (lang_decode_option): Rename cxx_decode_option. - * cp/decl2.c: Similarly. - * cp/lex.c (lang_init_options): Rename cxx_init_options. - (lang_hooks): Update. - * f/com.c (f_init, f_finish): Rename ffe_init, ffe_finish - for consistency. - (lang_init_options): Rename ffe_init_options. - (lang_hooks): Update. - (lang_decode_option): Remove. - * java/lang.c (lang_init_options): Rename java_init_options. - (lang_decode_option): Rename java_decode_option. - (lang_hooks): Update. - * objc/objc-act.c (lang_init_options): Rename objc_init_options. - (lang_decode_option): Rename objc_decode_option. - (lang_hooks): Update. + * c-lang.c (lang_hooks): Update. + (lang_decode_option): Remove. + (lang_init_options): Rename c_init_options. + * toplev.c (main): Use lang_hooks for lang_init_options + and lang_decode_option. + * toplev.h (lang_hooks): Add 2 new hooks. + * tree.h: Remove lang_init_options and lang_decode_option. + * cp/cp-tree.h (lang_decode_option): Rename cxx_decode_option. + * cp/decl2.c: Similarly. + * cp/lex.c (lang_init_options): Rename cxx_init_options. + (lang_hooks): Update. + * f/com.c (f_init, f_finish): Rename ffe_init, ffe_finish + for consistency. + (lang_init_options): Rename ffe_init_options. + (lang_hooks): Update. + (lang_decode_option): Remove. + * java/lang.c (lang_init_options): Rename java_init_options. + (lang_decode_option): Rename java_decode_option. + (lang_hooks): Update. + * objc/objc-act.c (lang_init_options): Rename objc_init_options. + (lang_decode_option): Rename objc_decode_option. + (lang_hooks): Update. 2001-01-09 Nick Clifton <nickc@redhat.com> @@ -367,7 +380,7 @@ Tue Jan 9 21:25:19 2001 Jeffrey A Law (law@cygnus.com) * reload.c (find_reloads_address): Check for eliminable registers when substituting a constant expression for a pseudo. - + 2001-01-09 Joseph S. Myers <jsm28@cam.ac.uk> * c-common.c (enum format_type): Add format_type_error. @@ -469,16 +482,16 @@ Tue Jan 9 21:25:19 2001 Jeffrey A Law (law@cygnus.com) 2001-01-09 Neil Booth <neil@daikokuya.demon.co.uk> - * cppinit.c (OPT_MD, OPT_MMD): Restore. - (cpp_handle_option): Handle them. - (cpp_post_options): Ensure one of -M or -MM is specified with - any other -M? option. - (init_dependency_output): Suppress output with -MG. + * cppinit.c (OPT_MD, OPT_MMD): Restore. + (cpp_handle_option): Handle them. + (cpp_post_options): Ensure one of -M or -MM is specified with + any other -M? option. + (init_dependency_output): Suppress output with -MG. 2001-01-09 Neil Booth <neil@daikokuya.demon.co.uk> - * cpp.texi: Update. - * invoke.texi: Update. + * cpp.texi: Update. + * invoke.texi: Update. 2001-01-09 Bernd Schmidt <bernds@redhat.com> @@ -488,25 +501,25 @@ Tue Jan 9 21:25:19 2001 Jeffrey A Law (law@cygnus.com) 2001-01-09 Neil Booth <neil@daikokuya.demon.co.uk> * c-lang.c (lang_hooks): Update. - (lang_init): Rename c_init. - (lang_finish): Remove. - * toplev.c (compile_file): Use lang_hooks for lang_init () - and lang_finish (). - * toplev.h (lang_hooks): Add init () and finish (). - * tree.h (lang_init, lang_finish): Remove. - * cp/tree.h (lang_init, lang_finish): Remove. - * cp/decl2.c (cxx_post_options, lang_hooks): Move to cp/lex.c. - * cp/lex.c (cxx_init, cxx_finish, cxx_post_options, - lang_hooks): New. - (lang_init, lang_finish): Remove. - * f/com.c (lang_init, lang_finish): Rename f_init, f_finish. - (lang_hooks): Update. - * java/lang.c (lang_init): Rename java_init. - (lang_finish): Remove. - (lang_hooks): Update. - * objc/objc-act.c (lang_init): Rename objc_init. - (lang_finish): Remove. - (lang_hoooks): Update. + (lang_init): Rename c_init. + (lang_finish): Remove. + * toplev.c (compile_file): Use lang_hooks for lang_init () + and lang_finish (). + * toplev.h (lang_hooks): Add init () and finish (). + * tree.h (lang_init, lang_finish): Remove. + * cp/tree.h (lang_init, lang_finish): Remove. + * cp/decl2.c (cxx_post_options, lang_hooks): Move to cp/lex.c. + * cp/lex.c (cxx_init, cxx_finish, cxx_post_options, + lang_hooks): New. + (lang_init, lang_finish): Remove. + * f/com.c (lang_init, lang_finish): Rename f_init, f_finish. + (lang_hooks): Update. + * java/lang.c (lang_init): Rename java_init. + (lang_finish): Remove. + (lang_hooks): Update. + * objc/objc-act.c (lang_init): Rename objc_init. + (lang_finish): Remove. + (lang_hoooks): Update. 20001-01-09 Graham Stott <grahams@redhat.com> @@ -550,7 +563,7 @@ Tue Jan 9 21:25:19 2001 Jeffrey A Law (law@cygnus.com) 2001-01-08 Nick Clifton <nickc@redhat.com> * config/v850/v850.c (ra_rtx): Delete. - (v850_save_machine_status): Delete. + (v850_save_machine_status): Delete. (v850_restore_machine_status): Delete. (v850_init_machine_status): New function. (v850_mark_machine_status): New function. @@ -563,7 +576,7 @@ Tue Jan 9 21:25:19 2001 Jeffrey A Law (law@cygnus.com) to take a const char *, to avoid compile time warning. * config/v850/v850.h (ASM_OUTPUT_LABELREF): Undefine, not needed. (USER_LABEL_PREFIX): Redefine. - + 2000-01-08 Jim Wilson <wilson@redhat.com> * sched-rgn.c (BITSET_ADD, BITSET_REMOVE, bitset_member): Cast @@ -582,10 +595,10 @@ Tue Jan 9 21:25:19 2001 Jeffrey A Law (law@cygnus.com) 2001-01-08 Neil Booth <neil@daikokuya.demon.co.uk> - * cppinit.c (init): Rename init_library. - (cpp_create_reader): Update. - * gcc.c (cpp_options): If -o given, use it as the target of - any -M options. + * cppinit.c (init): Rename init_library. + (cpp_create_reader): Update. + * gcc.c (cpp_options): If -o given, use it as the target of + any -M options. 2001-01-08 Richard Earnshaw <rearnsha@arm.com> @@ -604,7 +617,7 @@ Tue Jan 9 21:25:19 2001 Jeffrey A Law (law@cygnus.com) (emit_multi_reg_push, emit_sfm, expand_prologue): Use constants. * arm.h (SP_REGNUM, IP_REGNUM, PC_REGNUM): Delete defines. (STACK_POINTER_REGNUM): Define in terms of SP_REGNUM. - + Mon Jan 8 16:14:56 MET 2001 Jan Hubicka <jh@suse.cz> * jump.c (jump_optimize_1): Use reversed_comparison_code @@ -622,7 +635,7 @@ Mon Jan 8 16:14:56 MET 2001 Jan Hubicka <jh@suse.cz> * arm.h (HARD_REGNO_RENAME_OK): Delete. (EPILOGUE_USES): Define. - (INITIAL_ELIMINATION_OFFSET): Current prologue code does not + (INITIAL_ELIMINATION_OFFSET): Current prologue code does not automatically stack the LR if it isn't live. Mon Jan 8 13:46:02 MET 2001 Jan Hubicka <jh@suse.cz> @@ -702,28 +715,28 @@ Sun Jan 7 19:37:48 MET 2001 Jan Hubicka <jh@suse.cz> 2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk> - * fix-header.c (read_scan_file): s/pfile/scan_in/. + * fix-header.c (read_scan_file): s/pfile/scan_in/. 2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk> - * c-lang.c (c_post_options): Call cpp_post_options. + * c-lang.c (c_post_options): Call cpp_post_options. * objc/objc-act.c (objc_post_options): Similarly. * cppmain.c (main): Similarly. - * fix-header.c (read_scan_file): Similarly. - * cppinit.c (cpp_start_read): Move option consistency checks - to cpp_post_options. Don't call init_dependency_output. - If needed, add default target and main file dependency. - (OPT_MD, OPT_MMD): Remove. - (OPT_MF): New. - (cpp_handle_option): Update for OPT_* changes. - (cpp_post_options): New. - (init_dependency_output): Command line -MF overrides environment - variables. Don't set default target etc. Suppress output - if dependencies are going to stdout. - (print_help): Update. - * cpplib.h (cpp_post_options): New. - * gcc.c (cpp_options): Update for -MD, -MMD, -MF. - + * fix-header.c (read_scan_file): Similarly. + * cppinit.c (cpp_start_read): Move option consistency checks + to cpp_post_options. Don't call init_dependency_output. + If needed, add default target and main file dependency. + (OPT_MD, OPT_MMD): Remove. + (OPT_MF): New. + (cpp_handle_option): Update for OPT_* changes. + (cpp_post_options): New. + (init_dependency_output): Command line -MF overrides environment + variables. Don't set default target etc. Suppress output + if dependencies are going to stdout. + (print_help): Update. + * cpplib.h (cpp_post_options): New. + * gcc.c (cpp_options): Update for -MD, -MMD, -MF. + Sun Jan 7 14:44:19 MET 2001 Jan Hubicka <jh@suse.cz> * jump.c (comparison_dominates_p): Support unordered compares. @@ -766,17 +779,17 @@ Sun Jan 7 13:49:19 MET 2001 Jan Hubicka <jh@suse.cz> 2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk> - * (initialize, initialize_builtins, - initialize_dependency_output, initialize_standard_includes): - Rename s/initialize/init. Update. - (init_dependency_output): Move to after - cpp_handle_options, the correct location temporally at least. - (opt_comp): Move next to init (), its caller. Fix prototype. - (init): Make "initialized" local scope. - (cpp_create_reader): Always call init (). - (cpp_start_read): Update. - (output_deps): New function, broken out of cpp_finish. - (cpp_finish): Break out output_deps. + * (initialize, initialize_builtins, + initialize_dependency_output, initialize_standard_includes): + Rename s/initialize/init. Update. + (init_dependency_output): Move to after + cpp_handle_options, the correct location temporally at least. + (opt_comp): Move next to init (), its caller. Fix prototype. + (init): Make "initialized" local scope. + (cpp_create_reader): Always call init (). + (cpp_start_read): Update. + (output_deps): New function, broken out of cpp_finish. + (cpp_finish): Break out output_deps. 2001-01-07 Richard Henderson <rth@redhat.com> @@ -870,26 +883,26 @@ Sun Jan 7 13:49:19 MET 2001 Jan Hubicka <jh@suse.cz> 2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk> - * toplev.c (main): Call the front-end specific post_options - hook if one is given. - * toplev.h (struct_lang_hooks, lang_hooks): New. - * c-lang.c (c_post_options, lang_hooks): Implement lang_hooks - for the C front end. - * cp/decl2.c (cxx_post_options, lang_hooks): Implement - lang_hooks for the C++ front end. - * objc/objc-act.c (objc_post_options, lang_hooks): Implement - lang_hooks for the ObjC front end. - * f/com.c (lang_hooks): Hooks for the Fortran front end. - * java/lang.c (lang_hooks): Hooks for the Java front end. + * toplev.c (main): Call the front-end specific post_options + hook if one is given. + * toplev.h (struct_lang_hooks, lang_hooks): New. + * c-lang.c (c_post_options, lang_hooks): Implement lang_hooks + for the C front end. + * cp/decl2.c (cxx_post_options, lang_hooks): Implement + lang_hooks for the C++ front end. + * objc/objc-act.c (objc_post_options, lang_hooks): Implement + lang_hooks for the ObjC front end. + * f/com.c (lang_hooks): Hooks for the Fortran front end. + * java/lang.c (lang_hooks): Hooks for the Java front end. 2001-01-07 Neil Booth <neil@daikokuya.demon.co.uk> - * c-lex.c (init_c_lex): Request #define / #undef callbacks - for verbose DWARF[2] debugging. - (cb_define, cb_undef): The new callbacks. - * toplev.h (debug_define, debug_undef): Make const correct. - * toplev.c (debug_define, debug_undef): Similarly. Do not - perform the verbosity tests here anymore. + * c-lex.c (init_c_lex): Request #define / #undef callbacks + for verbose DWARF[2] debugging. + (cb_define, cb_undef): The new callbacks. + * toplev.h (debug_define, debug_undef): Make const correct. + * toplev.c (debug_define, debug_undef): Similarly. Do not + perform the verbosity tests here anymore. 2001-01-07 Alexandre Oliva <aoliva@redhat.com> @@ -954,19 +967,19 @@ Fri Jan 5 16:34:18 2001 Nick Clifton <nickc@redhat.com> 2001-01-05 Neil Booth <neil@daikokuya.demon.co.uk> - * cpp.texi: Update for -MQ. - * cppinit.c (cpp_create_reader): Always create pfile->deps. - (cpp_cleanup): Always free pfile->deps. - (initialize_dependency_output): Don't create pfile->deps. - (cpp_handle_option): Similarly. - (OPT_MQ): New. - * gcc.c (cpp_options): Handle -MQ. - (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -MQ. - * mkdeps.c (base_name): Remove. - (deps_init): Don't allocate vector space until it's needed. - (deps_free): Only free vectors if allocated. - (deps_add_target, deps_add_dep): Update for initial allocation. - (deps_add_default_target): Don't strip to the base_name. + * cpp.texi: Update for -MQ. + * cppinit.c (cpp_create_reader): Always create pfile->deps. + (cpp_cleanup): Always free pfile->deps. + (initialize_dependency_output): Don't create pfile->deps. + (cpp_handle_option): Similarly. + (OPT_MQ): New. + * gcc.c (cpp_options): Handle -MQ. + (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -MQ. + * mkdeps.c (base_name): Remove. + (deps_init): Don't allocate vector space until it's needed. + (deps_free): Only free vectors if allocated. + (deps_add_target, deps_add_dep): Update for initial allocation. + (deps_add_default_target): Don't strip to the base_name. 2001-01-05 DJ Delorie <dj@redhat.com> @@ -981,7 +994,7 @@ Fri Jan 5 16:34:18 2001 Nick Clifton <nickc@redhat.com> * config/v850/v850-protos.h: Add prototypes for v850_return_addr and v850_init_expanders. - + 2001-01-05 Zack Weinberg <zack@wolery.stanford.edu> * cpplib.h (struct cpp_reader): Add help_only field. @@ -1009,7 +1022,7 @@ Fri Jan 5 16:34:18 2001 Nick Clifton <nickc@redhat.com> * print-rtl.c (print_simple_rtl): New. (flag_simple): New. (print_rtx): Disable printing of flags and modes, etc., - if `flag_simple` nonzero. + if `flag_simple` nonzero. 2001-01-05 Zack Weinberg <zack@wolery.stanford.edu> @@ -1086,7 +1099,7 @@ Fri Jan 5 20:34:06 2001 J"orn Rennecke <amylaar@redhat.com> 2001-01-05 Daniel Berlin <dberlin@redhat.com> * c-common.c (lang_get_alias_set): Say we know nothing of - VECTOR_TYPE aliasing. + VECTOR_TYPE aliasing. * dwarf2out.c (is_base_type): Handle VECTOR_TYPE properly. @@ -1127,18 +1140,18 @@ Fri Jan 5 16:29:49 MET 2001 Jan Hubicka <jh@suse.cz> 2001-01-05 Neil Booth <neil@daikokuya.demon.co.uk> - * cpp.texi: Update for -MP. Clarify behaviour of -MT. - * cppinit.c (initialize_dependency_output): Update. - (cpp_finish): Output dummy targets for -MP. - (OPT_MP): New. - (cpp_handle_option): Handle -MP. Don't quote -MT options. - * cpplib.h (struct cpp_options): Add deps_phony_targets. - * gcc.c (cpp_options): Update to handle -MP. - * mkdeps.c (deps_add_target, deps_add_default_target): Update - to quote only the default target. - (deps_phony_targets): Insert a preceding newline. Rename from - deps_dummy_targets for consistency. - * mkdeps.h: Update + * cpp.texi: Update for -MP. Clarify behaviour of -MT. + * cppinit.c (initialize_dependency_output): Update. + (cpp_finish): Output dummy targets for -MP. + (OPT_MP): New. + (cpp_handle_option): Handle -MP. Don't quote -MT options. + * cpplib.h (struct cpp_options): Add deps_phony_targets. + * gcc.c (cpp_options): Update to handle -MP. + * mkdeps.c (deps_add_target, deps_add_default_target): Update + to quote only the default target. + (deps_phony_targets): Insert a preceding newline. Rename from + deps_dummy_targets for consistency. + * mkdeps.h: Update 2001-01-05 Alexandre Oliva <aoliva@redhat.com> @@ -1159,7 +1172,7 @@ Fri Jan 5 16:29:49 MET 2001 Jan Hubicka <jh@suse.cz> (process_init_element): Don't dereference null DECL_SIZE. * varasm.c (array_size_for_constructor): Return a HOST_WIDE_INT. Don't abort for empty constructors. Use size_binop - (output_constructor): Add commentary regarding zero length + (output_constructor): Add commentary regarding zero length array futures. Abort if we try to initialize an array of unspecified length with a non-empty constructor in the middle of a structure. @@ -1188,7 +1201,7 @@ Fri Jan 5 16:29:49 MET 2001 Jan Hubicka <jh@suse.cz> for prset and prget. 2001-01-05 Michael Hayes <mhayes@redhat.com> - + * loop.h (struct loop_reg): New. (struct loop_regs): Change to use array of `struct loop_reg'. * loop.c: Replace assortment of varrays with single regs array. @@ -1201,7 +1214,7 @@ Fri Jan 5 16:29:49 MET 2001 Jan Hubicka <jh@suse.cz> (loop_optimize): Delete `moved_once' array. 2001-01-05 Michael Hayes <mhayes@redhat.com> - + * loop.c (prescan_loop): Set loop_info->has_nonconst_call. Use it instead of loop_info->has_call for scanning loop mems. (check_dbra_loop): Replace loop_info->has_call test with @@ -1320,18 +1333,18 @@ Thu Jan 4 15:54:05 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2001-01-04 Neil Booth <neil@daikokuya.demon.co.uk> - * cpp.texi: Update for -MT. - * cppinit.c (initialize_dependency_output): Add a default - target if none has been given already. - (no_tgt, OPT_MT): New. - (cpp_handle_option): Handle -MT. Update -M etc. - * cpplib.h (struct cpp_options): Remove deps_target. - * gcc.c (cpp_options): Handle -MT. - * mkdeps.c (struct deps): Move from mkdeps.h. - (deps_calc_target): Rename deps_add_default_target. Add a - default target if none has been specified already. - * mkdeps.h (struct deps): Move to mkdeps.c. - (deps_calc_target): Rename deps_add_default_target. + * cpp.texi: Update for -MT. + * cppinit.c (initialize_dependency_output): Add a default + target if none has been given already. + (no_tgt, OPT_MT): New. + (cpp_handle_option): Handle -MT. Update -M etc. + * cpplib.h (struct cpp_options): Remove deps_target. + * gcc.c (cpp_options): Handle -MT. + * mkdeps.c (struct deps): Move from mkdeps.h. + (deps_calc_target): Rename deps_add_default_target. Add a + default target if none has been specified already. + * mkdeps.h (struct deps): Move to mkdeps.c. + (deps_calc_target): Rename deps_add_default_target. 2000-01-03 Richard Henderson <rth@redhat.com> @@ -1355,7 +1368,7 @@ Thu Jan 4 15:54:05 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * config/alpha/alpha.md (addvsi3, addvdi3): New. (negvsi2, negvdi2, subvsi3, subvdi3, mulvsi3, mulvdi3): New. - + 2001-01-03 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> * tradcpp.c (main): Make sure finclude() is called with a valid @@ -1464,7 +1477,7 @@ Wed Jan 3 08:53:50 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * c-common.h (ASM_INPUT_P): New. * c-parse.in (asm): Set it when needed. - * c-semantics.c (genrtl_asm_stmt): Test it instead of the + * c-semantics.c (genrtl_asm_stmt): Test it instead of the existance of an operand. Tue Jan 2 20:27:07 MET 2001 Jan Hubicka <jh@suse.cz> @@ -1527,7 +1540,7 @@ Tue Jan 2 10:47:38 2001 Richard Kenner <kenner@vlsi1.ultra.nyu. 2001-01-02 Philip Blundell <pb@futuretv.com> - * config/arm/linux-gas.h (CLEAR_INSN_CACHE): Avoid illegal clobber + * config/arm/linux-gas.h (CLEAR_INSN_CACHE): Avoid illegal clobber of input operand. 2001-01-02 Richard Henderson <rth@redhat.com> @@ -1585,9 +1598,9 @@ Mon Jan 1 21:28:29 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2001-01-01 John David Anglin <dave@hiauly1.hia.nrc.ca> - * loop.c (add_label_notes): Increment the label usage count when - a note is added to an insn which refers to a CODE_LABEL. - * gcse.c (add_label_notes): Likewise. + * loop.c (add_label_notes): Increment the label usage count when + a note is added to an insn which refers to a CODE_LABEL. + * gcse.c (add_label_notes): Likewise. 2001-01-01 Andreas Jaeger <aj@suse.de> diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index c3e1d576be8..4544c778503 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -737,16 +737,17 @@ AC_SUBST($1)dnl # Check whether mmap can map an arbitrary page from /dev/zero or with # MAP_ANONYMOUS, without MAP_FIXED. AC_DEFUN([AC_FUNC_MMAP_ANYWHERE], -[AC_CHECK_HEADERS(unistd.h) -AC_CHECK_FUNCS(getpagesize) -AC_CACHE_CHECK(for working mmap which provides zeroed pages anywhere, - ac_cv_func_mmap_anywhere, -[AC_TRY_RUN([ -/* Test by Richard Henderson and Alexandre Oliva. - Check whether mmap MAP_ANONYMOUS or mmap from /dev/zero works. */ +[AC_CHECK_FUNCS(getpagesize) +# The test program for the next two tests is the same except for one +# set of ifdefs. +changequote({{{,}}})dnl +{{{cat >ct-mmap.inc <<'EOF' #include <sys/types.h> -#include <fcntl.h> #include <sys/mman.h> +#include <fcntl.h> +#include <signal.h> +#include <setjmp.h> +#include <stdio.h> #if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) # define MAP_ANONYMOUS MAP_ANON @@ -793,45 +794,246 @@ AC_CACHE_CHECK(for working mmap which provides zeroed pages anywhere, #endif /* no HAVE_GETPAGESIZE */ -int main() -{ - char *x; - int fd, pg; - -#ifndef MAP_ANONYMOUS - fd = open("/dev/zero", O_RDWR); - if (fd < 0) - exit(1); +#ifndef MAP_FAILED +# define MAP_FAILED -1 #endif - pg = getpagesize(); -#ifdef MAP_ANONYMOUS - x = (char*)mmap(0, pg, PROT_READ|PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#undef perror_exit +#define perror_exit(str, val) \ + do { perror(str); exit(val); } while (0) + +/* Some versions of cygwin mmap require that munmap is called with the + same parameters as mmap. GCC expects that this is not the case. + Test for various forms of this problem. Warning - icky signal games. */ + +static sigset_t unblock_sigsegv; +static jmp_buf r; +static size_t pg; +static int devzero; + +static char * +anonmap (size) + size_t size; +{ +#ifdef USE_MAP_ANON + return (char *) mmap (0, size, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); #else - x = (char*)mmap(0, pg, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); + return (char *) mmap (0, size, PROT_READ|PROT_WRITE, + MAP_PRIVATE, devzero, 0); #endif - if (x == (char *) -1) - exit(2); +} + +static void +sigsegv (unused) + int unused; +{ + sigprocmask (SIG_UNBLOCK, &unblock_sigsegv, 0); + longjmp (r, 1); +} + +/* Basic functionality test. */ +void +test_0 () +{ + char *x = anonmap (pg); + if (x == (char *) MAP_FAILED) + perror_exit("test 0 mmap", 2); *(int *)x += 1; if (munmap(x, pg) < 0) - exit(3); + perror_exit("test 0 munmap", 3); +} + +/* 1. If we map a 2-page region and unmap its second page, the first page + must remain. */ +static void +test_1 () +{ + char *x = anonmap (pg * 2); + if (x == (char *)MAP_FAILED) + perror_exit ("test 1 mmap", 4); + + signal (SIGSEGV, sigsegv); + if (setjmp (r)) + perror_exit ("test 1 fault", 5); + + x[0] = 1; + x[pg] = 1; + + if (munmap (x + pg, pg) < 0) + perror_exit ("test 1 munmap 1", 6); + x[0] = 2; + + if (setjmp (r) == 0) + { + x[pg] = 1; + perror_exit ("test 1 no fault", 7); + } + if (munmap (x, pg) < 0) + perror_exit ("test 1 munmap 2", 8); +} + +/* 2. If we map a 2-page region and unmap its first page, the second + page must remain. */ +static void +test_2 () +{ + char *x = anonmap (pg * 2); + if (x == (char *)MAP_FAILED) + perror_exit ("test 2 mmap", 9); + + signal (SIGSEGV, sigsegv); + if (setjmp (r)) + perror_exit ("test 2 fault", 10); + + x[0] = 1; + x[pg] = 1; + + if (munmap (x, pg) < 0) + perror_exit ("test 2 munmap 1", 11); + + x[pg] = 2; + + if (setjmp (r) == 0) + { + x[0] = 1; + perror_exit ("test 2 no fault", 12); + } + + if (munmap (x+pg, pg) < 0) + perror_exit ("test 2 munmap 2", 13); +} + +/* 3. If we map two adjacent 1-page regions and unmap them both with + one munmap, both must go away. + + Getting two adjacent 1-page regions with two mmap calls is slightly + tricky. All OS's tested skip over already-allocated blocks; therefore + we have been careful to unmap all allocated regions in previous tests. + HP/UX allocates pages backward in memory. No OS has yet been observed + to be so perverse as to leave unmapped space between consecutive calls + to mmap. */ + +static void +test_3 () +{ + char *x, *y, *z; + + x = anonmap (pg); + if (x == (char *)MAP_FAILED) + perror_exit ("test 3 mmap 1", 14); + y = anonmap (pg); + if (y == (char *)MAP_FAILED) + perror_exit ("test 3 mmap 2", 15); + + if (y != x + pg) + { + if (y == x - pg) + z = y, y = x, x = z; + else + { + fprintf (stderr, "test 3 nonconsecutive pages - %lx, %lx\n", + (unsigned long)x, (unsigned long)y); + exit (16); + } + } + + signal (SIGSEGV, sigsegv); + if (setjmp (r)) + perror_exit ("test 3 fault", 17); + + x[0] = 1; + y[0] = 1; + + if (munmap (x, pg*2) < 0) + perror_exit ("test 3 munmap", 18); + + if (setjmp (r) == 0) + { + x[0] = 1; + perror_exit ("test 3 no fault 1", 19); + } + + signal (SIGSEGV, sigsegv); + if (setjmp (r) == 0) + { + y[0] = 1; + perror_exit ("test 3 no fault 2", 20); + } +} + +int +main () +{ + sigemptyset (&unblock_sigsegv); + sigaddset (&unblock_sigsegv, SIGSEGV); + pg = getpagesize (); +#ifndef USE_MAP_ANON + devzero = open ("/dev/zero", O_RDWR); + if (devzero < 0) + perror_exit ("open /dev/zero", 1); +#endif + + test_0(); + test_1(); + test_2(); + test_3(); exit(0); -}], ac_cv_func_mmap_anywhere=yes, ac_cv_func_mmap_anywhere=no, -ac_cv_func_mmap_anywhere=no)]) -if test $ac_cv_func_mmap_anywhere = yes; then - AC_DEFINE(HAVE_MMAP_ANYWHERE, 1, - [Define if mmap can get us zeroed pages without MAP_FIXED.]) +} +EOF}}} +changequote([,])dnl + +AC_CACHE_CHECK(for working mmap from /dev/zero, + ac_cv_func_mmap_dev_zero, +[AC_TRY_RUN( + [#include "ct-mmap.inc"], + ac_cv_func_mmap_dev_zero=yes, + [if test $? -lt 4 + then ac_cv_func_mmap_dev_zero=no + else ac_cv_func_mmap_dev_zero=buggy + fi], + # If this is not cygwin, and /dev/zero is a character device, it's probably + # safe to assume it works. + [case "$host_os" in + cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;; + * ) if test -c /dev/zero + then ac_cv_func_mmap_dev_zero=yes + else ac_cv_func_mmap_dev_zero=no + fi ;; + esac]) +]) +if test $ac_cv_func_mmap_dev_zero = yes; then + AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, + [Define if mmap can get us zeroed pages from /dev/zero.]) +fi + +AC_CACHE_CHECK([for working mmap with MAP_ANON(YMOUS)], + ac_cv_func_mmap_anon, +[AC_TRY_RUN( + [#define USE_MAP_ANON +#include "ct-mmap.inc"], + ac_cv_func_mmap_anon=yes, + [if test $? -lt 4 + then ac_cv_func_mmap_anon=no + else ac_cv_func_mmap_anon=buggy + fi], + # Unlike /dev/zero, it is not safe to assume MAP_ANON(YMOUS) works + # just because it's there. Some SCO Un*xen define it but don't implement it. + ac_cv_func_mmap_anon=no) +]) +if test $ac_cv_func_mmap_anon = yes; then + AC_DEFINE(HAVE_MMAP_ANON, 1, + [Define if mmap can get us zeroed pages using MAP_ANON(YMOUS).]) fi +rm -f ct-mmap.inc ]) # Check whether mmap can map a plain file, without MAP_FIXED. AC_DEFUN([AC_FUNC_MMAP_FILE], -[AC_REQUIRE([AC_FUNC_MMAP_ANYWHERE])dnl -AC_CACHE_CHECK(for working mmap of a file, ac_cv_func_mmap_file, +[AC_CACHE_CHECK(for working mmap of a file, ac_cv_func_mmap_file, [# Create a file one thousand bytes long. for i in 1 2 3 4 5 6 7 8 9 0 do for j in 1 2 3 4 5 6 7 8 9 0 diff --git a/gcc/config.in b/gcc/config.in index 63af4048e4c..5056b42b387 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -330,8 +330,11 @@ /* Define if printf supports %p. */ #undef HAVE_PRINTF_PTR -/* Define if mmap can get us zeroed pages without MAP_FIXED. */ -#undef HAVE_MMAP_ANYWHERE +/* Define if mmap can get us zeroed pages from /dev/zero. */ +#undef HAVE_MMAP_DEV_ZERO + +/* Define if mmap can get us zeroed pages using MAP_ANON(YMOUS). */ +#undef HAVE_MMAP_ANON /* Define if read-only mmap of a plain file works. */ #undef HAVE_MMAP_FILE diff --git a/gcc/configure b/gcc/configure index 2e96d7d22fd..39e8e467746 100755 --- a/gcc/configure +++ b/gcc/configure @@ -1558,7 +1558,7 @@ for ac_kw in inline __inline__ __inline; do #include "confdefs.h" int main() { -} $ac_kw foo() { +} int $ac_kw foo() { ; return 0; } EOF if { (eval echo configure:1565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then @@ -1588,7 +1588,7 @@ esac # Find some useful tools -for ac_prog in gawk mawk nawk awk +for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -3192,55 +3192,15 @@ EOF fi -for ac_hdr in unistd.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3200: checking for $ac_hdr" >&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 -#line 3205 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3210: \"$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* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done - for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3239: checking for $ac_func" >&5 +echo "configure:3199: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3244 "configure" +#line 3204 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3263,7 +3223,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3287,23 +3247,15 @@ else fi done -echo $ac_n "checking for working mmap which provides zeroed pages anywhere""... $ac_c" 1>&6 -echo "configure:3292: checking for working mmap which provides zeroed pages anywhere" >&5 -if eval "test \"`echo '$''{'ac_cv_func_mmap_anywhere'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_anywhere=no -else - cat > conftest.$ac_ext <<EOF -#line 3300 "configure" -#include "confdefs.h" - -/* Test by Richard Henderson and Alexandre Oliva. - Check whether mmap MAP_ANONYMOUS or mmap from /dev/zero works. */ +# The test program for the next two tests is the same except for one +# set of ifdefs. +cat >ct-mmap.inc <<'EOF' #include <sys/types.h> -#include <fcntl.h> #include <sys/mman.h> +#include <fcntl.h> +#include <signal.h> +#include <setjmp.h> +#include <stdio.h> #if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) # define MAP_ANONYMOUS MAP_ANON @@ -3350,59 +3302,289 @@ else #endif /* no HAVE_GETPAGESIZE */ -int main() -{ - char *x; - int fd, pg; - -#ifndef MAP_ANONYMOUS - fd = open("/dev/zero", O_RDWR); - if (fd < 0) - exit(1); +#ifndef MAP_FAILED +# define MAP_FAILED -1 #endif - pg = getpagesize(); -#ifdef MAP_ANONYMOUS - x = (char*)mmap(0, pg, PROT_READ|PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#undef perror_exit +#define perror_exit(str, val) \ + do { perror(str); exit(val); } while (0) + +/* Some versions of cygwin mmap require that munmap is called with the + same parameters as mmap. GCC expects that this is not the case. + Test for various forms of this problem. Warning - icky signal games. */ + +static sigset_t unblock_sigsegv; +static jmp_buf r; +static size_t pg; +static int devzero; + +static char * +anonmap (size) + size_t size; +{ +#ifdef USE_MAP_ANON + return (char *) mmap (0, size, PROT_READ|PROT_WRITE, + MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); #else - x = (char*)mmap(0, pg, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); + return (char *) mmap (0, size, PROT_READ|PROT_WRITE, + MAP_PRIVATE, devzero, 0); #endif - if (x == (char *) -1) - exit(2); +} + +static void +sigsegv (unused) + int unused; +{ + sigprocmask (SIG_UNBLOCK, &unblock_sigsegv, 0); + longjmp (r, 1); +} + +/* Basic functionality test. */ +void +test_0 () +{ + char *x = anonmap (pg); + if (x == (char *) MAP_FAILED) + perror_exit("test 0 mmap", 2); *(int *)x += 1; if (munmap(x, pg) < 0) - exit(3); + perror_exit("test 0 munmap", 3); +} + +/* 1. If we map a 2-page region and unmap its second page, the first page + must remain. */ +static void +test_1 () +{ + char *x = anonmap (pg * 2); + if (x == (char *)MAP_FAILED) + perror_exit ("test 1 mmap", 4); + + signal (SIGSEGV, sigsegv); + if (setjmp (r)) + perror_exit ("test 1 fault", 5); + + x[0] = 1; + x[pg] = 1; + + if (munmap (x + pg, pg) < 0) + perror_exit ("test 1 munmap 1", 6); + x[0] = 2; + + if (setjmp (r) == 0) + { + x[pg] = 1; + perror_exit ("test 1 no fault", 7); + } + if (munmap (x, pg) < 0) + perror_exit ("test 1 munmap 2", 8); +} + +/* 2. If we map a 2-page region and unmap its first page, the second + page must remain. */ +static void +test_2 () +{ + char *x = anonmap (pg * 2); + if (x == (char *)MAP_FAILED) + perror_exit ("test 2 mmap", 9); + + signal (SIGSEGV, sigsegv); + if (setjmp (r)) + perror_exit ("test 2 fault", 10); + + x[0] = 1; + x[pg] = 1; + + if (munmap (x, pg) < 0) + perror_exit ("test 2 munmap 1", 11); + + x[pg] = 2; + + if (setjmp (r) == 0) + { + x[0] = 1; + perror_exit ("test 2 no fault", 12); + } + + if (munmap (x+pg, pg) < 0) + perror_exit ("test 2 munmap 2", 13); +} + +/* 3. If we map two adjacent 1-page regions and unmap them both with + one munmap, both must go away. + + Getting two adjacent 1-page regions with two mmap calls is slightly + tricky. All OS's tested skip over already-allocated blocks; therefore + we have been careful to unmap all allocated regions in previous tests. + HP/UX allocates pages backward in memory. No OS has yet been observed + to be so perverse as to leave unmapped space between consecutive calls + to mmap. */ + +static void +test_3 () +{ + char *x, *y, *z; + + x = anonmap (pg); + if (x == (char *)MAP_FAILED) + perror_exit ("test 3 mmap 1", 14); + y = anonmap (pg); + if (y == (char *)MAP_FAILED) + perror_exit ("test 3 mmap 2", 15); + + if (y != x + pg) + { + if (y == x - pg) + z = y, y = x, x = z; + else + { + fprintf (stderr, "test 3 nonconsecutive pages - %lx, %lx\n", + (unsigned long)x, (unsigned long)y); + exit (16); + } + } + + signal (SIGSEGV, sigsegv); + if (setjmp (r)) + perror_exit ("test 3 fault", 17); + + x[0] = 1; + y[0] = 1; + + if (munmap (x, pg*2) < 0) + perror_exit ("test 3 munmap", 18); + + if (setjmp (r) == 0) + { + x[0] = 1; + perror_exit ("test 3 no fault 1", 19); + } + + signal (SIGSEGV, sigsegv); + if (setjmp (r) == 0) + { + y[0] = 1; + perror_exit ("test 3 no fault 2", 20); + } +} + +int +main () +{ + sigemptyset (&unblock_sigsegv); + sigaddset (&unblock_sigsegv, SIGSEGV); + pg = getpagesize (); +#ifndef USE_MAP_ANON + devzero = open ("/dev/zero", O_RDWR); + if (devzero < 0) + perror_exit ("open /dev/zero", 1); +#endif + + test_0(); + test_1(); + test_2(); + test_3(); exit(0); } EOF -if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + +echo $ac_n "checking for working mmap from /dev/zero""... $ac_c" 1>&6 +echo "configure:3498: checking for working mmap from /dev/zero" >&5 +if eval "test \"`echo '$''{'ac_cv_func_mmap_dev_zero'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + # If this is not cygwin, and /dev/zero is a character device, it's probably + # safe to assume it works. + case "$host_os" in + cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;; + * ) if test -c /dev/zero + then ac_cv_func_mmap_dev_zero=yes + else ac_cv_func_mmap_dev_zero=no + fi ;; + esac +else + cat > conftest.$ac_ext <<EOF +#line 3514 "configure" +#include "confdefs.h" +#include "ct-mmap.inc" +EOF +if { (eval echo configure:3518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_mmap_dev_zero=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + if test $? -lt 4 + then ac_cv_func_mmap_dev_zero=no + else ac_cv_func_mmap_dev_zero=buggy + fi +fi +rm -fr conftest* +fi + + +fi + +echo "$ac_t""$ac_cv_func_mmap_dev_zero" 1>&6 +if test $ac_cv_func_mmap_dev_zero = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_MMAP_DEV_ZERO 1 +EOF + +fi + +echo $ac_n "checking for working mmap with MAP_ANON(YMOUS)""... $ac_c" 1>&6 +echo "configure:3545: checking for working mmap with MAP_ANON(YMOUS)" >&5 +if eval "test \"`echo '$''{'ac_cv_func_mmap_anon'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + # Unlike /dev/zero, it is not safe to assume MAP_ANON(YMOUS) works + # just because it's there. Some SCO Un*xen define it but don't implement it. + ac_cv_func_mmap_anon=no +else + cat > conftest.$ac_ext <<EOF +#line 3555 "configure" +#include "confdefs.h" +#define USE_MAP_ANON +#include "ct-mmap.inc" +EOF +if { (eval echo configure:3560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then - ac_cv_func_mmap_anywhere=yes + ac_cv_func_mmap_anon=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - ac_cv_func_mmap_anywhere=no + if test $? -lt 4 + then ac_cv_func_mmap_anon=no + else ac_cv_func_mmap_anon=buggy + fi fi rm -fr conftest* fi + fi -echo "$ac_t""$ac_cv_func_mmap_anywhere" 1>&6 -if test $ac_cv_func_mmap_anywhere = yes; then +echo "$ac_t""$ac_cv_func_mmap_anon" 1>&6 +if test $ac_cv_func_mmap_anon = yes; then cat >> confdefs.h <<\EOF -#define HAVE_MMAP_ANYWHERE 1 +#define HAVE_MMAP_ANON 1 EOF fi +rm -f ct-mmap.inc echo $ac_n "checking for working mmap of a file""... $ac_c" 1>&6 -echo "configure:3406: checking for working mmap of a file" >&5 +echo "configure:3588: checking for working mmap of a file" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_file'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3417,7 +3599,7 @@ if test "$cross_compiling" = yes; then ac_cv_func_mmap_file=no else cat > conftest.$ac_ext <<EOF -#line 3421 "configure" +#line 3603 "configure" #include "confdefs.h" /* Test by Zack Weinberg. Modified from MMAP_ANYWHERE test by @@ -3454,7 +3636,7 @@ int main() exit(0); } EOF -if { (eval echo configure:3458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_file=yes else @@ -3487,12 +3669,12 @@ for ac_func in bcopy \ do ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 -echo "configure:3491: checking whether $ac_func is declared" >&5 +echo "configure:3673: checking whether $ac_func is declared" >&5 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3496 "configure" +#line 3678 "configure" #include "confdefs.h" #include "gansidecl.h" #include "system.h" @@ -3503,7 +3685,7 @@ char *(*pfn) = (char *(*)) $ac_func ; #endif ; return 0; } EOF -if { (eval echo configure:3507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_have_decl_$ac_func=yes" else @@ -3596,12 +3778,12 @@ for ac_func in getrlimit setrlimit getrusage do ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6 -echo "configure:3600: checking whether $ac_func is declared" >&5 +echo "configure:3782: checking whether $ac_func is declared" >&5 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3605 "configure" +#line 3787 "configure" #include "confdefs.h" #include "gansidecl.h" #include "system.h" @@ -3616,7 +3798,7 @@ char *(*pfn) = (char *(*)) $ac_func ; #endif ; return 0; } EOF -if { (eval echo configure:3620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "gcc_cv_have_decl_$ac_func=yes" else @@ -3659,12 +3841,12 @@ CFLAGS="$saved_CFLAGS" # mkdir takes a single argument on some systems. echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6 -echo "configure:3663: checking if mkdir takes one argument" >&5 +echo "configure:3845: checking if mkdir takes one argument" >&5 if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3668 "configure" +#line 3850 "configure" #include "confdefs.h" #include <sys/types.h> @@ -3681,7 +3863,7 @@ int main() { mkdir ("foo", 0); ; return 0; } EOF -if { (eval echo configure:3685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gcc_cv_mkdir_takes_one_arg=no else @@ -3992,7 +4174,7 @@ fi echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 -echo "configure:3996: checking for strerror in -lcposix" >&5 +echo "configure:4178: checking for strerror in -lcposix" >&5 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4000,7 +4182,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcposix $LIBS" cat > conftest.$ac_ext <<EOF -#line 4004 "configure" +#line 4186 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4011,7 +4193,7 @@ int main() { strerror() ; return 0; } EOF -if { (eval echo configure:4015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4034,18 +4216,18 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4038: checking for working const" >&5 +echo "configure:4220: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4043 "configure" +#line 4225 "configure" #include "confdefs.h" int main() { /* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x; +typedef int charset[2]; const charset x = {0,0}; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; @@ -4088,7 +4270,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:4092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4109,12 +4291,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:4113: checking for off_t" >&5 +echo "configure:4295: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4118 "configure" +#line 4300 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -4142,12 +4324,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:4146: checking for size_t" >&5 +echo "configure:4328: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4151 "configure" +#line 4333 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -4177,19 +4359,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:4181: checking for working alloca.h" >&5 +echo "configure:4363: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4186 "configure" +#line 4368 "configure" #include "confdefs.h" #include <alloca.h> int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -4210,12 +4392,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4214: checking for alloca" >&5 +echo "configure:4396: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4219 "configure" +#line 4401 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -4243,7 +4425,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:4247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -4275,12 +4457,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4279: checking whether alloca needs Cray hooks" >&5 +echo "configure:4461: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4284 "configure" +#line 4466 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -4305,12 +4487,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4309: checking for $ac_func" >&5 +echo "configure:4491: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4314 "configure" +#line 4496 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4333,7 +4515,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4360,7 +4542,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4364: checking stack direction for C alloca" >&5 +echo "configure:4546: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4368,7 +4550,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 4372 "configure" +#line 4554 "configure" #include "confdefs.h" find_stack_direction () { @@ -4387,7 +4569,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:4391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -4414,17 +4596,17 @@ unistd.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4418: checking for $ac_hdr" >&5 +echo "configure:4600: checking for $ac_hdr" >&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 -#line 4423 "configure" +#line 4605 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4610: \"$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* @@ -4454,12 +4636,12 @@ done strdup __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4458: checking for $ac_func" >&5 +echo "configure:4640: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4463 "configure" +#line 4645 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4482,7 +4664,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4511,12 +4693,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4515: checking for $ac_func" >&5 +echo "configure:4697: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4520 "configure" +#line 4702 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4539,7 +4721,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4573,19 +4755,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:4577: checking for LC_MESSAGES" >&5 +echo "configure:4759: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4582 "configure" +#line 4764 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:4589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -4606,7 +4788,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:4610: checking whether NLS is requested" >&5 +echo "configure:4792: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -4626,7 +4808,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:4630: checking whether included gettext is requested" >&5 +echo "configure:4812: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -4645,17 +4827,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:4649: checking for libintl.h" >&5 +echo "configure:4831: checking for libintl.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 -#line 4654 "configure" +#line 4836 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4841: \"$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* @@ -4672,19 +4854,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:4676: checking for gettext in libc" >&5 +echo "configure:4858: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4681 "configure" +#line 4863 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:4688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -4700,7 +4882,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:4704: checking for bindtextdomain in -lintl" >&5 +echo "configure:4886: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4708,7 +4890,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4712 "configure" +#line 4894 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4719,7 +4901,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:4723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4735,12 +4917,12 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:4739: checking for gettext in libintl" >&5 +echo "configure:4921: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:4744: checking for gettext in -lintl" >&5 +echo "configure:4926: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4748,7 +4930,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4752 "configure" +#line 4934 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4759,7 +4941,7 @@ int main() { gettext() ; return 0; } EOF -if { (eval echo configure:4763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4798,7 +4980,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4802: checking for $ac_word" >&5 +echo "configure:4984: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4832,12 +5014,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4836: checking for $ac_func" >&5 +echo "configure:5018: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4841 "configure" +#line 5023 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4860,7 +5042,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4887,7 +5069,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4891: checking for $ac_word" >&5 +echo "configure:5073: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4923,7 +5105,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4927: checking for $ac_word" >&5 +echo "configure:5109: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4955,7 +5137,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 4959 "configure" +#line 5141 "configure" #include "confdefs.h" int main() { @@ -4963,7 +5145,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:4967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4988,7 +5170,7 @@ fi if test "$CATOBJEXT" = "NONE"; then echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:4992: checking whether catgets can be used" >&5 +echo "configure:5174: checking whether catgets can be used" >&5 # Check whether --with-catgets or --without-catgets was given. if test "${with_catgets+set}" = set; then withval="$with_catgets" @@ -5001,7 +5183,7 @@ fi if test "$nls_cv_use_catgets" = "yes"; then echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:5005: checking for main in -li" >&5 +echo "configure:5187: checking for main in -li" >&5 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5009,14 +5191,14 @@ else ac_save_LIBS="$LIBS" LIBS="-li $LIBS" cat > conftest.$ac_ext <<EOF -#line 5013 "configure" +#line 5195 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:5020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5044,12 +5226,12 @@ else fi echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:5048: checking for catgets" >&5 +echo "configure:5230: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5053 "configure" +#line 5235 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char catgets(); below. */ @@ -5072,7 +5254,7 @@ catgets(); ; return 0; } EOF -if { (eval echo configure:5076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -5094,7 +5276,7 @@ EOF # Extract the first word of "gencat", so it can be a program name with args. set dummy gencat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5098: checking for $ac_word" >&5 +echo "configure:5280: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_GENCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5130,7 +5312,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5134: checking for $ac_word" >&5 +echo "configure:5316: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5167,7 +5349,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5171: checking for $ac_word" >&5 +echo "configure:5353: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5205,7 +5387,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5209: checking for $ac_word" >&5 +echo "configure:5391: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5263,7 +5445,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5267: checking for $ac_word" >&5 +echo "configure:5449: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5297,7 +5479,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5301: checking for $ac_word" >&5 +echo "configure:5483: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5336,7 +5518,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5340: checking for $ac_word" >&5 +echo "configure:5522: checking for $ac_word" >&5 if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5435,7 +5617,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:5439: checking for catalogs to be installed" >&5 +echo "configure:5621: checking for catalogs to be installed" >&5 if test "x$LINGUAS" = "x"; then LINGUAS=$ALL_LINGUAS else @@ -5467,17 +5649,17 @@ echo "configure:5439: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:5471: checking for linux/version.h" >&5 +echo "configure:5653: checking for linux/version.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 -#line 5476 "configure" +#line 5658 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5663: \"$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* @@ -5552,7 +5734,7 @@ fi echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6 -echo "configure:5556: checking whether windows registry support is requested" >&5 +echo "configure:5738: checking whether windows registry support is requested" >&5 if test x$enable_win32_registry != xno; then cat >> confdefs.h <<\EOF #define ENABLE_WIN32_REGISTRY 1 @@ -5581,7 +5763,7 @@ esac if test x$enable_win32_registry != xno; then echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6 -echo "configure:5585: checking registry key on windows hosts" >&5 +echo "configure:5767: checking registry key on windows hosts" >&5 cat >> confdefs.h <<EOF #define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key" EOF @@ -5761,7 +5943,7 @@ fi # Figure out what assembler we will be using. echo $ac_n "checking what assembler to use""... $ac_c" 1>&6 -echo "configure:5765: checking what assembler to use" >&5 +echo "configure:5947: checking what assembler to use" >&5 gcc_cv_as= gcc_cv_gas_major_version= gcc_cv_gas_minor_version= @@ -5846,7 +6028,7 @@ fi # Figure out what nm we will be using. echo $ac_n "checking what nm to use""... $ac_c" 1>&6 -echo "configure:5850: checking what nm to use" >&5 +echo "configure:6032: checking what nm to use" >&5 if test -x nm$host_exeext; then gcc_cv_nm=./nm$host_exeext elif test x$host = x$target; then @@ -5857,7 +6039,7 @@ echo "$ac_t""$gcc_cv_nm" 1>&6 # Figure out what assembler alignment features are present. echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6 -echo "configure:5861: checking assembler alignment features" >&5 +echo "configure:6043: checking assembler alignment features" >&5 gcc_cv_as_alignment_features=none if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then # Gas version 2.6 and later support for .balign and .p2align. @@ -5905,7 +6087,7 @@ fi echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6 echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6 -echo "configure:5909: checking assembler subsection support" >&5 +echo "configure:6091: checking assembler subsection support" >&5 gcc_cv_as_subsections=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then @@ -5945,7 +6127,7 @@ fi echo "$ac_t""$gcc_cv_as_subsections" 1>&6 echo $ac_n "checking assembler weak support""... $ac_c" 1>&6 -echo "configure:5949: checking assembler weak support" >&5 +echo "configure:6131: checking assembler weak support" >&5 gcc_cv_as_weak=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then @@ -5968,7 +6150,7 @@ fi echo "$ac_t""$gcc_cv_as_weak" 1>&6 echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6 -echo "configure:5972: checking assembler hidden support" >&5 +echo "configure:6154: checking assembler hidden support" >&5 gcc_cv_as_hidden=no if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then @@ -5994,7 +6176,7 @@ echo "$ac_t""$gcc_cv_as_hidden" 1>&6 case "$target" in sparc*-*-*) echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6 -echo "configure:5998: checking assembler .register pseudo-op support" >&5 +echo "configure:6180: checking assembler .register pseudo-op support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6022,7 +6204,7 @@ EOF fi echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6 -echo "configure:6026: checking assembler supports -relax" >&5 +echo "configure:6208: checking assembler supports -relax" >&5 if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6052,7 +6234,7 @@ EOF case "$tm_file" in *64*) echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6 -echo "configure:6056: checking for 64 bit support in assembler ($gcc_cv_as)" >&5 +echo "configure:6238: checking for 64 bit support in assembler ($gcc_cv_as)" >&5 if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6097,7 +6279,7 @@ EOF if test "x$gcc_cv_as_flags64" != xno; then echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6 -echo "configure:6101: checking for assembler offsetable %lo() support" >&5 +echo "configure:6283: checking for assembler offsetable %lo() support" >&5 if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6136,7 +6318,7 @@ EOF i[34567]86-*-*) echo $ac_n "checking assembler instructions""... $ac_c" 1>&6 -echo "configure:6140: checking assembler instructions" >&5 +echo "configure:6322: checking assembler instructions" >&5 gcc_cv_as_instructions= if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then @@ -6165,7 +6347,7 @@ EOF esac echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6 -echo "configure:6169: checking assembler dwarf2 debug_line support" >&5 +echo "configure:6351: checking assembler dwarf2 debug_line support" >&5 gcc_cv_as_dwarf2_debug_line=no # ??? Not all targets support dwarf2 debug_line, even within a version # of gas. Moreover, we need to emit a valid instruction to trigger any @@ -6284,7 +6466,8 @@ if test "${with_gc+set}" = set; then ;; esac else - if test $ac_cv_func_mmap_anywhere = yes \ + if test $ac_cv_func_mmap_dev_zero = yes \ + || test $ac_cv_func_mmap_anon = yes \ || test $ac_cv_func_valloc = yes; then GGC=ggc-page else @@ -6338,7 +6521,7 @@ EOF echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:6342: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:6525: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" diff --git a/gcc/configure.in b/gcc/configure.in index b0dd69777d1..e318236bdea 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -1565,7 +1565,8 @@ AC_ARG_WITH(gc, AC_MSG_ERROR([$withval is an invalid option to --with-gc]) ;; esac], -[if test $ac_cv_func_mmap_anywhere = yes \ +[if test $ac_cv_func_mmap_dev_zero = yes \ + || test $ac_cv_func_mmap_anon = yes \ || test $ac_cv_func_valloc = yes; then GGC=ggc-page else diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 73dc4d1b4c1..b5c6d57be74 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -29,16 +29,37 @@ Boston, MA 02111-1307, USA. */ #include "ggc.h" #include "timevar.h" -#ifdef HAVE_MMAP_ANYWHERE -#include <sys/mman.h> +/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a + file open. Prefer either to valloc. */ +#ifdef HAVE_MMAP_ANON +# undef HAVE_MMAP_DEV_ZERO +# undef HAVE_VALLOC + +# include <sys/mman.h> +# ifndef MAP_FAILED +# define MAP_FAILED -1 +# endif +# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) +# define MAP_ANONYMOUS MAP_ANON +# endif +# define USING_MMAP + #endif -#ifndef MAP_FAILED -#define MAP_FAILED -1 +#ifdef HAVE_MMAP_DEV_ZERO +# undef HAVE_VALLOC + +# include <sys/mman.h> +# ifndef MAP_FAILED +# define MAP_FAILED -1 +# endif +# define USING_MMAP + #endif -#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) -#define MAP_ANONYMOUS MAP_ANON +#ifdef HAVE_VALLOC +# undef MAP_FAILED +# define MAP_FAILED 0 #endif /* Stategy: @@ -279,7 +300,7 @@ static struct globals unsigned short context_depth; /* A file descriptor open to /dev/zero for reading. */ -#if defined (HAVE_MMAP_ANYWHERE) && !defined(MAP_ANONYMOUS) +#if defined (HAVE_MMAP_DEV_ZERO) int dev_zero_fd; #endif @@ -445,38 +466,31 @@ debug_print_page_list (order) } /* Allocate SIZE bytes of anonymous memory, preferably near PREF, - (if non-null). */ + (if non-null). The ifdef structure here is intended to cause a + compile error unless exactly one of the HAVE_* is defined. */ static inline char * alloc_anon (pref, size) char *pref ATTRIBUTE_UNUSED; size_t size; { - char *page; - -#ifdef HAVE_MMAP_ANYWHERE -#ifdef MAP_ANONYMOUS - page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); -#else - page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE, - MAP_PRIVATE, G.dev_zero_fd, 0); +#ifdef HAVE_MMAP_ANON + char *page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#endif +#ifdef HAVE_MMAP_DEV_ZERO + char *page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE, + MAP_PRIVATE, G.dev_zero_fd, 0); #endif - if (page == (char *) MAP_FAILED) - { - fputs ("Virtual memory exhausted!\n", stderr); - exit(1); - } -#else #ifdef HAVE_VALLOC - page = (char *) valloc (size); - if (!page) + char *page = (char *) valloc (size); +#endif + + if (page == (char *) MAP_FAILED) { fputs ("Virtual memory exhausted!\n", stderr); exit(1); } -#endif /* HAVE_VALLOC */ -#endif /* HAVE_MMAP_ANYWHERE */ /* Remember that we allocated this memory. */ G.bytes_mapped += size; @@ -526,7 +540,7 @@ alloc_page (order) else free (p); } -#ifdef HAVE_MMAP_ANYWHERE +#ifdef USING_MMAP else if (entry_size == G.pagesize) { /* We want just one page. Allocate a bunch of them and put the @@ -601,7 +615,7 @@ release_pages () { page_entry *p, *next; -#ifdef HAVE_MMAP_ANYWHERE +#ifdef USING_MMAP char *start; size_t len; @@ -628,8 +642,6 @@ release_pages () G.bytes_mapped -= len; } #else -#ifdef HAVE_VALLOC - for (p = G.free_pages; p; p = next) { next = p->next; @@ -637,8 +649,7 @@ release_pages () G.bytes_mapped -= p->bytes; free (p); } -#endif /* HAVE_VALLOC */ -#endif /* HAVE_MMAP_ANYWHERE */ +#endif /* USING_MMAP */ G.free_pages = NULL; } @@ -849,7 +860,7 @@ init_ggc () G.pagesize = getpagesize(); G.lg_pagesize = exact_log2 (G.pagesize); -#if defined (HAVE_MMAP_ANYWHERE) && !defined(MAP_ANONYMOUS) +#ifdef HAVE_MMAP_DEV_ZERO G.dev_zero_fd = open ("/dev/zero", O_RDONLY); if (G.dev_zero_fd == -1) abort (); @@ -863,13 +874,14 @@ init_ggc () G.allocated_last_gc = GGC_MIN_LAST_ALLOCATED; -#ifdef HAVE_MMAP_ANYWHERE +#ifdef USING_MMAP /* StunOS has an amazing off-by-one error for the first mmap allocation after fiddling with RLIMIT_STACK. The result, as hard as it is to believe, is an unaligned page allocation, which would cause us to hork badly if we tried to use it. */ { char *p = alloc_anon (NULL, G.pagesize); + struct page_entry *e; if ((size_t)p & (G.pagesize - 1)) { /* How losing. Discard this one and try another. If we still @@ -879,7 +891,13 @@ init_ggc () if ((size_t)p & (G.pagesize - 1)) abort (); } - munmap (p, G.pagesize); + + /* We have a good page, might as well hold onto it... */ + e = (struct page_entry *) xcalloc (1, sizeof (struct page_entry)); + e->bytes = G.pagesize; + e->page = p; + e->next = G.free_pages; + G.free_pages = e; } #endif |