* objcprotocol symbols have to be weak in the non-fragile abi to prevent

conflicts in case a protocol is adopted by classes in multiple object
    files part of the same binary (mantis #20875)

git-svn-id: trunk@19865 -
This commit is contained in:
Jonas Maebe 2011-12-17 12:43:42 +00:00
parent 310e8e0b9c
commit 40a9762ac6
5 changed files with 64 additions and 0 deletions

3
.gitattributes vendored
View File

@ -9734,7 +9734,10 @@ tests/test/packages/cocoaint/tobjc33a.pp svneol=native#text/plain
tests/test/packages/cocoaint/tobjcnh1.pp svneol=native#text/plain
tests/test/packages/cocoaint/tvarpara.pp svneol=native#text/plain
tests/test/packages/cocoaint/tw16329.pp svneol=native#text/plain
tests/test/packages/cocoaint/tw20875.pp svneol=native#text/plain
tests/test/packages/cocoaint/tw20876.pp svneol=native#text/plain
tests/test/packages/cocoaint/uw20875a.pp svneol=native#text/plain
tests/test/packages/cocoaint/uw20875b.pp svneol=native#text/plain
tests/test/packages/fcl-base/tascii85.pp svneol=native#text/plain
tests/test/packages/fcl-base/tgettext1.pp svneol=native#text/plain
tests/test/packages/fcl-db/assertions.pas svneol=native#text/plain

View File

@ -1123,6 +1123,7 @@ procedure tobjcrttiwriter_nonfragile.gen_objc_protocol(list: tasmlist; protocol:
}
lbl:=current_asmdata.DefineAsmSymbol(protocol.rtti_mangledname(objcclassrtti),AB_PRIVATE_EXTERN,AT_DATA);
list.Concat(tai_symbol.Create_Global(lbl,0));
list.Concat(tai_directive.Create(asd_weak_definition,lbl.name));
protocollabel:=lbl;
{ protocol's isa - always nil }

View File

@ -0,0 +1,12 @@
{ %norun }
program testlink;
{$MODE Delphi}
{$modeswitch ObjectiveC1}
uses
uw20875a,uw20875b;
begin
end.

View File

@ -0,0 +1,24 @@
unit uw20875a;
{$MODE Delphi}
{$modeswitch ObjectiveC1}
interface
uses
CocoaAll;
type
TController1 = objcclass(NSWindowController, NSWindowDelegateProtocol)
public
function init : id; override;
end;
implementation
function TController1.init : id;
begin
Result := inherited init;
end;
end.

View File

@ -0,0 +1,24 @@
unit uw20875b;
{$MODE Delphi}
{$modeswitch ObjectiveC1}
interface
uses
CocoaAll;
type
TController2 = objcclass(NSWindowController, NSWindowDelegateProtocol)
public
function init : id; override;
end;
implementation
function TController2.init : id;
begin
Result := inherited init;
end;
end.