Sfoglia il codice sorgente

* 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 -

Jonas Maebe 13 anni fa
parent
commit
6a5cf6cf8d
1 ha cambiato i file con 17 aggiunte e 21 eliminazioni
  1. 17 21
      compiler/systems/t_bsd.pas

+ 17 - 21
compiler/systems/t_bsd.pas

@@ -337,29 +337,25 @@ begin
       LinkRes.Add(sysrootpath);
       LinkRes.Add(sysrootpath);
     end;
     end;
 
 
-  if (not isdll) or
-     (apptype=app_bundle) then
+  if (target_info.system in systems_darwin) then
     begin
     begin
-      if (target_info.system in systems_darwin) then
-        begin
-          LinkRes.Add('-arch');
-          case target_info.system of
-            system_powerpc_darwin:
-              LinkRes.Add('ppc');
-            system_i386_darwin,
-            system_i386_iphonesim:
-              LinkRes.Add('i386');
-            system_powerpc64_darwin:
-              LinkRes.Add('ppc64');
-            system_x86_64_darwin:
-              LinkRes.Add('x86_64');
-            system_arm_darwin:
-              { current versions of the linker require the sub-architecture type
-                to be specified }
-              LinkRes.Add(lower(cputypestr[current_settings.cputype]));
-          end;
+      LinkRes.Add('-arch');
+      case target_info.system of
+        system_powerpc_darwin:
+          LinkRes.Add('ppc');
+        system_i386_darwin,
+        system_i386_iphonesim:
+          LinkRes.Add('i386');
+        system_powerpc64_darwin:
+          LinkRes.Add('ppc64');
+        system_x86_64_darwin:
+          LinkRes.Add('x86_64');
+        system_arm_darwin:
+          { current versions of the linker require the sub-architecture type
+            to be specified }
+          LinkRes.Add(lower(cputypestr[current_settings.cputype]));
       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