Patchwork [rs6000] Preserve link stack for 476 cpus

login
register
mail settings
Submitter IainS
Date Nov. 2, 2011, 7:33 p.m.
Message ID <D8F20203-D696-4C0A-8D08-F9FB2AFF0C73@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/123321/
State New
Headers show

Comments

IainS - Nov. 2, 2011, 7:33 p.m.
On 2 Nov 2011, at 19:05, Peter Bergner wrote:

> On Wed, 2011-11-02 at 18:52 +0000, Iain Sandoe wrote:
>> I'll investigate a bit further later...
>
> So you didn't start your build from scratch?  I'll keep my
> fingers crossed that a fresh build fixing things for you.
> Otherwise, let me know what you find.

NO - it was a clean bootstrap ....

$ grep get_ppc64_thunk_name gcc/config/rs6000/*
gcc/config/rs6000/rs6000.c:           get_ppc64_thunk_name (name);


I'm going to try this ....

$ svn diff -x -p gcc/config/rs6000/rs6000.c
preserve
@@ -27983,7 +27984,7 @@ rs6000_code_end (void)
    TREE_PUBLIC (decl) = 1;
    TREE_STATIC (decl) = 1;

-  if (HAVE_GAS_HIDDEN)
+#if defined(HAVE_GAS_HIDDEN)
      {
        DECL_COMDAT_GROUP (decl) = DECL_ASSEMBLER_NAME (decl);
        targetm.asm_out.unique_section (decl, 0);
@@ -27994,11 +27995,12 @@ rs6000_code_end (void)
        targetm.asm_out.assemble_visibility (decl, VISIBILITY_HIDDEN);
        ASM_DECLARE_FUNCTION_NAME (asm_out_file, name, decl);
      }
-  else
+#else
      {
        switch_to_section (text_section);
        ASM_OUTPUT_LABEL (asm_out_file, name);
      }
+#endif

    DECL_INITIAL (decl) = make_node (BLOCK);
    current_function_decl = decl;

====

cheers
Iain
Peter Bergner - Nov. 2, 2011, 7:39 p.m.
On Wed, 2011-11-02 at 19:33 +0000, Iain Sandoe wrote:
> I'm going to try this ....
> 
> $ svn diff -x -p gcc/config/rs6000/rs6000.c
> Index: gcc/config/rs6000/rs6000.c
> ===================================================================
> --- gcc/config/rs6000/rs6000.c  (revision 180788)
> +++ gcc/config/rs6000/rs6000.c  (working copy)
> @@ -25071,7 +25071,7 @@ macho_branch_islands (void)
>            if (TARGET_LINK_STACK)
>              {
>                char name[32];
> -             get_ppc64_thunk_name (name);
> +             get_ppc476_thunk_name (name);
>                strcat (tmp_buf, ":\n\tmflr r0\n\tbl ");
>                strcat (tmp_buf, name);
>                strcat (tmp_buf, "\n");


Oh my, I'm not sure how that got through. :(  Oh, as you
said, that is TARGET_MACHO which I can't really test.
Sorry about that.




> @@ -27956,10 +27956,11 @@ get_ppc476_thunk_name (char name[32])
>   {
>     gcc_assert (TARGET_LINK_STACK);
> 
> -  if (HAVE_GAS_HIDDEN)
> +#if defined(HAVE_GAS_HIDDEN)
>       sprintf (name, "__ppc476.get_thunk");
> -  else
> +#else
>       ASM_GENERATE_INTERNAL_LABEL (name, "LPPC476_", 0);
> +#endif
>   }
...

Instead of that, see my patch to fix David's AIX problem:

  http://gcc.gnu.org/ml/gcc-patches/2011-11/msg00198.html


Peter
IainS - Nov. 2, 2011, 10:02 p.m.
On 2 Nov 2011, at 19:39, Peter Bergner wrote:

> On Wed, 2011-11-02 at 19:33 +0000, Iain Sandoe wrote:
>> I'm going to try this ....
>>               char name[32];
>> -             get_ppc64_thunk_name (name);
>> +             get_ppc476_thunk_name (name);

This (together with the changes for HAVE_GAS_HIDDEN) fixes my  
bootstrap problem.

> Oh my, I'm not sure how that got through. :(

Well, I guess I should have looked at your patch before it hit trunk  
(I was mistakenly thinking it didn't touch Darwin).

> Oh, as you said, that is TARGET_MACHO which I can't really test.
> Sorry about that.

FWIW, it's not really any worse building a cross from linux ->  
darwin9*** than a cross to any other foreign OS from linux (there are  
a couple of differences - because of the non-binutils tool-chain).  I  
did it recently.

** Rainer, AFAICT, all is OK with your (much appreciated)  
rationalization of libgcc on *-Darwin9 & x86-64-Darwin10 (although  
testing is incomplete).

cheers
Iain

***
x86-64-darwin10 and Darwin11 are more problematic, since the cross  
toolchains are not yet in place/mature (at least as of a few weeks ago).

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c  (revision 180788)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -25071,7 +25071,7 @@  macho_branch_islands (void)
           if (TARGET_LINK_STACK)
             {
               char name[32];
-             get_ppc64_thunk_name (name);
+             get_ppc476_thunk_name (name);
               strcat (tmp_buf, ":\n\tmflr r0\n\tbl ");
               strcat (tmp_buf, name);
               strcat (tmp_buf, "\n");
@@ -27956,10 +27956,11 @@  get_ppc476_thunk_name (char name[32])
  {
    gcc_assert (TARGET_LINK_STACK);

-  if (HAVE_GAS_HIDDEN)
+#if defined(HAVE_GAS_HIDDEN)
      sprintf (name, "__ppc476.get_thunk");
-  else
+#else
      ASM_GENERATE_INTERNAL_LABEL (name, "LPPC476_", 0);
+#endif
  }

  /* This function emits the simple thunk routine that is used to