public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* .machine for Darwin, new cctools required
@ 2004-10-14 22:41 Geoffrey Keating
  2004-10-14 22:50 ` Stan Shebs
  0 siblings, 1 reply; 11+ messages in thread
From: Geoffrey Keating @ 2004-10-14 22:41 UTC (permalink / raw)
  To: gcc-patches


This patch uses the new .machine directive in the Darwin assembler to
say which instruction set is to be used, which lets me get rid of the
workaround using -force_cpusubtype_ALL, and fixes a collection of bugs
of the form 'if I use this combination of flags, the assembler refuses
to assemble GCC's output', some of which were being worked around in
the testsuite.

This patch requires a further updated cctools to work properly.  You
can get it from
<ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.tar.bz2> in
source form, and an installable package at
<ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg>.

Bootstrapped & tested on powerpc-darwin.  I also hand-checked that a
bunch of flag combinations were working properly using 'otool -vh'.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-3751364-2.patch=======================
2004-10-14  Geoffrey Keating  <geoffk@apple.com>

	* config/rs6000/darwin.h (ASM_SPEC): Delete.
	(TARGET_ASM_FILE_START): Define.
	* config/darwin.h (ASM_SPEC): Define.
	* config/rs6000/t-darwin (TARGET_LIBGCC2_CFLAGS): Don't supply
	-mlong-double-128, it's the default.  Update comment about reason
	for force_cpusubtype_ALL.
	* config/rs6000/darwin-vecsave.asm: Supply .machine.
	* config/rs6000/darwin-world.asm: Likewise.
	* config/rs6000/rs6000.c (rs6000_darwin_file_start): New.
	(symbolic_operand): Delete #if 0ed code.

Index: testsuite/ChangeLog
2004-10-14  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/darwin-misaligned.c: Don't supply -force_cpusubtype_ALL.
	* gcc.dg/macho-lo-sum.c: Likewise.

Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.96
diff -u -p -u -p -r1.96 darwin.h
--- config/darwin.h	16 Sep 2004 06:49:58 -0000	1.96
+++ config/darwin.h	14 Oct 2004 22:18:57 -0000
@@ -330,6 +330,9 @@ extern const char *darwin_fix_and_contin
    to put anything in ENDFILE_SPEC.  */
 /* #define ENDFILE_SPEC "" */
 
+/* Default Darwin ASM_SPEC, very simple.  */
+#define ASM_SPEC "-arch %(darwin_arch)"
+
 /* We use Dbx symbol format.  */
 
 #define DBX_DEBUGGING_INFO 1
Index: config/rs6000/darwin-vecsave.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin-vecsave.asm,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 darwin-vecsave.asm
--- config/rs6000/darwin-vecsave.asm	31 Mar 2004 16:06:52 -0000	1.2
+++ config/rs6000/darwin-vecsave.asm	14 Oct 2004 22:18:58 -0000
@@ -41,6 +41,7 @@
    (4 bytes) to do the operation; for Vector regs, 2 instructions are
    required (8 bytes.).   */
 
+	.machine ppc7400
 .text
 	.align 2
 
Index: config/rs6000/darwin-world.asm
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin-world.asm,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 darwin-world.asm
--- config/rs6000/darwin-world.asm	22 Sep 2004 01:06:29 -0000	1.2
+++ config/rs6000/darwin-world.asm	14 Oct 2004 22:18:58 -0000
@@ -34,6 +34,7 @@
  *  executable file might be covered by the GNU General Public License.
  */ 
 
+	.machine ppc7400
 .data
 	.align 2
 
Index: config/rs6000/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin.h,v
retrieving revision 1.64
diff -u -p -u -p -r1.64 darwin.h
--- config/rs6000/darwin.h	13 Sep 2004 17:30:56 -0000	1.64
+++ config/rs6000/darwin.h	14 Oct 2004 22:18:58 -0000
@@ -132,19 +132,14 @@ do {									\
 %{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
 %{!static:%{!mdynamic-no-pic:-fPIC}}"
 
-/* It's virtually impossible to predict all the possible combinations
-   of -mcpu and -maltivec and whatnot, so just supply
-   -force_cpusubtype_ALL if any are seen.  Radar 3492132 against the
-   assembler is asking for a .machine directive so we could get this
-   really right.  */
-#define ASM_SPEC "-arch ppc \
-  %{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \
-  %{!Zforce_cpusubtype_ALL:%{maltivec|mcpu=*|mpowerpc64:-force_cpusubtype_ALL}}"
-
 #undef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS			\
   { "darwin_arch", "ppc" },
 
+/* Output a .machine directive.  */
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START rs6000_darwin_file_start
+
 /* The "-faltivec" option should have been called "-maltivec" all
    along.  -ffix-and-continue and -findirect-data is for compatibility
    for old compilers.  */
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.723
diff -u -p -u -p -r1.723 rs6000.c
--- config/rs6000/rs6000.c	13 Oct 2004 11:04:24 -0000	1.723
+++ config/rs6000/rs6000.c	14 Oct 2004 22:18:58 -0000
@@ -754,6 +754,7 @@ static void macho_branch_islands (void);
 static void add_compiler_branch_island (tree, tree, int);
 static int no_previous_def (tree function_name);
 static tree get_prev_label (tree function_name);
+static void rs6000_darwin_file_start (void);
 #endif
 
 static tree rs6000_build_builtin_va_list (void);
@@ -1713,6 +1714,7 @@ rs6000_file_start (void)
 	putc ('\n', file);
     }
 }
+
 \f
 /* Return nonzero if this function is known to have a null epilogue.  */
 
@@ -16859,32 +16861,6 @@ rs6000_fatal_bad_address (rtx op)
 
 #if TARGET_MACHO
 
-#if 0
-/* Returns 1 if OP is either a symbol reference or a sum of a symbol
-   reference and a constant.  */
-
-int
-symbolic_operand (rtx op)
-{
-  switch (GET_CODE (op))
-    {
-    case SYMBOL_REF:
-    case LABEL_REF:
-      return 1;
-    case CONST:
-      op = XEXP (op, 0);
-      return (GET_CODE (op) == SYMBOL_REF ||
-	      (GET_CODE (XEXP (op, 0)) == SYMBOL_REF
-	       || GET_CODE (XEXP (op, 0)) == LABEL_REF)
-	      && GET_CODE (XEXP (op, 1)) == CONST_INT);
-    default:
-      return 0;
-    }
-}
-#endif
-
-#if TARGET_MACHO
-
 static tree branch_island_list = 0;
 
 /* Remember to generate a branch island for far calls to the given
@@ -17060,8 +17036,6 @@ output_call (rtx insn, rtx *operands, in
   return buf;
 }
 
-#endif /* TARGET_MACHO */
-
 /* Generate PIC and indirect symbol stubs.  */
 
 void
@@ -17197,6 +17171,57 @@ toc_section (void)
 {
 }
 
+/* Output a .machine directive for the Darwin assembler, and call
+   the generic start_file routine.  */
+
+static void
+rs6000_darwin_file_start (void)
+{
+  static const struct 
+  {
+    const char *arg;
+    const char *name;
+    int if_set;
+  } mapping[] = {
+    { "970", "ppc970", MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64 },
+    { "power4", "ppc970", 0 },
+    { "G5", "ppc970", 0 },
+    { "7450", "ppc7450", 0 },
+    { "7400", "ppc7400", MASK_ALTIVEC },
+    { "G4", "ppc7400", 0 },
+    { "750", "ppc750", 0 },
+    { "740", "ppc750", 0 },
+    { "G3", "ppc750", 0 },
+    { "604e", "ppc604e", 0 },
+    { "604", "ppc604", 0 },
+    { "603e", "ppc603", 0 },
+    { "603", "ppc603", 0 },
+    { "601", "ppc601", 0 },
+    { NULL, "ppc", 0 } };
+  const char *cpu_id = "";
+  size_t i;
+  
+  rs6000_file_start();
+
+  /* Determine the argument to -mcpu=.  Default to G3 if not specified.  */
+  for (i = 0; i < ARRAY_SIZE (rs6000_select); i++)
+    if (rs6000_select[i].set_arch_p && rs6000_select[i].string
+	&& rs6000_select[i].string[0] != '\0')
+      cpu_id = rs6000_select[i].string;
+
+  /* Look through the mapping array.  Pick the first name that either
+     matches the argument, has a bit set in IF_SET that is also set
+     in the target flags, or has a NULL name.  */
+
+  i = 0;
+  while (mapping[i].arg != NULL
+	 && strcmp (mapping[i].arg, cpu_id) != 0
+	 && (mapping[i].if_set & target_flags) == 0)
+    i++;
+
+  fprintf (asm_out_file, "\t.machine %s\n", mapping[i].name);
+}
+
 #endif /* TARGET_MACHO */
 
 #if TARGET_ELF
Index: config/rs6000/t-darwin
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/t-darwin,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 t-darwin
--- config/rs6000/t-darwin	1 Jul 2004 04:09:05 -0000	1.13
+++ config/rs6000/t-darwin	14 Oct 2004 22:18:58 -0000
@@ -7,7 +7,7 @@ LIB2FUNCS_STATIC_EXTRA = \
 	$(srcdir)/config/rs6000/darwin-vecsave.asm  \
 	$(srcdir)/config/rs6000/darwin-world.asm
 
-# Enable AltiVec instructions when assembling the aforementioned .asm files.
-# For libgcc, we always want 128-bit long double, since a libgcc built with
-# that will work without it.
-TARGET_LIBGCC2_CFLAGS = -mlong-double-128 -Wa,-force_cpusubtype_ALL
+# The .asm files above are designed to run on all processors,
+# even though they use AltiVec instructions.  -Wa is used because
+# -force_cpusubtype_ALL doesn't work with -dynamiclib.
+TARGET_LIBGCC2_CFLAGS = -Wa,-force_cpusubtype_ALL
Index: testsuite/gcc.dg/darwin-misaligned.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/darwin-misaligned.c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 darwin-misaligned.c
--- testsuite/gcc.dg/darwin-misaligned.c	22 Dec 2003 18:37:24 -0000	1.1
+++ testsuite/gcc.dg/darwin-misaligned.c	14 Oct 2004 22:19:02 -0000
@@ -1,5 +1,5 @@
 /* { dg-do compile { target powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -force_cpusubtype_ALL -mpowerpc64" } */
+/* { dg-options "-O2 -mpowerpc64" } */
 
 typedef struct Nlm_rect {
   short sh1;
Index: testsuite/gcc.dg/macho-lo-sum.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/macho-lo-sum.c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 macho-lo-sum.c
--- testsuite/gcc.dg/macho-lo-sum.c	19 Dec 2003 23:35:40 -0000	1.1
+++ testsuite/gcc.dg/macho-lo-sum.c	14 Oct 2004 22:19:02 -0000
@@ -1,5 +1,5 @@
 /* { dg-do compile { target powerpc*-*-darwin* } } */
-/* { dg-options "-O2 -force_cpusubtype_ALL -mpowerpc64 -mdynamic-no-pic" } */
+/* { dg-options "-O2 -mpowerpc64 -mdynamic-no-pic" } */
 
 long long knight_attacks[64];
 long long InitializeAttackBoards(void);
============================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-14 22:41 .machine for Darwin, new cctools required Geoffrey Keating
@ 2004-10-14 22:50 ` Stan Shebs
  2004-10-14 23:02   ` Geoffrey Keating
  0 siblings, 1 reply; 11+ messages in thread
From: Stan Shebs @ 2004-10-14 22:50 UTC (permalink / raw)
  To: Geoffrey Keating; +Cc: gcc-patches

Geoffrey Keating wrote:

>This patch uses the new .machine directive in the Darwin assembler to
>say which instruction set is to be used, which lets me get rid of the
>workaround using -force_cpusubtype_ALL, and fixes a collection of bugs
>of the form 'if I use this combination of flags, the assembler refuses
>to assemble GCC's output', some of which were being worked around in
>the testsuite.
>
>This patch requires a further updated cctools to work properly.  You
>can get it from
><ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.tar.bz2> in
>source form, and an installable package at
><ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg>.
>
Ideally this would all be conditional on cctools version, but
failing that, it would be helpful to mention this dependency in
the building-from-source docs.

Stan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-14 22:50 ` Stan Shebs
@ 2004-10-14 23:02   ` Geoffrey Keating
  2004-10-15  4:08     ` Stan Shebs
  2004-10-15  4:52     ` Stan Shebs
  0 siblings, 2 replies; 11+ messages in thread
From: Geoffrey Keating @ 2004-10-14 23:02 UTC (permalink / raw)
  To: Stan Shebs; +Cc: Geoffrey Keating, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]


On 14/10/2004, at 3:41 PM, Stan Shebs wrote:

> Geoffrey Keating wrote:
>
>> This patch uses the new .machine directive in the Darwin assembler to
>> say which instruction set is to be used, which lets me get rid of the
>> workaround using -force_cpusubtype_ALL, and fixes a collection of bugs
>> of the form 'if I use this combination of flags, the assembler refuses
>> to assemble GCC's output', some of which were being worked around in
>> the testsuite.
>>
>> This patch requires a further updated cctools to work properly.  You
>> can get it from
>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.tar.bz2> in
>> source form, and an installable package at
>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg>.
>>
> Ideally this would all be conditional on cctools version, but
> failing that, it would be helpful to mention this dependency in
> the building-from-source docs.

It can't be conditional on cctools version without having specs 
conditional on that version, which seemed like a lot of work for no 
point (since you already have to upgrade to -528, going -528.5 doesn't 
seem like it would be any extra burden).

You can build GCC, I think, with the previous cctools.  You just can't 
use -mcpu= with a non-default setting and no other flags.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2408 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-14 23:02   ` Geoffrey Keating
@ 2004-10-15  4:08     ` Stan Shebs
  2004-10-15  4:52     ` Stan Shebs
  1 sibling, 0 replies; 11+ messages in thread
