From: davek Date: Tue, 27 Apr 2010 02:22:40 +0000 (+0000) Subject: ChangeLog: X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=29583db10ef680e898e96c454408ff3bda2afa85 ChangeLog: PR lto/42776 * configure.ac (--enable-lto): Refactor handling so libelf tests are only performed inside then-clause of ACX_ELF_TARGET_IFELSE, and allow LTO to be explicitly enabled on non-ELF platforms that are known to support it inside else-clause. * configure: Regenerate. gcc/ChangeLog: PR lto/42776 * configure.ac (gcc_cv_as_section_has_align): Set if installed binutils supports extended .section directive needed by LTO, or warn if older binutils found. (LTO_BINARY_READER): New AC_SUBST'd variable. (LTO_USE_LIBELF): Likewise. * gcc/config.gcc (lto_binary_reader): New target-specific configure variable. * gcc/Makefile.in (LTO_BINARY_READER): Import AC_SUBST'd autoconf var. (LTO_USE_LIBELF): Likewise. * configure: Regenerate. * collect2.c (is_elf): Rename from this ... (is_elf_or_coff): ... to this, and recognize and allow i386 COFF object files in addition to ELF-formatted ones. (scan_prog_file): Caller updated. Also allow for LTO info marker symbol to be prefixed or not by an extra underscore. * config/i386/t-cygming (winnt.o): Also depend on LTO_STREAMER_H. * config/i386/winnt.c: Also #include lto-streamer.h (i386_pe_asm_named_section): Specify 1-byte section alignment for LTO named sections. (i386_pe_asm_output_aligned_decl_common): Add comment. (i386_pe_maybe_record_exported_symbol): Allow decl arg to be NULL. gcc/lto/ChangeLog: 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. gcc/testsuite/ChangeLog: PR lto/42776 * lib/lto.exp (lto_prune_vis_warns): New function. (lto-link-and-maybe-run): Call it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158762 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/ChangeLog b/ChangeLog index 8a1a4c71668..6105c41ffe8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-04-27 Dave Korn + + PR lto/42776 + * configure.ac (--enable-lto): Refactor handling so libelf tests + are only performed inside then-clause of ACX_ELF_TARGET_IFELSE, + and allow LTO to be explicitly enabled on non-ELF platforms that + are known to support it inside else-clause. + * configure: Regenerate. + 2010-04-20 Eric Botcazou * configure.ac (BUILD_CONFIG): Redirect output to /dev/null. diff --git a/configure.ac b/configure.ac index c46fc4d9946..1ae21407cb8 100644 --- a/configure.ac +++ b/configure.ac @@ -1637,17 +1637,8 @@ AC_ARG_ENABLE(lto, enable_lto=$enableval, enable_lto=yes; default_enable_lto=yes) -ACX_ELF_TARGET_IFELSE([], -if test x"$default_enable_lto" = x"yes" ; then - enable_lto=no -else - if test x"$enable_lto" = x"yes"; then - AC_MSG_ERROR([LTO support requires an ELF target.]) - fi -fi -default_enable_lto=no) -if test x"$enable_lto" = x"yes" ; then +ACX_ELF_TARGET_IFELSE([if test x"$enable_lto" = x"yes" ; then # Make sure that libelf.h and gelf.h are available. AC_ARG_WITH(libelf, [ --with-libelf=PATH Specify prefix directory for the installed libelf package Equivalent to --with-libelf-include=PATH/include @@ -1783,7 +1774,24 @@ to specify its location.]) # Flags needed for libelf. AC_SUBST(libelflibs) AC_SUBST(libelfinc) -fi +fi],[if test x"$default_enable_lto" = x"yes" ; then + # On non-ELF platforms, LTO must be explicitly enabled. + enable_lto=no + else + # Apart from ELF platforms, only Windows supports LTO so far. It + # would also be nice to check the binutils support, but we don't + # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just + # warn during gcc/ subconfigure; unless you're bootstrapping with + # -flto it won't be needed until after installation anyway. + case $target in + *-cygwin*|*-mingw*) ;; + *) if test x"$enable_lto" = x"yes"; then + AC_MSG_ERROR([LTO support is not enabled for this target.]) + fi + ;; + esac + fi + default_enable_lto=no]) # By default, C is the only stage 1 language. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index c82bf15482e..ca685700caa 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -326,6 +326,10 @@ LIBELFINC = @LIBELFINC@ # Set to 'yes' if the LTO front end is enabled. enable_lto = @enable_lto@ +# Set according to LTO object file format. +LTO_BINARY_READER = @LTO_BINARY_READER@ +LTO_USE_LIBELF = @LTO_USE_LIBELF@ + # Compiler needed for plugin support PLUGINCC = @CC@ diff --git a/gcc/collect2.c b/gcc/collect2.c index 42db3cbf0ff..ad66202642d 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -35,10 +35,6 @@ along with GCC; see the file COPYING3. If not see # define SIGCHLD SIGCLD #endif -/* TARGET_64BIT may be defined to use driver specific functionality. */ -#undef TARGET_64BIT -#define TARGET_64BIT TARGET_64BIT_DEFAULT - #ifndef LIBRARY_PATH_ENV #define LIBRARY_PATH_ENV "LIBRARY_PATH" #endif @@ -178,7 +174,7 @@ struct head int number; }; -bool vflag; /* true if -v or --version */ +int vflag; /* true if -v */ static int rflag; /* true if -r */ static int strip_flag; /* true if -s */ static const char *demangle_flag; @@ -197,8 +193,7 @@ enum lto_mode_d { /* Current LTO mode. */ static enum lto_mode_d lto_mode = LTO_MODE_NONE; -bool debug; /* true if -debug */ -bool helpflag; /* true if --help */ +int debug; /* true if -debug */ static int shared_obj; /* true if -shared */ @@ -940,8 +935,10 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, if (lto_objects.first) { + const char *opts; char **lto_c_argv; const char **lto_c_ptr; + const char *cp; const char **p, **q, **r; const char **lto_o_ptr; struct lto_object *list; @@ -952,15 +949,52 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, if (!lto_wrapper) fatal ("COLLECT_LTO_WRAPPER must be set."); - num_lto_c_args++; - /* There is at least one object file containing LTO info, so we need to run the LTO back end and relink. */ + /* Get compiler options passed down from the parent `gcc' command. + These must be passed to the LTO back end. */ + opts = getenv ("COLLECT_GCC_OPTIONS"); + + /* Increment the argument count by the number of inherited options. + Some arguments may be filtered out later. Again, an upper bound + suffices. */ + + cp = opts; + + while (cp && *cp) + { + extract_string (&cp); + num_lto_c_args++; + } + obstack_free (&temporary_obstack, temporary_firstobj); + + if (debug) + num_lto_c_args++; + + /* Increment the argument count by the number of initial + arguments added below. */ + num_lto_c_args += 9; + lto_c_argv = (char **) xcalloc (sizeof (char *), num_lto_c_args); lto_c_ptr = CONST_CAST2 (const char **, char **, lto_c_argv); *lto_c_ptr++ = lto_wrapper; + *lto_c_ptr++ = c_file_name; + + cp = opts; + + while (cp && *cp) + { + const char *s = extract_string (&cp); + + /* Pass the option or argument to the wrapper. */ + *lto_c_ptr++ = xstrdup (s); + } + obstack_free (&temporary_obstack, temporary_firstobj); + + if (debug) + *lto_c_ptr++ = xstrdup ("-debug"); /* Add LTO objects to the wrapper command line. */ for (list = lto_objects.first; list; list = list->next) @@ -968,6 +1002,10 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst, *lto_c_ptr = NULL; + /* Save intermediate WPA files in lto1 if debug. */ + if (debug) + putenv (xstrdup ("WPA_SAVE_LTRANS=1")); + /* Run the LTO back end. */ pex = collect_execute (prog, lto_c_argv, NULL, NULL, PEX_SEARCH); { @@ -1201,13 +1239,13 @@ main (int argc, char **argv) for (i = 1; argv[i] != NULL; i ++) { if (! strcmp (argv[i], "-debug")) - debug = true; + debug = 1; else if (! strcmp (argv[i], "-flto") && ! use_plugin) { use_verbose = true; lto_mode = LTO_MODE_LTO; } - else if (! strncmp (argv[i], "-fwhopr", 7) && ! use_plugin) + else if (! strcmp (argv[i], "-fwhopr") && ! use_plugin) { use_verbose = true; lto_mode = LTO_MODE_WHOPR; @@ -1431,7 +1469,7 @@ main (int argc, char **argv) if (use_verbose && *q == '-' && q[1] == 'v' && q[2] == 0) { /* Turn on trace in collect2 if needed. */ - vflag = true; + vflag = 1; } } obstack_free (&temporary_obstack, temporary_firstobj); @@ -1482,8 +1520,7 @@ main (int argc, char **argv) break; case 'f': - if (strcmp (arg, "-flto") == 0 - || strncmp (arg, "-fwhopr", 7) == 0) + if (strcmp (arg, "-flto") == 0 || strcmp (arg, "-fwhopr") == 0) { #ifdef ENABLE_LTO /* Do not pass LTO flag to the linker. */ @@ -1562,7 +1599,7 @@ main (int argc, char **argv) case 'v': if (arg[2] == '\0') - vflag = true; + vflag = 1; break; case '-': @@ -1593,10 +1630,6 @@ main (int argc, char **argv) } else if (strncmp (arg, "--sysroot=", 10) == 0) target_system_root = arg + 10; - else if (strncmp (arg, "--version", 9) == 0) - vflag = true; - else if (strncmp (arg, "--help", 9) == 0) - helpflag = true; break; } } @@ -1698,20 +1731,6 @@ main (int argc, char **argv) fprintf (stderr, "\n"); } - if (helpflag) - { - fprintf (stderr, "Usage: collect2 [options]\n"); - fprintf (stderr, " Wrap linker and generate constructor code if needed.\n"); - fprintf (stderr, " Options:\n"); - fprintf (stderr, " -debug Enable debug output\n"); - fprintf (stderr, " --help Display this information\n"); - fprintf (stderr, " -v, --version Display this program's version number\n"); - fprintf (stderr, "Overview: http://gcc.gnu.org/onlinedocs/gccint/Collect2.html\n"); - fprintf (stderr, "Report bugs: %s\n", bug_report_url); - - collect_exit (0); - } - if (debug) { const char *ptr; @@ -1779,7 +1798,7 @@ main (int argc, char **argv) if (export_file != 0 && export_file[0]) maybe_unlink (export_file); #endif - if (lto_mode != LTO_MODE_NONE) + if (lto_mode) maybe_run_lto_and_relink (ld1_argv, object_lst, object, false); maybe_unlink (c_file); @@ -2525,24 +2544,16 @@ write_aix_file (FILE *stream, struct id *list) #ifdef OBJECT_FORMAT_NONE -/* Check to make sure the file is an LTO object file. */ +/* Check to make sure the file is an ELF file. LTO objects must + be in ELF format. */ static bool -maybe_lto_object_file (const char *prog_name) +is_elf_or_coff (const char *prog_name) { FILE *f; - unsigned char buf[4]; - int i; - - static unsigned char elfmagic[4] = { 0x7f, 'E', 'L', 'F' }; - static unsigned char coffmagic[2] = { 0x4c, 0x01 }; - static unsigned char coffmagic_x64[2] = { 0x64, 0x86 }; - static unsigned char machomagic[4][4] = { - { 0xcf, 0xfa, 0xed, 0xfe }, - { 0xce, 0xfa, 0xed, 0xfe }, - { 0xfe, 0xed, 0xfa, 0xcf }, - { 0xfe, 0xed, 0xfa, 0xce } - }; + char buf[4]; + static char magic[4] = { 0x7f, 'E', 'L', 'F' }; + static char coffmag[2] = { 0x4c, 0x01 }; f = fopen (prog_name, "rb"); if (f == NULL) @@ -2550,16 +2561,8 @@ maybe_lto_object_file (const char *prog_name) if (fread (buf, sizeof (buf), 1, f) != 1) buf[0] = 0; fclose (f); - - if (memcmp (buf, elfmagic, sizeof (elfmagic)) == 0 - || memcmp (buf, coffmagic, sizeof (coffmagic)) == 0 - || memcmp (buf, coffmagic_x64, sizeof (coffmagic_x64)) == 0) - return true; - for (i = 0; i < 4; i++) - if (memcmp (buf, machomagic[i], sizeof (machomagic[i])) == 0) - return true; - - return false; + return memcmp (buf, magic, sizeof (magic)) == 0 + || memcmp (buf, coffmag, sizeof (coffmag)) == 0; } /* Generic version to scan the name list of the loaded program for @@ -2589,7 +2592,7 @@ scan_prog_file (const char *prog_name, scanpass which_pass, /* LTO objects must be in a known format. This check prevents us from accepting an archive containing LTO objects, which gcc cannnot currently handle. */ - if (which_pass == PASS_LTOINFO && !maybe_lto_object_file (prog_name)) + if (which_pass == PASS_LTOINFO && !is_elf_or_coff (prog_name)) return; /* If we do not have an `nm', complain. */ diff --git a/gcc/config.gcc b/gcc/config.gcc index 88631ff66e6..73be7152037 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -200,6 +200,8 @@ default_use_cxa_atexit=no target_gtfiles= need_64bit_hwint= need_64bit_isa= +# Selects the object file format reader/writer used by LTO. +lto_binary_reader=lto-elf # Don't carry these over build->host->target. Please. xm_file= @@ -1324,6 +1326,7 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*) thread_file='posix' fi use_gcc_stdint=wrap + lto_binary_reader=lto-coff ;; i[34567]86-*-mingw* | x86_64-*-mingw*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h" @@ -1391,6 +1394,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*) cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o" default_use_cxa_atexit=yes use_gcc_stdint=wrap + lto_binary_reader=lto-coff case ${enable_threads} in "" | yes | win32) thread_file='win32' tmake_file="${tmake_file} i386/t-gthr-win32" diff --git a/gcc/configure b/gcc/configure index fc4013b98f8..0515812873d 100755 --- a/gcc/configure +++ b/gcc/configure @@ -671,6 +671,8 @@ subdirs slibdir dollar gcc_tooldir +LTO_USE_LIBELF +LTO_BINARY_READER enable_lto MAINT zlibinc @@ -17092,7 +17094,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17095 "configure" +#line 17097 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17198,7 +17200,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17201 "configure" +#line 17203 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -22942,6 +22944,48 @@ if test $gcc_cv_as_ix86_pe_secrel32 = yes; then $as_echo "#define HAVE_GAS_PE_SECREL32_RELOC 1" >>confdefs.h fi + # Test if the assembler supports the extended form of the .section + # directive that specifies section alignment. LTO support uses this, + # but normally only after installation, so we warn but don't fail the + # configure if LTO is enabled but the assembler does not support it. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .section with alignment" >&5 +$as_echo_n "checking assembler for .section with alignment... " >&6; } +if test "${gcc_cv_as_section_has_align+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_section_has_align=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 20 \) \* 1000 + 1` + then gcc_cv_as_section_has_align=yes +fi + elif test x$gcc_cv_as != x; then + echo '.section lto_test,"dr0"' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -fatal-warnings -o conftest.o conftest.s >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } + then + gcc_cv_as_section_has_align=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_section_has_align" >&5 +$as_echo "$gcc_cv_as_section_has_align" >&6; } + + if test x$gcc_cv_as_section_has_align != xyes; then + case ",$enable_languages," in + *,lto,*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: LTO for $target requires binutils >= 2.20.1, but version found appears insufficient; LTO will not work until binutils is upgraded." >&5 +$as_echo "$as_me: WARNING: LTO for $target requires binutils >= 2.20.1, but version found appears insufficient; LTO will not work until binutils is upgraded." >&2;} + ;; + esac + fi ;; esac @@ -25078,6 +25122,17 @@ $as_echo "#define ENABLE_LTO 1" >>confdefs.h enable_lto=yes + # LTO needs to speak the platform's object file format, and has a + # number of implementations of the required binary file access APIs. + # ELF is the most common, and default. We only link libelf if ELF + # is indeed the selected format. + LTO_BINARY_READER=${lto_binary_reader} + LTO_USE_LIBELF=-lelf + if test "x$lto_binary_reader" != "xlto-elf" ; then + LTO_USE_LIBELF= + fi + + ;; *) ;; esac diff --git a/gcc/configure.ac b/gcc/configure.ac index 1676c40b4b0..67973b1fec6 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3202,6 +3202,19 @@ foo: nop rm -f conftest], [AC_DEFINE(HAVE_GAS_PE_SECREL32_RELOC, 1, [Define if your assembler and linker support 32-bit section relative relocs via '.secrel32 label'.])]) + # Test if the assembler supports the extended form of the .section + # directive that specifies section alignment. LTO support uses this, + # but normally only after installation, so we warn but don't fail the + # configure if LTO is enabled but the assembler does not support it. + gcc_GAS_CHECK_FEATURE([.section with alignment], gcc_cv_as_section_has_align, + [2,20,1],-fatal-warnings,[.section lto_test,"dr0"]) + if test x$gcc_cv_as_section_has_align != xyes; then + case ",$enable_languages," in + *,lto,*) + AC_MSG_WARN([LTO for $target requires binutils >= 2.20.1, but version found appears insufficient; LTO will not work until binutils is upgraded.]) + ;; + esac + fi ;; esac @@ -4270,6 +4283,17 @@ changequote([,])dnl AC_DEFINE(ENABLE_LTO, 1, [Define to enable LTO support.]) enable_lto=yes AC_SUBST(enable_lto) + # LTO needs to speak the platform's object file format, and has a + # number of implementations of the required binary file access APIs. + # ELF is the most common, and default. We only link libelf if ELF + # is indeed the selected format. + LTO_BINARY_READER=${lto_binary_reader} + LTO_USE_LIBELF=-lelf + if test "x$lto_binary_reader" != "xlto-elf" ; then + LTO_USE_LIBELF= + fi + AC_SUBST(LTO_BINARY_READER) + AC_SUBST(LTO_USE_LIBELF) ;; *) ;; esac diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 24212a1f4a6..b757655ee22 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,13 @@ +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. diff --git a/gcc/lto/Make-lang.in b/gcc/lto/Make-lang.in index 149644972af..a06ab4a18a5 100644 --- a/gcc/lto/Make-lang.in +++ b/gcc/lto/Make-lang.in @@ -85,12 +85,9 @@ lto/lto.o: lto/lto.c $(CONFIG_H) $(SYSTEM_H) coretypes.h opts.h \ $(CGRAPH_H) $(GGC_H) tree-ssa-operands.h $(TREE_PASS_H) \ langhooks.h vec.h $(BITMAP_H) pointer-set.h $(IPA_PROP_H) \ $(COMMON_H) $(TIMEVAR_H) $(GIMPLE_H) $(LTO_H) $(LTO_TREE_H) \ - $(LTO_TAGS_H) $(LTO_STREAMER_H) gt-lto-lto.h + $(LTO_TAGS_H) $(LTO_STREAMER_H) lto/lto-elf.o: lto/lto-elf.c $(CONFIG_H) coretypes.h $(SYSTEM_H) \ toplev.h $(LTO_H) $(TM_H) $(LIBIBERTY_H) $(GGC_H) $(LTO_STREAMER_H) lto/lto-coff.o: lto/lto-coff.c $(CONFIG_H) coretypes.h $(SYSTEM_H) \ toplev.h $(LTO_H) $(TM_H) $(LIBIBERTY_H) $(GGC_H) $(LTO_STREAMER_H) \ lto/lto-coff.h -lto/lto-macho.o: lto/lto-macho.c $(CONFIG_H) coretypes.h $(SYSTEM_H) \ - toplev.h $(LTO_H) $(TM_H) $(LIBIBERTY_H) $(GGC_H) $(LTO_STREAMER_H) \ - lto/lto-macho.h lto/lto-endian.h diff --git a/gcc/lto/lto-coff.c b/gcc/lto/lto-coff.c index 1b87cbbe764..1814cfdb82b 100644 --- a/gcc/lto/lto-coff.c +++ b/gcc/lto/lto-coff.c @@ -379,10 +379,9 @@ validate_file (lto_coff_file *coff_file) return false; } - if (mach != IMAGE_FILE_MACHINE_AMD64 - && COFF_CHARACTERISTICS != (COFF_CHARACTERISTICS & charact)) + if (COFF_CHARACTERISTICS != (COFF_CHARACTERISTICS & charact)) { - /* ECOFF/XCOFF support not implemented. */ + /* ECOFF/XCOFF/PE+ support not implemented. */ error ("not a 32-bit COFF object file"); return false; } diff --git a/gcc/lto/lto-coff.h b/gcc/lto/lto-coff.h index bdc9fa52222..f069d0cae46 100644 --- a/gcc/lto/lto-coff.h +++ b/gcc/lto/lto-coff.h @@ -79,13 +79,11 @@ along with GCC; see the file COPYING3. If not see /* COFF header machine codes. */ #define IMAGE_FILE_MACHINE_I386 (0x014c) -#define IMAGE_FILE_MACHINE_AMD64 (0x8664) /* Known header magics for validation, as an array initialiser. */ #define COFF_KNOWN_MACHINES \ - { IMAGE_FILE_MACHINE_I386, \ - IMAGE_FILE_MACHINE_AMD64/*, ... add more here when working. */ } + { IMAGE_FILE_MACHINE_I386/*, ... add more here when working. */ } /* COFF object file header, section and symbol flags and types. These are currently specific to PE-COFF, which is the only LTO-COFF format at the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f5ba72f7349..a025895843b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-04-27 Dave Korn + + PR lto/42776 + * lib/lto.exp (lto_prune_vis_warns): New function. + (lto-link-and-maybe-run): Call it. + 2010-04-26 H.J. Lu PR tree-optimization/43904 diff --git a/gcc/testsuite/lib/lto.exp b/gcc/testsuite/lib/lto.exp index 22b7b46bc03..3d40efc32b9 100644 --- a/gcc/testsuite/lib/lto.exp +++ b/gcc/testsuite/lib/lto.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 2009 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,27 +16,16 @@ # Contributed by Diego Novillo -# Prune messages that aren't useful. +# Prune messages from gcc that aren't useful. -proc lto_prune_warns { text } { - - verbose "lto_prune_warns: entry: $text" 2 +proc lto_prune_vis_warns { text } { # Many tests that use visibility will still pass on platforms that don't support it. regsub -all "(^|\n)\[^\n\]*: warning: visibility attribute not supported in this configuration; ignored\[^\n\]*" $text "" text # And any stray location lines. regsub -all "(^|\n)\[^\n\]*: In function \[^\n\]*" $text "" text - regsub -all "(^|\n)In file included from \[^\n\]*" $text "" text - regsub -all "(^|\n)\[ \t\]*from \[^\n\]*" $text "" text - - # Sun ld warns about common symbols with differing sizes. Unlike GNU ld - # --warn-common (off by default), they cannot be disabled. - regsub -all "(^|\n)ld: warning: symbol `\[^\n\]*' has differing sizes:" $text "" text - regsub -all "(^|\n)\[ \t\]*\[\(\]file \[^\n\]* value=\[^\n\]*; file \[^\n\]* value=\[^\n\]*\[)\];" $text "" text - regsub -all "(^|\n)\[ \t\]*\[^\n\]* definition taken" $text "" text - - verbose "lto_prune_warns: exit: $text" 2 + regsub -all "(^|\n)In file included from :\[^\n\]*" $text "" text return $text } @@ -138,8 +127,6 @@ proc lto-obj { source dest optall optfile optstr xfaildata } { set compiler_conditional_xfail_data $xfaildata set comp_output [${tool}_target_compile "$source" "$dest" object $options] - # Prune unimportant visibility warnings before checking output. - set comp_output [lto_prune_warns $comp_output] ${tool}_check_compile "$testcase $dest assemble" $optstr $dest $comp_output } @@ -175,7 +162,7 @@ proc lto-link-and-maybe-run { testname objlist dest optall optfile optstr } { "$options"] # Prune unimportant visibility warnings before checking output. - set comp_output [lto_prune_warns $comp_output] + set comp_output [lto_prune_vis_warns $comp_output] if ![${tool}_check_compile "$testcase $testname link" "" \ $dest $comp_output] then {