[Bug lto/42776] LTO doesn't work on non-ELF platforms.

davek at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jun 14 10:38:00 GMT 2010



------- Comment #50 from davek at gcc dot gnu dot org  2010-06-14 10:38 -------
Subject: Bug 42776

Author: davek
Date: Mon Jun 14 10:38:18 2010
New Revision: 160722

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160722
Log:
ChangeLog:

  Backport from mainline:
  2010-04-27  Dave Korn  <dave.korn.cygwin@gmail.com>

        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:

  Backport from mainline:
  2010-04-27  Dave Korn  <dave.korn.cygwin@gmail.com>

        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.
        * config.gcc (lto_binary_reader): New target-specific configure
        variable.
        * 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:

  Backport from mainline:
  2010-04-27  Dave Korn  <dave.korn.cygwin@gmail.com>

        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  Dave Korn  <dave.korn.cygwin@gmail.com>

        * 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.


Added:
    branches/gcc-4_5-branch/gcc/lto/lto-coff.c
    branches/gcc-4_5-branch/gcc/lto/lto-coff.h
Modified:
    branches/gcc-4_5-branch/ChangeLog
    branches/gcc-4_5-branch/configure
    branches/gcc-4_5-branch/configure.ac
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/Makefile.in
    branches/gcc-4_5-branch/gcc/collect2.c
    branches/gcc-4_5-branch/gcc/config.gcc
    branches/gcc-4_5-branch/gcc/config/i386/t-cygming
    branches/gcc-4_5-branch/gcc/config/i386/winnt.c
    branches/gcc-4_5-branch/gcc/configure
    branches/gcc-4_5-branch/gcc/configure.ac
    branches/gcc-4_5-branch/gcc/lto/ChangeLog
    branches/gcc-4_5-branch/gcc/lto/Make-lang.in
    branches/gcc-4_5-branch/gcc/lto/lto-elf.c
    branches/gcc-4_5-branch/gcc/lto/lto-lang.c
    branches/gcc-4_5-branch/gcc/lto/lto.c
    branches/gcc-4_5-branch/gcc/lto/lto.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42776



More information about the Gcc-bugs mailing list