From: Stan Shebs @ 2004-10-15  4:08 UTC (permalink / raw)
  To: Geoffrey Keating; +Cc: Geoffrey Keating, gcc-patches

Geoffrey Keating wrote:

>
> On 14/10/2004, at 3:41 PM, Stan Shebs wrote:
>
>> Geoffrey Keating wrote:
>>
>>> This patch uses the new .machine directive in the Darwin assembler to
>>> say which instruction set is to be used, which lets me get rid of the
>>> workaround using -force_cpusubtype_ALL, and fixes a collection of bugs
>>> of the form 'if I use this combination of flags, the assembler refuses
>>> to assemble GCC's output', some of which were being worked around in
>>> the testsuite.
>>>
>>> This patch requires a further updated cctools to work properly.  You
>>> can get it from
>>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.tar.bz2> in
>>> source form, and an installable package at
>>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg>.
>>>
>> Ideally this would all be conditional on cctools version, but
>> failing that, it would be helpful to mention this dependency in
>> the building-from-source docs.
>
>
> It can't be conditional on cctools version without having specs 
> conditional on that version, which seemed like a lot of work for no 
> point (since you already have to upgrade to -528, going -528.5 doesn't 
> seem like it would be any extra burden).
>
> You can build GCC, I think, with the previous cctools.  You just can't 
> use -mcpu= with a non-default setting and no other flags.

