patch: Darwin/x86 fails to build

Andreas Jaeger aj@suse.de
Sat Jan 25 22:19:00 GMT 2003


This patch seems to break build on x86-linux-gnu, I just got:

libbackend.a(i386.o)(.text+0x3fdb6): In function `x86_output_mi_thunk':
/cvs/gcc/gcc/config/i386/i386.c:14817: undefined reference to `machopic_stub_name'

The problem seems to be that your patch has:
+ #if defined TARGET_MACHO
+ 	if (TARGET_MACHO)
+ 	  {
+ 	    char *ip = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function));
+ 	    tmp = gen_rtx_SYMBOL_REF (Pmode, machopic_stub_name (ip));
+ 	    tmp = gen_rtx_MEM (QImode, tmp);
+ 	    xops[0] = tmp;
+ 	    output_asm_insn ("jmp\t%0", xops);
+ 	  }
+ 	else
+ #endif /* TARGET_MACHO */

but i386.h has:

/* This is not really a target flag, but is done this way so that
   it's analogous to similar code for Mach-O on PowerPC.  darwin.h
   redefines this to 1.  */
#define TARGET_MACHO 0

rs6000 tests for
#if TARGET_MACHO

and since TARGET_MACHO can only have these two values, we should to
the same (as it is done also in the rest of the file).

I'm going to commit the append patch tomorrow as obvious after
bootstrapping/regtesting it,

Andreas

2003-01-25  Andreas Jaeger  <aj@suse.de>

	* config/i386/i386.c (x86_output_mi_thunk): Correct test for
	TARGET_MACHO.

============================================================
Index: gcc/config/i386/i386.c
--- gcc/config/i386/i386.c	25 Jan 2003 15:00:51 -0000	1.514
+++ gcc/config/i386/i386.c	25 Jan 2003 22:19:27 -0000
@@ -14810,7 +14810,7 @@ x86_output_mi_thunk (file, thunk, delta,
       if (!flag_pic || (*targetm.binds_local_p) (function))
 	output_asm_insn ("jmp\t%P0", xops);
       else
-#if defined TARGET_MACHO
+#if TARGET_MACHO
 	if (TARGET_MACHO)
 	  {
 	    char *ip = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function));

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Gcc-patches mailing list