Index: components/codetools/definetemplates.pas
===================================================================
--- components/codetools/definetemplates.pas	(revision 8917)
+++ components/codetools/definetemplates.pas	(working copy)
@@ -2789,8 +2789,8 @@
 
     TheProcess := TProcess.Create(nil);
     TheProcess.CommandLine := CmdLine;
-    TheProcess.Options:= [poUsePipes, poNoConsole, poStdErrToOutPut];
-    TheProcess.ShowWindow := swoNone;
+    TheProcess.Options:= [poUsePipes, poStdErrToOutPut];
+    TheProcess.ShowWindow := swoHide;
     try
       TheProcess.Execute;
       OutputLine:='';
@@ -2830,8 +2830,8 @@
 
     TheProcess := TProcess.Create(nil);
     TheProcess.CommandLine := CmdLine;
-    TheProcess.Options:= [poUsePipes, poNoConsole, poStdErrToOutPut];
-    TheProcess.ShowWindow := swoNone;
+    TheProcess.Options:= [poUsePipes, poStdErrToOutPut];
+    TheProcess.ShowWindow := swoHide;
     try
       TheProcess.Execute;
       if (TheProcess.Output<>nil) then
@@ -2878,8 +2878,8 @@
       CmdLine:=CmdLine+' '+CompilerOptions;
     CmdLine:=CmdLine+' -iTP';
     TheProcess.CommandLine := CmdLine;
-    TheProcess.Options:= [poUsePipes, poNoConsole, poStdErrToOutPut];
-    TheProcess.ShowWindow := swoNone;
+    TheProcess.Options:= [poUsePipes, poStdErrToOutPut];
+    TheProcess.ShowWindow := swoHide;
     try
       TheProcess.Execute;
       if TheProcess.Output<>nil then
Index: ide/compileroptions.pp
===================================================================
--- ide/compileroptions.pp	(revision 8917)
+++ ide/compileroptions.pp	(working copy)
@@ -1939,6 +1939,11 @@
     switches := switches + ' -T' + Globals.TargetOS
   else if (TargetOS<>'') then
     switches := switches + ' -T' + TargetOS;
+  { Target CPU }
+  if (Globals<>nil) and (Globals.TargetCPU<>'') then
+    switches := switches + ' -P' + Globals.TargetCPU
+  else if (TargetCPU<>'') then
+    switches := switches + ' -P' + TargetCPU;
   { --------------- Linking Tab ------------------- }
   
   { Debugging }
Index: ide/compileroptionsdlg.pp
===================================================================
--- ide/compileroptionsdlg.pp	(revision 8917)
+++ ide/compileroptionsdlg.pp	(working copy)
@@ -1598,7 +1598,7 @@
     Parent := grpTargetPlatform;
     Left := 4;
     AnchorVerticalCenterTo(TargetCPUComboBox);
-    Caption :=dlgTargetCPU+' (-d)';
+    Caption :=dlgTargetCPU+' (-P)';
   end;
 
   Targeti386ProcComboBox:=TComboBox.Create(Self);
Index: ide/main.pp
===================================================================
--- ide/main.pp	(revision 8917)
+++ ide/main.pp	(working copy)
@@ -10247,7 +10247,7 @@
     CurOptions:=AddCmdLineParameter(CurOptions,'-T'+CurTargetOS);
   CurTargetCPU:=GetTargetCPU(false);
   if CurTargetCPU<>'' then
-    CurOptions:=AddCmdLineParameter(CurOptions,'-d'+CurTargetCPU);
+    CurOptions:=AddCmdLineParameter(CurOptions,'-P'+CurTargetCPU);
   {$IFDEF VerboseFPCSrcScan}
   writeln('TMainIDE.RescanCompilerDefines A ',CurOptions,
     ' OnlyIfCompilerChanged=',OnlyIfCompilerChanged,