I think it'll get indigestion with the .machine directives in
the asm files if nothing else. I've started up a build on my
one non-updated machine, see what happens. :-)

Stan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-14 23:02   ` Geoffrey Keating
  2004-10-15  4:08     ` Stan Shebs
@ 2004-10-15  4:52     ` Stan Shebs
  2004-10-15 17:45       ` Geoffrey Keating
  2004-10-18 23:16       ` Kelley Cook
  1 sibling, 2 replies; 11+ messages in thread
From: Stan Shebs @ 2004-10-15  4:52 UTC (permalink / raw)
  To: Geoffrey Keating; +Cc: Geoffrey Keating, gcc-patches

Geoffrey Keating wrote:

>
> On 14/10/2004, at 3:41 PM, Stan Shebs wrote:
>
>> Geoffrey Keating wrote:
>>
>>> This patch uses the new .machine directive in the Darwin assembler to
>>> say which instruction set is to be used, which lets me get rid of the
>>> workaround using -force_cpusubtype_ALL, and fixes a collection of bugs
>>> of the form 'if I use this combination of flags, the assembler refuses
>>> to assemble GCC's output', some of which were being worked around in
>>> the testsuite.
>>>
>>> This patch requires a further updated cctools to work properly.  You
>>> can get it from
>>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.tar.bz2> in
>>> source form, and an installable package at
>>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg>.
>>>
>> Ideally this would all be conditional on cctools version, but
>> failing that, it would be helpful to mention this dependency in
>> the building-from-source docs.
>
>
> It can't be conditional on cctools version without having specs 
> conditional on that version, which seemed like a lot of work for no 
> point (since you already have to upgrade to -528, going -528.5 doesn't 
> seem like it would be any extra burden).
>
> You can build GCC, I think, with the previous cctools.  You just can't 
> use -mcpu= with a non-default setting and no other flags.

Clunk (and not even a bootstrap).

/Users/sts/s/fsf-gcc/macosx/gcc/xgcc -B/Users/sts/s/fsf-gcc/macosx/gcc/ 
-B/usr/local/powerpc-apple-darwin7.5.0/bin/ 
-B/usr/local/powerpc-apple-darwin7.5.0/lib/ -isystem 
/usr/local/powerpc-apple-darwin7.5.0/include -isystem 
/usr/local/powerpc-apple-darwin7.5.0/sys-include -DIN_GCC    -W -Wall 
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition  -isystem ./include  -I. -I. -I../../gcc/gcc 
-I../../gcc/gcc/. -I../../gcc/gcc/../include -I./../intl 
-I../../gcc/gcc/../libcpp/include   \
  -c ../../gcc/gcc/config/darwin-crt2.c -o crt2.o
/var/tmp//ccFiCTZQ.s:1:Unknown pseudo-op: .machine
/var/tmp//ccFiCTZQ.s:1:Rest of line ignored. 1st junk character valued 
112 (p).
make[1]: *** [crt2.o] Error 1
make: *** [all-gcc] Error 2

So yes, need to update doc/install.texi at least.

Stan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-15  4:52     ` Stan Shebs
@ 2004-10-15 17:45       ` Geoffrey Keating
  2004-10-19 17:55         ` Stan Shebs
  2004-10-18 23:16       ` Kelley Cook
  1 sibling, 1 reply; 11+ messages in thread
From: Geoffrey Keating @ 2004-10-15 17:45 UTC (permalink / raw)
  To: Stan Shebs; +Cc: Geoffrey Keating, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2496 bytes --]


On 14/10/2004, at 9:37 PM, Stan Shebs wrote:

> Geoffrey Keating wrote:
>
>>
>> On 14/10/2004, at 3:41 PM, Stan Shebs wrote:
>>
>>> Geoffrey Keating wrote:
>>>
>>>> This patch uses the new .machine directive in the Darwin assembler 
>>>> to
>>>> say which instruction set is to be used, which lets me get rid of 
>>>> the
>>>> workaround using -force_cpusubtype_ALL, and fixes a collection of 
>>>> bugs
>>>> of the form 'if I use this combination of flags, the assembler 
>>>> refuses
>>>> to assemble GCC's output', some of which were being worked around in
>>>> the testsuite.
>>>>
>>>> This patch requires a further updated cctools to work properly.  You
>>>> can get it from
>>>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.tar.bz2> in
>>>> source form, and an installable package at
>>>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg>.
>>>>
>>> Ideally this would all be conditional on cctools version, but
>>> failing that, it would be helpful to mention this dependency in
>>> the building-from-source docs.
>>
>>
>> It can't be conditional on cctools version without having specs 
>> conditional on that version, which seemed like a lot of work for no 
>> point (since you already have to upgrade to -528, going -528.5 
>> doesn't seem like it would be any extra burden).
>>
>> You can build GCC, I think, with the previous cctools.  You just 
>> can't use -mcpu= with a non-default setting and no other flags.
>
> Clunk (and not even a bootstrap).
>
> /Users/sts/s/fsf-gcc/macosx/gcc/xgcc 
> -B/Users/sts/s/fsf-gcc/macosx/gcc/ 
> -B/usr/local/powerpc-apple-darwin7.5.0/bin/ 
> -B/usr/local/powerpc-apple-darwin7.5.0/lib/ -isystem 
> /usr/local/powerpc-apple-darwin7.5.0/include -isystem 
> /usr/local/powerpc-apple-darwin7.5.0/sys-include -DIN_GCC    -W -Wall 
> -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
> -Wold-style-definition  -isystem ./include  -I. -I. -I../../gcc/gcc 
> -I../../gcc/gcc/. -I../../gcc/gcc/../include -I./../intl 
> -I../../gcc/gcc/../libcpp/include   \
>  -c ../../gcc/gcc/config/darwin-crt2.c -o crt2.o
> /var/tmp//ccFiCTZQ.s:1:Unknown pseudo-op: .machine
> /var/tmp//ccFiCTZQ.s:1:Rest of line ignored. 1st junk character valued 
> 112 (p).
> make[1]: *** [crt2.o] Error 1
> make: *** [all-gcc] Error 2
>
> So yes, need to update doc/install.texi at least.

Just so I understand what you did, you tried to bootstrap GCC on a 
machine running cctools-528?

My copy of cctools-528 does understand the .machine directive.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2408 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-15  4:52     ` Stan Shebs
  2004-10-15 17:45       ` Geoffrey Keating
@ 2004-10-18 23:16       ` Kelley Cook
  2004-10-18 23:20         ` Mike Stump
  2004-10-19 18:09         ` Stan Shebs
  1 sibling, 2 replies; 11+ messages in thread
