[Patch ObjC/Darwin 1/3] Fix wrong code gen for m64 Objective-C
IainS
developer@sandoe-acoustics.co.uk
Mon Feb 14 13:17:00 GMT 2011
Hello all,
This patch corrects one of the two most significant outstanding Darwin
problems;
That is, that we generate incorrect code and meta-data for m64
Objective-C/C++, rendering these front ends of limited use on current
darwin/OSX systems. We also incorrectly assign GNU runtime data to
NeXT sections when LTO is active at m32.
---
The patch-set has been reviewed and approved off-list for the
Objective-C, Objective-C++ and Darwin aspects.
It touches only one file outside darwin & objc -
- which is to add two required flags to c-family/c.opt (for which I
also need approval)
===
As far as when to apply it:
Whilst we are in stage-4, I believe that Richard (G) indicated that
wrong-code bugs were eligible for inclusion, even at this stage.
If I have understood that correctly, I would ask please might this be
included in 4.6,
since it would be of considerable benefit to arguably the main targets
for Objective-C.
I should add that the patch is emphatically _not_ a "last minute fix" ..
.. it has been in progress for some months, it's regrettable that it
should be ready so late.
(but that is a problem with volunteer contributions, I guess)
===
The patch has been tested thus:
bootstrap/regtest
i686-linux (F13)
x86_64-linux (U10.10) @ m64/m32
i686-darwin{8,9}, x86_64-darwin10, powerpc-darwin9 *
cris-elf (simulator).
* on Darwin 9 and Darwin 10 Objective C/C++ are tested with
RUNTESTFLAGS="--target_board=unix\{-m32,-m32/-fobjc-abi-version=1,-
m64} "
to confirm the NeXT V1 ABI at m32.
without regression and with the expected new passes.
I have also built a version that can be used from XCode and
verified that the compiler builds
http://developer.snowmintcs.com/frameworks/sm2dgraphview/
http://aldebaran.armory.com/~zenomt/macosx/MTCoreAudio/
for m32 and m64.
for the first time since Darwin 9 was released :-)
cheers
Iain
====
** All three parts are required, I have split it up for ease of
potentially different reviewer focus.
====
gcc/c-family
* c.opts (fobjc-abi-version=) New.
(fobjc-nilcheck): New.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 170111-objc-m64-c-family.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110214/3b7f7164/attachment.txt>
-------------- next part --------------
gcc
* config/darwin-c.c (darwin_cpp_builtins): Set __OBJC2__.
* config/darwin.c (output_objc_section_asm_op): handle sections for
objective-c ABI 1 and 2.
(is_objc_metadata): Recognize objective-c meta-data attributes.
(darwin_objc2_section): New.
(darwin_objc1_section): New.
(machopic_select_section): Improve robustness of objective-c section
selection, deprecate the existing scheme (warn on use).
(darwin_emit_objc_zeroed): Correct sections for Objective-c items
placed
into BSS.
(darwin_output_aligned_bss): Likewise.
(darwin_asm_output_aligned_decl_common): Likewise.
(darwin_asm_output_aligned_decl_local): Likewise.
* config/darwin-sections.def: Add section definitions for objective-c
ABI 1
and 2.
* config/darwin.h (SUBTARGET_C_COMMON_OVERRIDE_OPTIONS):
Set the default objective-c ABI correctly for m64 compilation.
Adjust an over-length line.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 170111-objc-m64-darwin.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110214/3b7f7164/attachment-0001.txt>
-------------- next part --------------
More information about the Gcc-patches
mailing list