From 0028f9d0cba36d970d3aaed1fda5658c03eb5f26 Mon Sep 17 00:00:00 2001 From: "ro@138bc75d-0d04-0410-961f-82ee72b054a4" Date: Fri, 16 Apr 2010 13:45:25 +0000 Subject: [PATCH] toplevel: * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx separately. * configure: Regenerate. gcc: * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx flavor. * configure: Regenerate. * config.in: Regenerate. * doc/install.texi (Prerequisites): Document that Solaris 2 libelf works. gcc/lto: * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158423 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog | 6 ++ configure | 56 +++++++++++++- configure.ac | 22 +++++- gcc/ChangeLog | 9 +++ gcc/configure | 57 +++++++++++++- gcc/configure.ac | 16 ++++ gcc/doc/install.texi | 2 +- gcc/lto/ChangeLog | 211 --------------------------------------------------- 8 files changed, 163 insertions(+), 216 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b7bb8844e3..7705ea9a571 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-16 Rainer Orth + + * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx + separately. + * configure: Regenerate. + 2010-04-16 Kevin Williams * MAINTAINERS (Write After Approval): Add myself. diff --git a/configure b/configure index 115bf29e317..60a82b6cb64 100755 --- a/configure +++ b/configure @@ -6574,7 +6574,6 @@ main () elf_nextscn (0, 0); elf_strptr (0, 0, 0); elf_getident (0, 0); - elf_getshdrstrndx (0, 0); elf_begin (0, 0, 0); elf_ndxscn (0); elf_end (0); @@ -6594,6 +6593,61 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + # Check for elf_getshdrstrndx or elf_getshstrndx. The latter's flavor + # is determined in gcc/configure.ac. + if test x"$enable_lto" = x"yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_getshdrstrndx" >&5 +$as_echo_n "checking for elf_getshdrstrndx... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + elf_getshdrstrndx (0, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_getshstrndx" >&5 +$as_echo_n "checking for elf_getshstrndx... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + + elf_getshstrndx (0, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; }; enable_lto=no; libelflibs= ; libelfinc= + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + # If we couldn't enable LTO and the user forced it, emit an error. if test x"$enable_lto" = x"no" \ && test x"$default_enable_lto" != x"yes" ; then diff --git a/configure.ac b/configure.ac index 43d6d5d4511..e632242cb53 100644 --- a/configure.ac +++ b/configure.ac @@ -1735,7 +1735,6 @@ if test x"$enable_lto" = x"yes" ; then elf_nextscn (0, 0); elf_strptr (0, 0, 0); elf_getident (0, 0); - elf_getshdrstrndx (0, 0); elf_begin (0, 0, 0); elf_ndxscn (0); elf_end (0); @@ -1744,6 +1743,27 @@ if test x"$enable_lto" = x"yes" ; then [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ] ) + # Check for elf_getshdrstrndx or elf_getshstrndx. The latter's flavor + # is determined in gcc/configure.ac. + if test x"$enable_lto" = x"yes" ; then + AC_MSG_CHECKING([for elf_getshdrstrndx]) + AC_TRY_LINK( + [#include ],[ + elf_getshdrstrndx (0, 0); + ], + [AC_MSG_RESULT([yes]);], + [AC_MSG_RESULT([no]); + AC_MSG_CHECKING([for elf_getshstrndx]) + AC_TRY_LINK( + [#include ],[ + elf_getshstrndx (0, 0); + ], + [AC_MSG_RESULT([yes]);], + [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ] + )] + ) + fi + # If we couldn't enable LTO and the user forced it, emit an error. if test x"$enable_lto" = x"no" \ && test x"$default_enable_lto" != x"yes" ; then diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9d4f92fc9e..a50a6ac32cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-04-16 Rainer Orth + + * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx + flavor. + * configure: Regenerate. + * config.in: Regenerate. + * doc/install.texi (Prerequisites): Document that Solaris 2 libelf + works. + 2010-04-16 Richard Guenther * tree.h (struct tree_decl_minimal): Move pt_uid ... diff --git a/gcc/configure b/gcc/configure index 2b8001994e2..de9cc72db7f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -8426,6 +8426,59 @@ fi done +save_CPPFLAGS="$CPPFLAGS" +save_LIBS="$LIBS" +LIBS="$LIBS $LIBELFLIBS" +for ac_func in elf_getshdrstrndx +do : + ac_fn_c_check_func "$LINENO" "elf_getshdrstrndx" "ac_cv_func_elf_getshdrstrndx" +if test "x$ac_cv_func_elf_getshdrstrndx" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ELF_GETSHDRSTRNDX 1 +_ACEOF + +else + for ac_func in elf_getshstrndx +do : + ac_fn_c_check_func "$LINENO" "elf_getshstrndx" "ac_cv_func_elf_getshstrndx" +if test "x$ac_cv_func_elf_getshstrndx" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ELF_GETSHSTRNDX 1 +_ACEOF + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +int main() +{ + return elf_getshstrndx (NULL, 0) == 0; +}, +$as_echo "#define HAVE_ELF_GETSHSTRNDX_GABI 1" >>confdefs.h + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +done + + +fi +done + +LIBS="$save_LIBS" +CPPFLAGS="$save_CPPFLAGS" + if test x$ac_cv_func_mbstowcs = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbstowcs works" >&5 $as_echo_n "checking whether mbstowcs works... " >&6; } @@ -17039,7 +17092,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17042 "configure" +#line 17095 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17145,7 +17198,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17148 "configure" +#line 17201 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 37843387f33..d256b62b104 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1024,6 +1024,22 @@ AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \ gettimeofday mbstowcs wcswidth mmap mincore setlocale \ gcc_UNLOCKED_FUNCS) +save_CPPFLAGS="$CPPFLAGS" +save_LIBS="$LIBS" +LIBS="$LIBS $LIBELFLIBS" +AC_CHECK_FUNCS(elf_getshdrstrndx,, + [AC_CHECK_FUNCS(elf_getshstrndx, + [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include +#include +int main() +{ + return elf_getshstrndx (NULL, 0) == 0; +}]]), AC_DEFINE(HAVE_ELF_GETSHSTRNDX_GABI, 1, + [Define if elf_getshstrndx has gABI conformant return values.])])])] + ) +LIBS="$save_LIBS" +CPPFLAGS="$save_CPPFLAGS" + if test x$ac_cv_func_mbstowcs = xyes; then AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works, [ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index b91716906fc..f65b29fc24a 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -361,7 +361,7 @@ Necessary to build link-time optimization (LTO) support. It can be downloaded from @uref{http://www.mr511.de/software/libelf-0.8.12.tar.gz}, though it is commonly available in several systems. The versions in IRIX 5 and 6 don't work since they lack @file{gelf.h}. The version in -recent releases of Solaris 11 does work, previous ones don't yet. +Solaris 2 does work. The @option{--with-libelf} configure option should be used if libelf is not installed in your default library search patch. diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 83cfe3e3e90..20b89d69761 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,214 +1,3 @@ -2010-05-22 Richard Guenther - - * lto.c (read_cgraph_and_symbols): Do not collect. - -2010-05-20 Jan Hubicka - - * lto.c (promote_var, promote_fn): New functions. - (lto_promote_cross_file_statics): Compute correctly boundary including - static initializers of readonly vars. - -2010-05-18 Jan Hubicka - - * lto.c (lto_1_to_1_map): Partition non-inline clones. - (lto_promote_cross_file_statics): Deal with non-inline clones. - -2010-05-18 Jan Hubicka - - * lto.c (lto_materialize_function): Announce function when - reading body; allocate_struct_function only when reading body; - do not finalize local statics; ggc_collect after reading; - do not mark reachable node. - (materialize_cgraph): Do not announce function. - -2010-05-11 Jan Hubicka - - * lto.c (materialize_cgraph): Revert my previous patch. - -2010-05-11 Kai Tietz - - * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Rename to - IMAGE_FILE_MACHINE_AMD64. - * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Likewise. - -2010-05-11 Jan Hubicka - - * lto.c (lto_fixup_decls): Remove global var decls freeing here. - (materialize_cgraph): Add it here. - -2010-05-11 Jan Hubicka - - * lto.c (lto_fixup_decls): Free no longer needed lto_global_var_decls - vector. - -2010-05-11 Jan Hubicka - - * lto.c (lto_1_to_1_map): Remove some no longer needed checks. - (lto_promote_cross_file_statics): Never promote DECL_EXTERNAL; - use reachable_from_other_partition_p and - referenced_from_other_partition_p test. - -2010-05-11 Kai Tietz - - * lto-coff.c (validate_file): Add x64-coff support. - * lto-coff.h (IMAGE_FILE_MACHINE_ADM64): New. - (COFF_KNOWN_MACHINES): Add IMAGE_FILE_MACHINE_ADM64. - * lto-lang.c (lto_build_c_type_nodes): Add check for - 'long long unsigned int' for x64-windows. - (lto_init): Likewise. - - -2010-05-07 Steven Bosscher - - * lto.h (struct lto_file_struct): Document offset member. - * lto-endian.h: New file. - * lto-macho.h: New file. - * lto-macho.c: New file. - * Make-lang.in: Add rule for lto-macho.o. - -2010-05-07 Richard Guenther - - PR lto/43857 - PR lto/43371 - * lang.opt (fresolution): Change to ... - (fresolution=): ... this. - * lto-lang.c (lto_handle_option): Adjust. - -2010-05-07 Richard Guenther - - * lto.c (DUMPBASE_SUFFIX): Remove. - (lto_execute_ltrans): Move functionality to lto-wrapper.c. - Rename to ... - (lto_write_ltrans_list): ... only output the list of ltrans files. - (lto_maybe_unlink): Remove. - (do_whole_program_analysis): Do not execute LTRANS phase - from here. - -2010-05-06 H.J. Lu - - * lto-lang.c (lto_handle_option): Add argument kind. - -2010-05-05 Jan Hubicka - - * lto.c (lto_promote_cross_file_statics): Compute boundary based on - refs. - -2010-05-05 Jan Hubicka - - * lto.c (lto_1_to_1_map): Partition only needed nodes. - -2010-04-30 Jan Hubicka - - * lto.c (get_filename_for_set): Look for cgraph node and if none found, use - default name. - (lto_wpa_write_files): Write any non-empty partition. - -2010-04-30 Jan Hubicka - - * lto.c: Do not attempt to make constant pool references global. - -2010-04-28 Jan Hubicka - - * lto/lto.c (lto_read_in_decl_state): Use GGC. - (lto_wpa_write_files): Announce what we are writting. - (all_file_decl_data): New. - (read_cgraph_and_symbols): Use GGC; correct timevars. - (do_whole_program_analysis): Collect. - * lto/Make-lang.in (lto.o): Fix dependency. - * Makefile.in (GTFILES): Add lto-streamer.h. - * varpool.c (varpool_analyze_pending_decls): Use TV_VARPOOL. - (varpool_assemble_pending_decls): Use VAROUT. - * lto-streamer.h (lto_tree_ref_table): Annotate. - (lto_in_decl_state): Annotate. - (lto_file_decl_data): Annotate. - -2010-04-28 Jan Hubicka - - * lto.c (lto_varpool_node_sets): New. - (lto_1_to_1_map): Partition varpool too. - (globalize_context_t, globalize_cross_file_statics, - lto_scan_statics_in_ref_table, lto_scan_statics_in_cgraph_node, - lto_scan_statics_in_remaining_global_vars): Remove. - (lto_promote_cross_file_statics): Rewrite. - (get_filename_for_set): Take vset argument. - (lto_wpa_write_files): Pass around vsets. - -2010-04-27 Dave Korn - - PR lto/42776 - * Make-lang.in (LTO_OBJS): Use LTO_BINARY_READER instead of - hardcoding 'lto-elf.o'. - ($(LTO_EXE)): Use LTO_USE_LIBELF instead of hardcoding '-lelf'. - - * lto-coff.h: New file. - * lto-coff.c: Likewise. - -2010-04-26 Richard Guenther - - * lto.c (lto_fixup_type): Deal with non-type TYPE_CONTEXT. - -2010-04-26 Dave Korn - - * lto.h (lto_elf_file_open): Rename prototype from this ... - (lto_obj_file_open): ... to this. - (lto_elf_file_close): Likewise ... - (lto_obj_file_close): ... and likewise. - (lto_elf_build_section_table): Likewise ... - (lto_obj_build_section_table): ... and likewise. - (lto_elf_begin_section): Likewise ... - (lto_obj_begin_section): ... and likewise. - (lto_elf_append_data): Likewise ... - (lto_obj_append_data): ... and likewise. - (lto_elf_end_section): Likewise ... - (lto_obj_end_section): ... and likewise. - * lto.c (lto_file_read): Update references to the above. - (lto_wpa_write_files): Likewise. - (lto_read_all_file_options): Likewise. - (read_cgraph_and_symbols): Likewise. - * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise. - (LANG_HOOKS_APPEND_DATA): Likewise. - (LANG_HOOKS_END_SECTION): Likewise. - * lto-elf.c (lto_elf_file_open): Rename from this ... - (lto_obj_file_open): ... to this, updating any references. - (lto_elf_file_close): Likewise ... - (lto_obj_file_close): ... and likewise. - (lto_elf_build_section_table): Likewise ... - (lto_obj_build_section_table): ... and likewise. - (lto_elf_begin_section): Likewise ... - (lto_obj_begin_section): ... and likewise. - (lto_elf_append_data): Likewise ... - (lto_obj_append_data): ... and likewise. - (lto_elf_end_section): Likewise ... - (lto_obj_end_section): ... and likewise. - -2010-04-21 Jan Hubicka - - * lto.c (lto_fixup_tree): Do not call wpa fixup. - (materialize_cgraph): Likewise. - -2010-04-21 Jan Hubicka - - * lto.c (lto_wpa_write_files): Update. - (read_cgraph_and_symbols): Be more verbose. - (materialize_cgraph): Likewise. - (do_whole_program_analysis): Likewise. - -2010-04-21 Jan Hubicka - - * lto.c (globalize_cross_file_statics): When function has address taken, - it needs to be public. - -2010-04-20 Jan Hubicka - - * lto.c (lto_add_inline_clones): Do not track inlined_decls. - (lto_add_all_inlinees): Likewise. - (lto_wpa_write_files): Likewise. - -2010-04-18 Eric Botcazou - - * lto-lang.c (lto_init): Remove second argument in call to - build_common_tree_nodes. - 2010-04-16 Rainer Orth * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New -- 2.11.0