[PATCH] Fix i686-darwin after my pic base patch

Geoff Keating geoffk@geoffk.org
Tue Aug 19 16:41:00 GMT 2003


> X-Original-To: geoffk@foam.wonderslug.com
> Date: Mon, 18 Aug 2003 21:04:02 -0400
> Cc: Andrew Pinski <pinskia@physics.uc.edu>
> From: Andrew Pinski <pinskia@physics.uc.edu>
> X-OriginalArrivalTime: 19 Aug 2003 01:08:31.0984 (UTC) FILETIME=[681CB700:01C365EE]
> 
> I missed this when I testing my pic base patch because I could not 
> figure out
> how really to do a cross compiler but I finally figured out and found 
> some
> problems caused by my pic base patch.  These changes are needed as x86 
> has more
> changes for darwin support in its config file than rs6000 does.
> 
> To build a cross compiler on Mac OS X with x86 headers installed in 
> /usr/include
> is to ../configure --with-sysroot=/ --target=i686-apple-darwin6.6
> --with-as=/usr/libexec/gcc/darwin/i386/as --with-ld=/usr/bin/ld.
> Now I have a full capable cross compiler that works except for ld 
> problems.
> 
> Both of these changes are under TARGET_MACHO.
> 
> Okay?

Oh, good!  I've been trying to build a cross-compiler and wondering
why it wasn't working, this must be the answer.

(I was testing some patches that should make all the --with options
unnecessary and make the cross-compiler more like a regular compiler.)

This is OK.

> Thanks,
> Andrew Pinski
> 
> ChangeLog:
> 	* config/i386/i386.c (legitimate_pic_address_disp_p): Change the
> 	strstr with $pb to a strcompare with "<pic base>"
> 	(ix86_output_addr_diff_elt): Output the real pic base.
> 
> 
> Patch:
> 
> Index: i386.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
> retrieving revision 1.593
> diff -u -p -r1.593 i386.c
> --- i386.c	16 Aug 2003 11:04:59 -0000	1.593
> +++ i386.c	19 Aug 2003 00:14:31 -0000
> @@ -5715,7 +5715,7 @@ legitimate_pic_address_disp_p (register
>           if (GET_CODE (XEXP (disp, 1)) == SYMBOL_REF)
>             {
>               const char *sym_name = XSTR (XEXP (disp, 1), 0);
> -            if (strstr (sym_name, "$pb") != 0)
> +            if (! strcmp (sym_name, "<pic base>"))
>                 return 1;
>             }
>       }
> @@ -8027,8 +8027,11 @@ ix86_output_addr_diff_elt (FILE *file, i
>       fprintf (file, "%s%s%d@GOTOFF\n", ASM_LONG, LPREFIX, value);
>   #if TARGET_MACHO
>     else if (TARGET_MACHO)
> -    fprintf (file, "%s%s%d-%s\n", ASM_LONG, LPREFIX, value,
> -	     machopic_function_base_name () + 1);
> +    {
> +      fprintf (file, "%s%s%d-", ASM_LONG, LPREFIX, value);
> +      machopic_output_function_base_name (file);
> +      fprintf(file, "\n");
> +    }
>   #endif
>     else
>       asm_fprintf (file, "%s%U%s+[.-%s%d]\n",
> 


-- 
- Geoffrey Keating <geoffk@geoffk.org>



More information about the Gcc-patches mailing list