PATCH: Darwin / Mac OS X native support, revised

Geoff Keating geoffk@geoffk.org
Sat Apr 7 20:14:00 GMT 2001


Stan Shebs <shebs@apple.com> writes:

> This is a revised version of the patch originally submitted in
> http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00042.html .  (Please
> see that message for general info about the patch.)
> 
> I believe that I've now accounted for all the feedback, mostly by
> stripping unnecessary things (for instance, FINALIZE_PIC turns out
> to have become a no-op!).  I also worked around the varasm.c tweak,
> so there are now no changes to generic GCC code, and made C++ work
> better.  The bootstrap on a Mac OS X final system just completed
> successfully.
> 
> OK to commit?

OK, except for the bit that Richard has already pointed out:
darwin_output_function_profiler will certainly not work in its
current form, you have to add the profiling code earlier and let
reload worry about register allocation.

I'd also appreciate it if you could also check that one non-darwin
powerpc port (your choice) still builds, just to catch simple errors.

Since you wrote, or at least understand, all this, I think you can
list yourself in MAINTAINERS as maintainer of the darwin port,
responsible for config/darwin*.

Also,

+   if (DEFAULT_ABI == ABI_DARWIN)
+     info_ptr->save_size = RS6000_ALIGN (info_ptr->save_size, 16);

I don't think this is harmful, but what's the point of it?  The stack
will still not be 16-byte aligned, because ->vars_size is only 8-byte
aligned.

Anyway, I think the port is safe enough now that future development of
it can go on in the CVS tree.

> 2001-04-06  Stan Shebs  <shebs@apple.com>
> 
>         Add Darwin (Mac OS X kernel) native support.
>         * config.gcc (powerpc-*-darwin*): Add native bits.
>         * config/darwin.c: New file, generic Darwin support functions.
>         * config/darwin.h: New file, generic Darwin definitions.
>         * config/darwin-protos.h: New file, generic Darwin prototypes.
>         * rs6000/darwin.h: New file, Darwin for PowerPC.
>         * rs6000/t-darwin: New file, Darwin makefile fragment.
>         * rs6000/rs6000.h (OBJECT_MACHO): New macro.
>         (TARGET_MACHO): Ditto.
>         (rs6000_abi): Add ABI_DARWIN.
>         (RS6000_REG_SAVE): Add ABI_DARWIN case.
>         (RS6000_SAVE_AREA): Ditto.
>         (FP_ARG_MAX_REG): Ditto.
>         (RETURN_ADDRESS_OFFSET): Ditto.
>         * rs6000/rs6000.c (rs6000_legitimize_address): Add TARGET_MACHO
>         cases.
>         (rs6000_emit_move): Add ABI_DARWIN cases.
>         (print_operand): Ditto.
>         (first_reg_to_save): Ditto.
>         (rs6000_stack_info): Ditto, also align stack by 16 instead of 8.
>         (debug_stack_info): Ditto.
>         (rs6000_emit_prologue): Ditto.
>         (rs6000_emit_epilogue): Ditto.
>         (output_mi_thunk): Add TARGET_MACHO case.
>         (darwin_output_function_profiler): New function.
>         (rs6000_add_gc_roots): Call machopic_add_gc_roots if TARGET_MACHO.
>         (add_compiler_stub): Ditto.
>         (output_compiler_stub): Ditto.
>         (no_previous_def): Ditto.
>         (output_call): Ditto.
>         (machopic_output_stub): Ditto.
>         (rs6000_machopic_legitimize_pic_address): Ditto.
>         (toc_section): Ditto.
>         * rs6000/rs6000.md (addsi3_high): New TARGET_MACHO pattern.
>         (macho_high): Ditto.
>         (macho_low): Ditto.
>         (movsi_low): Ditto.
>         (load_macho_picbase): Ditto.
>         (call): Add TARGET_MACHO case to modify function.
>         (call_value): Ditto.
>         (call_nonlocal_sysv): Add ABI_DARWIN case.
>         (call_value_nonlocal_sysv): Ditto.
>         * rs6000/rs6000-protos.h (rs6000_machopic_legitimize_pic_address):
>         Add prototype.
>         (machopic_output_stub): Ditto.
>         * ginclude/stddef.h: Test _BSD_WCHAR_T_DEFINED_.

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



More information about the Gcc-patches mailing list