From f64b48e2ead18a7376ef387176e4f1711be71e92 Mon Sep 17 00:00:00 2001 From: iains Date: Tue, 18 May 2010 08:12:56 +0000 Subject: [PATCH] add lto to powerpc-*darwin and enable for 32bit darwin Steven Bosscher ChangeLog: * configure.ac (--enable-lto): All *-apple-darwin* now support LTO. * configure: Regenerate. gcc/ChangeLog: * config.gcc (powerpc-*-darwin*, powerpc64-*-darwin*): Add lto-macho as lto_binary_reader. * darwin.c (darwin_asm_named_section): Do not add assembler comment after .section directive; just print it before the directive instead. M gcc/config.gcc M gcc/config/darwin.c M ChangeLog M gcc/ChangeLog git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159527 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog | 5 +++++ configure | 2 +- configure.ac | 2 +- gcc/ChangeLog | 8 ++++++++ gcc/config.gcc | 2 ++ gcc/config/darwin.c | 5 +++-- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8811342148d2..2aa46dec8fea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-05-18 Steven Bosscher + + * configure.ac (--enable-lto): All *-apple-darwin* now support LTO. + * configure: Regenerate. + 2010-05-12 Sriraman Tallam * MAINTAINERS (Write After Approval): Add myself. diff --git a/configure b/configure index 6fc9b0f7a57e..8edfde3da4d7 100755 --- a/configure +++ b/configure @@ -6686,7 +6686,7 @@ else # -flto it won't be needed until after installation anyway. case $target in *-cygwin*|*-mingw*) ;; - x86_64-apple-darwin*) ;; + *-apple-darwin*) ;; *) if test x"$enable_lto" = x"yes"; then as_fn_error "LTO support is not enabled for this target." "$LINENO" 5 fi diff --git a/configure.ac b/configure.ac index 920457464e57..f78c5273084a 100644 --- a/configure.ac +++ b/configure.ac @@ -1803,7 +1803,7 @@ fi],[if test x"$default_enable_lto" = x"yes" ; then # -flto it won't be needed until after installation anyway. case $target in *-cygwin*|*-mingw*) ;; - x86_64-apple-darwin*) ;; + *-apple-darwin*) ;; *) if test x"$enable_lto" = x"yes"; then AC_MSG_ERROR([LTO support is not enabled for this target.]) fi diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e677aeb94f57..56d1b0bef2ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2010-05-18 Steven Bosscher + + * config.gcc (powerpc-*-darwin*, powerpc64-*-darwin*): Add + lto-macho as lto_binary_reader. + + * darwin.c (darwin_asm_named_section): Do not add assembler comment + after .section directive; just print it before the directive instead. + 2010-05-17 Jan Hubicka * cgraph.c (cgraph_create_virtual_clone): Only check diff --git a/gcc/config.gcc b/gcc/config.gcc index da56fbecc20b..2c4d1213c35a 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1891,12 +1891,14 @@ powerpc-*-darwin*) *-darwin[0-6]*) ;; esac + lto_binary_reader=lto-macho extra_headers=altivec.h ;; powerpc64-*-darwin*) tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h" extra_options="${extra_options} ${cpu_type}/darwin.opt" # We're omitting t-darwin8 to avoid building any multilibs + lto_binary_reader=lto-macho extra_headers=altivec.h ;; powerpc*-*-freebsd*) diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 93f7babbd6fc..6c63d7a32b4b 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1460,8 +1460,9 @@ darwin_asm_named_section (const char *name, obstack_grow (<o_section_names_obstack, "\\0\"\n", 4); /* Output the dummy section name. */ - fprintf (asm_out_file, "\t.section %s,__%08X,regular,debug\t# %s\n", - LTO_SEGMENT_NAME, lto_section_names_offset, name); + fprintf (asm_out_file, "\t# %s\n", name); + fprintf (asm_out_file, "\t.section %s,__%08X,regular,debug\n", + LTO_SEGMENT_NAME, lto_section_names_offset); /* Update the offset for the next section name. Make sure we stay within reasonable length. */ -- 2.47.2