From: Kelley Cook @ 2004-10-18 23:16 UTC (permalink / raw)
  To: Stan Shebs; +Cc: Geoffrey Keating, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 360 bytes --]

Stan Shebs wrote:

> /var/tmp//ccFiCTZQ.s:1:Unknown pseudo-op: .machine
> /var/tmp//ccFiCTZQ.s:1:Rest of line ignored. 1st junk character valued 
> 112 (p).
> make[1]: *** [crt2.o] Error 1
> make: *** [all-gcc] Error 2
> 
> So yes, need to update doc/install.texi at least.

Or this patch should do the trick:

tested powerpc-apple-darwin7.5

OK to install?



[-- Attachment #2: darwin_check.patch --]
[-- Type: text/plain, Size: 1084 bytes --]

2004-10-18  Kelley Cook  <kcook@gcc.gnu.org>

	* configure.ac (powerpc-*-darwin*): Require assembler to support
	.machine directive.
	* configure: Regenerate.

Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.76
diff -p -u -d -r2.76 configure.ac
--- configure.ac	15 Oct 2004 02:26:15 -0000	2.76
+++ configure.ac	18 Oct 2004 22:03:32 -0000
@@ -2695,9 +2695,17 @@ foo:	nop
     case $target in
       *-*-aix*) conftest_s='	.csect .text[[PR]]
 	mfcr 3,128';;
