* always pass -arch parameter to linker when targetting Darwin, instead of

skipping this for dynamic libraries (not sure why that was done, but
    apparently not passing -arch triggers a bug in Xcode 4.2 Lion linker,
    mantis #21159)

git-svn-id: trunk@20211 -
This commit is contained in:
Jonas Maebe 2012-02-01 19:01:58 +00:00
parent a2233d7991
commit 6a5cf6cf8d

View File

@ -337,29 +337,25 @@ begin
LinkRes.Add(sysrootpath); LinkRes.Add(sysrootpath);
end; end;
if (not isdll) or if (target_info.system in systems_darwin) then
(apptype=app_bundle) then
begin begin
if (target_info.system in systems_darwin) then LinkRes.Add('-arch');
begin case target_info.system of
LinkRes.Add('-arch'); system_powerpc_darwin:
case target_info.system of LinkRes.Add('ppc');
system_powerpc_darwin: system_i386_darwin,
LinkRes.Add('ppc'); system_i386_iphonesim:
system_i386_darwin, LinkRes.Add('i386');
system_i386_iphonesim: system_powerpc64_darwin:
LinkRes.Add('i386'); LinkRes.Add('ppc64');
system_powerpc64_darwin: system_x86_64_darwin:
LinkRes.Add('ppc64'); LinkRes.Add('x86_64');
system_x86_64_darwin: system_arm_darwin:
LinkRes.Add('x86_64'); { current versions of the linker require the sub-architecture type
system_arm_darwin: to be specified }
{ current versions of the linker require the sub-architecture type LinkRes.Add(lower(cputypestr[current_settings.cputype]));
to be specified }
LinkRes.Add(lower(cputypestr[current_settings.cputype]));
end;
end; end;
end; end;
{ Write path to search libraries } { Write path to search libraries }
HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First); HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First);
while assigned(HPath) do while assigned(HPath) do