| Submitter | IainS |
|---|---|
| Date | July 15, 2010, 6:27 p.m. |
| Message ID | <8987CD7A-53F6-45B1-9A88-E27107B1AAFB@sandoe-acoustics.co.uk> |
| Download | mbox | patch |
| Permalink | /patch/59003/ |
| State | New |
| Headers | show |
Comments
On 07/15/2010 11:27 AM, IainS wrote: > +#ifndef TARGET_MACHO_BRANCH_ISLANDS > +# define TARGET_MACHO_BRANCH_ISLANDS 0 > +#endif This could go next to the TARGET_MACHO definition in i386.h, for consistency. From a i386 maintainer perspective, I think this is ok. I'll defer for ppc and darwin knowledge. r~
On 15 Jul 2010, at 19:44, Richard Henderson wrote: > On 07/15/2010 11:27 AM, IainS wrote: >> +#ifndef TARGET_MACHO_BRANCH_ISLANDS >> +# define TARGET_MACHO_BRANCH_ISLANDS 0 >> +#endif > > This could go next to the TARGET_MACHO definition in i386.h, for > consistency. > > From a i386 maintainer perspective, I think this is ok. I'll defer > for ppc and darwin knowledge. FWIW: At your suggestion, since then I've built powerpc-unknown-linux-gnu (crossed from i6868- darwin9) and proved it can compile a trivial source file. (of course, the patch was already tested on powerpc-apple-darwin9 as well) Iain
Patch
Index: gcc/config/i386/darwin.h =================================================================== --- gcc/config/i386/darwin.h (revision 162209) +++ gcc/config/i386/darwin.h (working copy) @@ -60,6 +60,9 @@ along with GCC; see the file COPYING3. If not see #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 32 +/* Generate branch islands stubs if this is true. */ +extern int darwin_emit_branch_islands; + #undef MAX_BITS_PER_WORD #define MAX_BITS_PER_WORD 64 @@ -225,7 +228,7 @@ along with GCC; see the file COPYING3. If not see #undef FUNCTION_PROFILER #define FUNCTION_PROFILER(FILE, LABELNO) \ do { \ - if (MACHOPIC_INDIRECT && !TARGET_64BIT) \ + if (darwin_emit_branch_islands && MACHOPIC_INDIRECT && ! TARGET_64BIT) \ { \ const char *name = machopic_mcount_stub_name (); \ fprintf (FILE, "\tcall %s\n", name+1); /* skip '&' */ \ @@ -300,3 +303,7 @@ along with GCC; see the file COPYING3. If not see #define MACHO_SYMBOL_FLAG_VARIABLE ((SYMBOL_FLAG_MACH_DEP) << 3) #define SUBTARGET32_DEFAULT_CPU "i686" + +#undef TARGET_MACHO_BRANCH_ISLANDS +#define TARGET_MACHO_BRANCH_ISLANDS darwin_emit_branch_islands + Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 162209) +++ gcc/config/i386/i386.c (working copy) @@ -2206,6 +2206,10 @@ static const char *const cpu_names[TARGET_CPU_DEFA "amdfam10", "bdver1" }; + +#ifndef TARGET_MACHO_BRANCH_ISLANDS +# define TARGET_MACHO_BRANCH_ISLANDS 0 +#endif /* Implement TARGET_HANDLE_OPTION. */