-      *-*-darwin*) conftest_s='	.text
+      *-*-darwin*)
+       gcc_GAS_CHECK_FEATURE([.machine directive support],
+         gcc_cv_as_machine_directive,,,
+         [	.machine ppc7400])
+       if test x$gcc_cv_as_machine_directive != xyes; then
+         echo "*** This target requires an assembler supporting \".machine\"" >&2
+         exit 1
+       fi
+       conftest_s='	.text
 	mfcr r3,128';;
-      *)       conftest_s='	.machine power4
+      *) conftest_s='	.machine power4
 	.text
 	mfcr 3,128';;
     esac

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-18 23:16       ` Kelley Cook
@ 2004-10-18 23:20         ` Mike Stump
  2004-10-19 18:09         ` Stan Shebs
  1 sibling, 0 replies; 11+ messages in thread
From: Mike Stump @ 2004-10-18 23:20 UTC (permalink / raw)
  To: Kelley Cook; +Cc: Geoffrey Keating, gcc-patches, Stan Shebs

On Oct 18, 2004, at 3:56 PM, Kelley Cook wrote:
> Or this patch should do the trick:
>
> tested powerpc-apple-darwin7.5
>
> OK to install?

Look good to me if you tested it and it works...

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-15 17:45       ` Geoffrey Keating
@ 2004-10-19 17:55         ` Stan Shebs
  0 siblings, 0 replies; 11+ messages in thread
From: Stan Shebs @ 2004-10-19 17:55 UTC (permalink / raw)
  To: Geoffrey Keating; +Cc: Geoffrey Keating, gcc-patches

Geoffrey Keating wrote:

>
> On 14/10/2004, at 9:37 PM, Stan Shebs wrote:
>
>> Geoffrey Keating wrote:
>>
>>>
>>> On 14/10/2004, at 3:41 PM, Stan Shebs wrote:
>>>
>>>> Geoffrey Keating wrote:
>>>>
>>>>> This patch uses the new .machine directive in the Darwin assembler to
>>>>> say which instruction set is to be used, which lets me get rid of the
>>>>> workaround using -force_cpusubtype_ALL, and fixes a collection of 
>>>>> bugs
>>>>> of the form 'if I use this combination of flags, the assembler 
>>>>> refuses
>>>>> to assemble GCC's output', some of which were being worked around in
>>>>> the testsuite.
>>>>>
>>>>> This patch requires a further updated cctools to work properly.  You
>>>>> can get it from
>>>>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.tar.bz2> in
>>>>> source form, and an installable package at
>>>>> <ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-528.5.dmg>.
>>>>>
>>>> Ideally this would all be conditional on cctools version, but
>>>> failing that, it would be helpful to mention this dependency in
>>>> the building-from-source docs.
>>>
>>>
>>>
>>> It can't be conditional on cctools version without having specs 
>>> conditional on that version, which seemed like a lot of work for no 
>>> point (since you already have to upgrade to -528, going -528.5 
>>> doesn't seem like it would be any extra burden).
>>>
>>> You can build GCC, I think, with the previous cctools.  You just 
>>> can't use -mcpu= with a non-default setting and no other flags.
>>
>>
>> Clunk (and not even a bootstrap).
>>
>> /Users/sts/s/fsf-gcc/macosx/gcc/xgcc 
>> -B/Users/sts/s/fsf-gcc/macosx/gcc/ 
>> -B/usr/local/powerpc-apple-darwin7.5.0/bin/ 
>> -B/usr/local/powerpc-apple-darwin7.5.0/lib/ -isystem 
>> /usr/local/powerpc-apple-darwin7.5.0/include -isystem 
>> /usr/local/powerpc-apple-darwin7.5.0/sys-include -DIN_GCC    -W -Wall 
>> -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes 
>> -Wold-style-definition  -isystem ./include  -I. -I. -I../../gcc/gcc 
>> -I../../gcc/gcc/. -I../../gcc/gcc/../include -I./../intl 
>> -I../../gcc/gcc/../libcpp/include   \
>>  -c ../../gcc/gcc/config/darwin-crt2.c -o crt2.o
>> /var/tmp//ccFiCTZQ.s:1:Unknown pseudo-op: .machine
>> /var/tmp//ccFiCTZQ.s:1:Rest of line ignored. 1st junk character 
>> valued 112 (p).
>> make[1]: *** [crt2.o] Error 1
>> make: *** [all-gcc] Error 2
>>
>> So yes, need to update doc/install.texi at least.
>
>
> Just so I understand what you did, you tried to bootstrap GCC on a 
> machine running cctools-528?
>
> My copy of cctools-528 does understand the .machine directive.

No, my mistake, it was a pre-528.

Stan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-18 23:16       ` Kelley Cook
  2004-10-18 23:20         ` Mike Stump
@ 2004-10-19 18:09         ` Stan Shebs
  2004-10-19 19:12           ` Kelley Cook
  1 sibling, 1 reply; 11+ messages in thread
From: Stan Shebs @ 2004-10-19 18:09 UTC (permalink / raw)
  To: Kelley Cook; +Cc: Geoffrey Keating, gcc-patches

Kelley Cook wrote:

> Stan Shebs wrote:
>
>> /var/tmp//ccFiCTZQ.s:1:Unknown pseudo-op: .machine
>> /var/tmp//ccFiCTZQ.s:1:Rest of line ignored. 1st junk character 
>> valued 112 (p).
>> make[1]: *** [crt2.o] Error 1
>> make: *** [all-gcc] Error 2
>>
>> So yes, need to update doc/install.texi at least.
>
>
> Or this patch should do the trick:
>
> tested powerpc-apple-darwin7.5
>
> OK to install?
>
Yes, thanks! The error could be made a little more helpful by adding
", such as cctools-528 or later" (so phrased in case the already
submitted Mach-O support for gas goes in, and resulting in a chance
that a non-cctools assembler might be installed).

Stan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: .machine for Darwin, new cctools required
  2004-10-19 18:09         ` Stan Shebs
@ 2004-10-19 19:12           ` Kelley Cook
  0 siblings, 0 replies; 11+ messages in thread
From: Kelley Cook @ 2004-10-19 19:12 UTC (permalink / raw)
  To: Stan Shebs; +Cc: Geoffrey Keating, gcc-patches

--- Stan Shebs <shebs@apple.com> wrote:

> Yes, thanks! The error could be made a little more helpful by adding
> ", such as cctools-528 or later" (so phrased in case the already
> submitted Mach-O support for gas goes in, and resulting in a chance
> that a non-cctools assembler might be installed).

The patch was checked in last night; feel free to modify the wording as
you see fit.

KC

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-10-19 18:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-14 22:41 .machine for Darwin, new cctools required Geoffrey Keating
2004-10-14 22:50 ` Stan Shebs
2004-10-14 23:02   ` Geoffrey Keating
2004-10-15  4:08     ` Stan Shebs
2004-10-15  4:52     ` Stan Shebs
2004-10-15 17:45       ` Geoffrey Keating
2004-10-19 17:55         ` Stan Shebs
2004-10-18 23:16       ` Kelley Cook
2004-10-18 23:20         ` Mike Stump
2004-10-19 18:09         ` Stan Shebs
2004-10-19 19:12           ` Kelley Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).