fix for 48208 and 48260 on darwin

IainS developer@sandoe-acoustics.co.uk
Mon Mar 28 07:42:00 GMT 2011


Hi Christian,

On 28 Mar 2011, at 04:55, Christian Schüler wrote:
>
> F
> -C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path  
> after %qs)
> +Driver C ObjC C++ ObjC++ Joined Separate MissingArgError(missing  
> path after \
> %qs)
> -F <dir>	Add <dir> to the end of the main framework include path

This looks right (but I cannot approve it).

> +++ gcc-4.6.0-RC-20110321-patched/gcc/config/darwin-driver.c	 
> 2011-03-26
> 07:01:02.000000000 +0100
> @@ -161,6 +161,13 @@
> 	continue;
>       switch ((*decoded_options)[i].opt_index)
> 	{
> +#if DARWIN_X86
> +	case OPT_arch:
> +	  if (!strcmp ((*decoded_options)[i].arg, "i386"))
> +		generate_option (OPT_m32, NULL, 1, CL_DRIVER, &(*decoded_options) 
> [i]);
> +	  else if (!strcmp ((*decoded_options)[i].arg, "x86_64"))
> +		generate_option (OPT_m64, NULL, 1, CL_DRIVER, &(*decoded_options) 
> [i]);
> +	  break;
> +#endif

Hm - this doesn't quite cover the scenario - what about people using  
GCC on powerpc*-darwin9?
(or people on x86-darwin10 targeting powerpc on darwin9)?

Normally, the "arch" option is recognized (and swallowed) by the  
"Apple way" 'driverdriver.c' program which then emits the right driver  
lines for the arch (and deals with cross-compiler lines for ppc).

driverdriver.c is available from the Apple Local GCC open source  
releases (e.g. http://opensource.apple.com/source/gcc/gcc-5646/driverdriver.c)
- it's at the top of the source tree
- it builds OK against gcc-4.5 headers  - which is OK, since it's a  
stand-alone program that just manipulates command lines (doesn't  
compile against gcc-4.6 headers because of the changes in option  
handling)

[I guess someone should cook up one for gcc/contrib that works with  
our new system].

One then builds the {ppc,x86}-apple-darwin* compilers, installs them  
and you have a working set that does the "Apple way" layer on top of  
GCC.

This works (at least a few weeks ago) - since I managed to get pre- 
release 4.6 going within XCode - but needs a couple more small patches  
to deal with other options.

---

-- ping me off list, if you would like to try this and I'll try and  
send more detailed instructions and a couple of additional patches  
that are "work in progress" ... 

--

however, I can neither approve nor reject your patches ;-)
cheers
Iain



More information about the Gcc-patches mailing list