This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, target]: use -lobjc-gnu at 64-bit on Darwin
Andrew,
My intention wasn't to switch the objc in gcc trunk
entirely off of the NEXT runtime, but only change it
for -m64 which currently lacks a NEXT 64-bit runtime.
I suspect Geoff will object to switching it over entirely
since Leopard will provide a NEXT 64-bit runtime. Of
course if Geoff is willing to switch over to the GNU
runtime for the default that works as well. However
I am still unclear on the logistics of that since we
will end up with the NEXT libobjc and the GNU libobjc
with the same names (which seems like a bad idea). It
would seem we really would still want to use the
objc-gnu basename of the libraries but default to
them. We would have to change LINK_SPEC to default
to replacing -lobjc with -lobjc-gnu but change...
%{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)}\
to
%{fnext-runtime:%:replace-outfile(-lobjc-gnu -lobjc)}\
so that the NEXT runtime specific tests could pass if
the NEXT libobjc was in fact available.
Jack
On Sun, Oct 08, 2006 at 04:54:11PM -0700, Andrew Pinski wrote:
> On Sun, 2006-10-08 at 19:45 -0400, Jack Howarth wrote:
> > The proposed patch causes libobjc-gnu to be automatically used
> > on Darwin at 64-bit since no 64-bit system objc runtime exists
> > in any currently shipping version of MacOS X. It would have been
> > better to do this conditionally with something like...
> >
> > %{m64:%:version-compare(< 10.5 mmacosx-version-min= %{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)})}\
> >
> > but the current version-compare only takes simple strings as its
> > third argument. Okay for gcc trunk?
>
> This is only part of the story, you need also to patch config/darwin.h
> (and c-common) to change how NEXT_OBJC_RUNTIME is defined so you get the
> front-end defaulting to the GNU runtime.
>
> >From c-common.c:
> #ifdef NEXT_OBJC_RUNTIME
> int flag_next_runtime = 1;
> #else
> int flag_next_runtime = 0;
> #endif
>
> In fact you have to a lot more changes.
>
> -- Pinski