removed -CD -XD compiler options, only pass link style if explicitly set

git-svn-id: trunk@6350 -
This commit is contained in:
vincents 2004-12-09 12:52:22 +00:00
parent 142e4289a4
commit 5da54bbcd4
3 changed files with 67 additions and 87 deletions

View File

@ -358,7 +358,7 @@ procedure SaveXMLCompileReasons(const AConfig: TXMLConfig; const APath: String;
implementation implementation
const const
CompilerOptionsVersion = 2; CompilerOptionsVersion = 3;
Config_Filename = 'compileroptions.xml'; Config_Filename = 'compileroptions.xml';
MaxParseStamp = $7fffffff; MaxParseStamp = $7fffffff;
MinParseStamp = -$7fffffff; MinParseStamp = -$7fffffff;
@ -831,6 +831,22 @@ var
CompilationGenerateCodeNames[cgcNormalCode])); CompilationGenerateCodeNames[cgcNormalCode]));
end; end;
end; end;
procedure ReadSmartLinkUnit;
begin
if FileVersion<3 then
SmartLinkUnit := XMLConfigFile.GetValue(p+'UnitStyle/Value', 1)=2
else
SmartLinkUnit := XMLConfigFile.GetValue(p+'SmartLinkUnit/Value', false);
end;
procedure ReadLinkSmart;
begin
if FileVersion<3 then
LinkSmart := XMLConfigFile.GetValue(p+'LinkStyle/Value', 1)=3
else
LinkSmart := XMLConfigFile.GetValue(p+'LinkSmart/Value', false);
end;
begin begin
{ Load the compiler options from the XML file } { Load the compiler options from the XML file }
@ -870,7 +886,7 @@ begin
{ CodeGeneration } { CodeGeneration }
p:=Path+'CodeGeneration/'; p:=Path+'CodeGeneration/';
UnitStyle := XMLConfigFile.GetValue(p+'UnitStyle/Value', 1); ReadSmartLinkUnit;
IOChecks := XMLConfigFile.GetValue(p+'Checks/IOChecks/Value', false); IOChecks := XMLConfigFile.GetValue(p+'Checks/IOChecks/Value', false);
RangeChecks := XMLConfigFile.GetValue(p+'Checks/RangeChecks/Value', false); RangeChecks := XMLConfigFile.GetValue(p+'Checks/RangeChecks/Value', false);
OverflowChecks := XMLConfigFile.GetValue(p+'Checks/OverflowChecks/Value', false); OverflowChecks := XMLConfigFile.GetValue(p+'Checks/OverflowChecks/Value', false);
@ -895,7 +911,7 @@ begin
UseValgrind := XMLConfigFile.GetValue(p+'Debugging/UseValgrind/Value', false); UseValgrind := XMLConfigFile.GetValue(p+'Debugging/UseValgrind/Value', false);
GenGProfCode := XMLConfigFile.GetValue(p+'Debugging/GenGProfCode/Value', false); GenGProfCode := XMLConfigFile.GetValue(p+'Debugging/GenGProfCode/Value', false);
StripSymbols := XMLConfigFile.GetValue(p+'Debugging/StripSymbols/Value', false); StripSymbols := XMLConfigFile.GetValue(p+'Debugging/StripSymbols/Value', false);
LinkStyle := XMLConfigFile.GetValue(p+'LinkStyle/Value', 1); ReadLinkSmart;
PassLinkerOptions := XMLConfigFile.GetValue(p+'Options/PassLinkerOptions/Value', false); PassLinkerOptions := XMLConfigFile.GetValue(p+'Options/PassLinkerOptions/Value', false);
LinkerOptions := f(XMLConfigFile.GetValue(p+'Options/LinkerOptions/Value', '')); LinkerOptions := f(XMLConfigFile.GetValue(p+'Options/LinkerOptions/Value', ''));
Win32GraphicApp := XMLConfigFile.GetValue(p+'Options/Win32/GraphicApplication/Value', false); Win32GraphicApp := XMLConfigFile.GetValue(p+'Options/Win32/GraphicApplication/Value', false);
@ -1007,7 +1023,7 @@ begin
{ CodeGeneration } { CodeGeneration }
p:=Path+'CodeGeneration/'; p:=Path+'CodeGeneration/';
XMLConfigFile.SetDeleteValue(p+'UnitStyle/Value', UnitStyle,1); XMLConfigFile.SetDeleteValue(p+'SmartLinkUnit/Value', SmartLinkUnit,false);
XMLConfigFile.SetDeleteValue(p+'Checks/IOChecks/Value', IOChecks,false); XMLConfigFile.SetDeleteValue(p+'Checks/IOChecks/Value', IOChecks,false);
XMLConfigFile.SetDeleteValue(p+'Checks/RangeChecks/Value', RangeChecks,false); XMLConfigFile.SetDeleteValue(p+'Checks/RangeChecks/Value', RangeChecks,false);
XMLConfigFile.SetDeleteValue(p+'Checks/OverflowChecks/Value', OverflowChecks,false); XMLConfigFile.SetDeleteValue(p+'Checks/OverflowChecks/Value', OverflowChecks,false);
@ -1032,7 +1048,7 @@ begin
XMLConfigFile.SetDeleteValue(p+'Debugging/UseValgrind/Value', UseValgrind,false); XMLConfigFile.SetDeleteValue(p+'Debugging/UseValgrind/Value', UseValgrind,false);
XMLConfigFile.SetDeleteValue(p+'Debugging/GenGProfCode/Value', GenGProfCode,false); XMLConfigFile.SetDeleteValue(p+'Debugging/GenGProfCode/Value', GenGProfCode,false);
XMLConfigFile.SetDeleteValue(p+'Debugging/StripSymbols/Value', StripSymbols,false); XMLConfigFile.SetDeleteValue(p+'Debugging/StripSymbols/Value', StripSymbols,false);
XMLConfigFile.SetDeleteValue(p+'LinkStyle/Value', LinkStyle,1); XMLConfigFile.SetDeleteValue(p+'LinkSmart/Value', LinkSmart,false);
XMLConfigFile.SetDeleteValue(p+'Options/PassLinkerOptions/Value', PassLinkerOptions,false); XMLConfigFile.SetDeleteValue(p+'Options/PassLinkerOptions/Value', PassLinkerOptions,false);
XMLConfigFile.SetDeleteValue(p+'Options/LinkerOptions/Value', LinkerOptions,''); XMLConfigFile.SetDeleteValue(p+'Options/LinkerOptions/Value', LinkerOptions,'');
XMLConfigFile.SetDeleteValue(p+'Options/Win32/GraphicApplication/Value', Win32GraphicApp,false); XMLConfigFile.SetDeleteValue(p+'Options/Win32/GraphicApplication/Value', Win32GraphicApp,false);
@ -1528,12 +1544,9 @@ Processor specific options:
{ ----------- Code Generation Tab --------------- } { ----------- Code Generation Tab --------------- }
{ UnitStyle '' = Static 'D' = Dynamic 'X' = smart linked } { UnitStyle '' = Static 'D' = Dynamic (not implemented) 'X' = smart linked }
case (UnitStyle) of if SmartLinkUnit then
0: ; switches := switches + ' -CX';
1: switches := switches + ' -CD';
2: switches := switches + ' -CX';
end;
{ Checks } { Checks }
tempsw := ''; tempsw := '';
@ -1643,16 +1656,13 @@ Processor specific options:
switches := switches + ' -Xs'; switches := switches + ' -Xs';
{ Link Style { Link Style
-XD = Link with dynamic libraries -XD = Link with dynamic libraries, not implemented by FPC
-XS = Link with static libraries -XS = Link with static libraries, default on non-win32 platforms
-XX = Link smart -XX = Link smart
} }
if (not (ccloNoLinkerOpts in Flags)) then
case (LinkStyle) of if (not (ccloNoLinkerOpts in Flags)) and LinkSmart then
1: switches := switches + ' -XD'; // dynamic switches := switches + ' -XX';
2: switches := switches + ' -XS'; // static
3: switches := switches + ' -XX -CX'; // smart
end;
// additional Linker options // additional Linker options
if PassLinkerOptions and (not (ccloNoLinkerOpts in Flags)) then begin if PassLinkerOptions and (not (ccloNoLinkerOpts in Flags)) then begin
@ -1894,7 +1904,7 @@ begin
fGPCCompat := false; fGPCCompat := false;
// code generation // code generation
fUnitStyle := 1; fSmartLinkUnit := false;
fIOChecks := false; fIOChecks := false;
fRangeChecks := false; fRangeChecks := false;
fOverflowChecks := false; fOverflowChecks := false;
@ -1916,7 +1926,7 @@ begin
fUseValgrind := false; fUseValgrind := false;
fGenGProfCode := false; fGenGProfCode := false;
fStripSymbols := false; fStripSymbols := false;
fLinkStyle := 1; fLinkSmart := false;
fPassLinkerOpt := false; fPassLinkerOpt := false;
LinkerOptions := ''; LinkerOptions := '';
Win32GraphicApp := false; Win32GraphicApp := false;
@ -1994,7 +2004,7 @@ begin
fGPCCompat := CompOpts.fGPCCompat; fGPCCompat := CompOpts.fGPCCompat;
// Code Generation // Code Generation
fUnitStyle := CompOpts.fUnitStyle; fSmartLinkUnit := CompOpts.SmartLinkUnit;
fIOChecks := CompOpts.fIOChecks; fIOChecks := CompOpts.fIOChecks;
fRangeChecks := CompOpts.fRangeChecks; fRangeChecks := CompOpts.fRangeChecks;
fOverflowChecks := CompOpts.fOverflowChecks; fOverflowChecks := CompOpts.fOverflowChecks;
@ -2018,7 +2028,7 @@ begin
fUseValgrind := CompOpts.fUseValgrind; fUseValgrind := CompOpts.fUseValgrind;
fGenGProfCode := CompOpts.fGenGProfCode; fGenGProfCode := CompOpts.fGenGProfCode;
fStripSymbols := CompOpts.fStripSymbols; fStripSymbols := CompOpts.fStripSymbols;
fLinkStyle := CompOpts.fLinkStyle; fLinkSmart := CompOpts.fLinkSmart;
fPassLinkerOpt := CompOpts.fPassLinkerOpt; fPassLinkerOpt := CompOpts.fPassLinkerOpt;
LinkerOptions := CompOpts.fLinkerOptions; LinkerOptions := CompOpts.fLinkerOptions;
Win32GraphicApp := CompOpts.Win32GraphicApp; Win32GraphicApp := CompOpts.Win32GraphicApp;
@ -2085,7 +2095,7 @@ begin
and (fGPCCompat = CompOpts.fGPCCompat) and (fGPCCompat = CompOpts.fGPCCompat)
// code generation // code generation
and (fUnitStyle = CompOpts.fUnitStyle) and (fSmartLinkUnit = CompOpts.SmartLinkUnit)
and (fIOChecks = CompOpts.fIOChecks) and (fIOChecks = CompOpts.fIOChecks)
and (fRangeChecks = CompOpts.fRangeChecks) and (fRangeChecks = CompOpts.fRangeChecks)
and (fOverflowChecks = CompOpts.fOverflowChecks) and (fOverflowChecks = CompOpts.fOverflowChecks)
@ -2109,7 +2119,7 @@ begin
and (fUseValgrind = CompOpts.fUseValgrind) and (fUseValgrind = CompOpts.fUseValgrind)
and (fGenGProfCode = CompOpts.fGenGProfCode) and (fGenGProfCode = CompOpts.fGenGProfCode)
and (fStripSymbols = CompOpts.fStripSymbols) and (fStripSymbols = CompOpts.fStripSymbols)
and (fLinkStyle = CompOpts.fLinkStyle) and (fLinkSmart = CompOpts.fLinkSmart)
and (fPassLinkerOpt = CompOpts.fPassLinkerOpt) and (fPassLinkerOpt = CompOpts.fPassLinkerOpt)
and (fLinkerOptions = CompOpts.fLinkerOptions) and (fLinkerOptions = CompOpts.fLinkerOptions)
and (FWin32GraphicApp = CompOpts.FWin32GraphicApp) and (FWin32GraphicApp = CompOpts.FWin32GraphicApp)

View File

@ -97,7 +97,8 @@ type
{ Code Generation Controls } { Code Generation Controls }
CodeGenPage: TPage; CodeGenPage: TPage;
grpUnitStyle: TRadioGroup; grpSmartLinkUnit: TGroupBox;
chkSmartLinkUnit: TCheckBox;
grpChecks: TGroupBox; grpChecks: TGroupBox;
chkChecksIO: TCheckBox; chkChecksIO: TCheckBox;
@ -138,9 +139,7 @@ type
chkSymbolsStrip: TCheckBox; chkSymbolsStrip: TCheckBox;
grpLinkLibraries: TGroupBox; grpLinkLibraries: TGroupBox;
radLibsLinkDynamic: TRadioButton; chkLinkSmart: TCheckBox;
radLibsLinkStatic: TRadioButton;
radLibsLinkSmart: TRadioButton;
grpOptions: TGroupBox; grpOptions: TGroupBox;
chkOptionsLinkOpt: TCheckBox; chkOptionsLinkOpt: TCheckBox;
@ -669,7 +668,7 @@ begin
chkSymGPCCompat.Checked := Options.GPCCompat; chkSymGPCCompat.Checked := Options.GPCCompat;
// code generation // code generation
grpUnitStyle.ItemIndex:=Options.UnitStyle; chkSmartLinkUnit.Checked := Options.SmartLinkUnit;
chkChecksIO.Checked := Options.IOChecks; chkChecksIO.Checked := Options.IOChecks;
chkChecksRange.Checked := Options.RangeChecks; chkChecksRange.Checked := Options.RangeChecks;
@ -712,11 +711,7 @@ begin
chkSymbolsStrip.Checked := Options.StripSymbols; chkSymbolsStrip.Checked := Options.StripSymbols;
chkSymbolsStrip.Enabled:=EnabledLinkerOpts; chkSymbolsStrip.Enabled:=EnabledLinkerOpts;
case Options.LinkStyle of chkLinkSmart.Checked := Options.LinkSmart;
1: radLibsLinkDynamic.Checked := true;
2: radLibsLinkStatic.Checked := true;
3: radLibsLinkSmart.Checked := true;
end;
grpLinkLibraries.Enabled:=EnabledLinkerOpts; grpLinkLibraries.Enabled:=EnabledLinkerOpts;
chkOptionsLinkOpt.Checked := Options.PassLinkerOptions; chkOptionsLinkOpt.Checked := Options.PassLinkerOptions;
@ -895,7 +890,7 @@ begin
Options.GPCCompat := chkSymGPCCompat.Checked; Options.GPCCompat := chkSymGPCCompat.Checked;
// code generation // code generation
Options.UnitStyle := grpUnitStyle.ItemIndex; Options.SmartLinkUnit := chkSmartLinkUnit.Checked;
Options.IOChecks := chkChecksIO.Checked; Options.IOChecks := chkChecksIO.Checked;
Options.RangeChecks := chkChecksRange.Checked; Options.RangeChecks := chkChecksRange.Checked;
@ -941,15 +936,7 @@ begin
Options.PassLinkerOptions := chkOptionsLinkOpt.Checked; Options.PassLinkerOptions := chkOptionsLinkOpt.Checked;
Options.LinkerOptions := edtOptionsLinkOpt.Text; Options.LinkerOptions := edtOptionsLinkOpt.Text;
Options.Win32GraphicApp := chkWin32GraphicApp.Checked; Options.Win32GraphicApp := chkWin32GraphicApp.Checked;
Options.LinkSmart := chkLinkSmart.Checked;
if (radLibsLinkDynamic.Checked) then
Options.LinkStyle := 1
else if (radLibsLinkStatic.Checked) then
Options.LinkStyle := 2
else if (radLibsLinkSmart.Checked) then
Options.LinkStyle := 3
else
Options.LinkStyle := 1;
// messages // messages
Options.ShowErrors := chkErrors.Checked; Options.ShowErrors := chkErrors.Checked;
@ -1341,8 +1328,8 @@ begin
// Setup the Code Generation Tab // Setup the Code Generation Tab
CodeGenPage:=nbMain.Page[Page]; CodeGenPage:=nbMain.Page[Page];
grpUnitStyle := TRadioGroup.Create(Self); grpSmartLinkUnit := TGroupBox.Create(Self);
with grpUnitStyle do with grpSmartLinkUnit do
begin begin
Parent := CodeGenPage; Parent := CodeGenPage;
Top := 5; Top := 5;
@ -1350,11 +1337,16 @@ begin
Height := 80; Height := 80;
Width := 150; Width := 150;
Caption := dlgCOUnitStyle; Caption := dlgCOUnitStyle;
with Items do begin end;
Add(dlgStatic+' (none)');
Add(dlgDynamic+' (-CD)'); chkSmartLinkUnit := TCheckBox.Create(Self);
Add(dlgCOSmart+' (-CS)'); with chkSmartLinkUnit do
end; begin
Parent := grpSmartLinkUnit;
Caption := 'Smart Linking (-CX)';
Top := 5;
Left := 5;
Width := Parent.ClientWidth-13;
end; end;
{------------------------------------------------------------} {------------------------------------------------------------}
@ -1363,7 +1355,7 @@ begin
begin begin
Parent := CodeGenPage; Parent := CodeGenPage;
Top := 5; Top := 5;
Left := grpUnitStyle.Left + grpUnitStyle.Width + 10; Left := grpSmartLinkUnit.Left + grpSmartLinkUnit.Width + 10;
Height := 80; Height := 80;
Width := 210; Width := 210;
Caption := dlgCOChecks; Caption := dlgCOChecks;
@ -1440,7 +1432,7 @@ begin
with grpGenerate do with grpGenerate do
begin begin
Parent := CodeGenPage; Parent := CodeGenPage;
Top := grpUnitStyle.Top + grpUnitStyle.Height + 6; Top := grpSmartLinkUnit.Top + grpSmartLinkUnit.Height + 6;
Left := 10; Left := 10;
Height := 90; Height := 90;
Width := 150; Width := 150;
@ -1699,42 +1691,20 @@ begin
Parent := LinkingPage; Parent := LinkingPage;
Top := grpDebugging.Top + grpDebugging.Height + 10; Top := grpDebugging.Top + grpDebugging.Height + 10;
Left := 10; Left := 10;
Height := 91; Height := 50;
Width := (Self.ClientWidth-30) div 2; Width := (Self.ClientWidth-30) div 2;
Caption := dlgLinkLibraries; Caption := dlgLinkLibraries;
end; end;
radLibsLinkDynamic := TRadioButton.Create(Self); chkLinkSmart := TCheckBox.Create(Self);
with radLibsLinkDynamic do with chkLinkSmart do
begin begin
Parent := grpLinkLibraries; Parent := grpLinkLibraries;
Caption := dlgLinkDinLibs+' (-XD)'; Caption := dlgLinkSmart+' (-XX)';
Top := 6; Top := 6;
Left := 8; Left := 8;
Height := 22; Height := 22;
Width := Parent.Width-10; Width := Parent.ClientWidth-13;
end;
radLibsLinkStatic := TRadioButton.Create(Self);
with radLibsLinkStatic do
begin
Parent := grpLinkLibraries;
Caption := dlgLinkStatLibs+' (-XS)';
Top := 27;
Left := 8;
Height := 22;
Width := Parent.Width-10;
end;
radLibsLinkSmart := TRadioButton.Create(Self);
with radLibsLinkSmart do
begin
Parent := grpLinkLibraries;
Caption := dlgLinkSmart+' (-XX -CX)';
Top := 48;
Left := 8;
Height := 22;
Width := Parent.Width-10;
end; end;
{------------------------------------------------------------} {------------------------------------------------------------}
@ -1754,10 +1724,10 @@ begin
begin begin
Parent := TargetSpecificsGrpBox; Parent := TargetSpecificsGrpBox;
Caption := 'Win32 gui application (-WG)'; Caption := 'Win32 gui application (-WG)';
Top := 5; Top := 8;
Left := 2; Left := 2;
Height := 22; Height := 22;
Width := Parent.Width-10; Width := Parent.Width-13;
end; end;
{------------------------------------------------------------} {------------------------------------------------------------}

View File

@ -80,7 +80,7 @@ type
fStaticKwd: Boolean; fStaticKwd: Boolean;
// Code generation: // Code generation:
fUnitStyle: Integer; fSmartLinkUnit: Boolean;
fIOChecks: Boolean; fIOChecks: Boolean;
fRangeChecks: Boolean; fRangeChecks: Boolean;
fOverflowChecks: Boolean; fOverflowChecks: Boolean;
@ -104,7 +104,7 @@ type
fUseValgrind: Boolean; fUseValgrind: Boolean;
fGenGProfCode: Boolean; fGenGProfCode: Boolean;
fStripSymbols: Boolean; fStripSymbols: Boolean;
fLinkStyle: Integer; fLinkSmart: Boolean;
fPassLinkerOpt: Boolean; fPassLinkerOpt: Boolean;
fLinkerOptions: String; fLinkerOptions: String;
FWin32GraphicApp: boolean; FWin32GraphicApp: boolean;
@ -184,7 +184,7 @@ type
property StaticKeyword: Boolean read fStaticKwd write fStaticKwd; property StaticKeyword: Boolean read fStaticKwd write fStaticKwd;
// code generation: // code generation:
property UnitStyle: Integer read fUnitStyle write fUnitStyle; property SmartLinkUnit: Boolean read fSmartLinkUnit write fSmartLinkUnit;
property IOChecks: Boolean read fIOChecks write fIOChecks; property IOChecks: Boolean read fIOChecks write fIOChecks;
property RangeChecks: Boolean read fRangeChecks write fRangeChecks; property RangeChecks: Boolean read fRangeChecks write fRangeChecks;
property OverflowChecks: Boolean read fOverflowChecks write fOverflowChecks; property OverflowChecks: Boolean read fOverflowChecks write fOverflowChecks;
@ -210,7 +210,7 @@ type
property UseValgrind: Boolean read fUseValgrind write fUseValgrind; property UseValgrind: Boolean read fUseValgrind write fUseValgrind;
property GenGProfCode: Boolean read fGenGProfCode write fGenGProfCode; property GenGProfCode: Boolean read fGenGProfCode write fGenGProfCode;
property StripSymbols: Boolean read fStripSymbols write fStripSymbols; property StripSymbols: Boolean read fStripSymbols write fStripSymbols;
property LinkStyle: Integer read fLinkStyle write fLinkStyle; property LinkSmart: Boolean read fLinkSmart write fLinkSmart;
property PassLinkerOptions: Boolean read fPassLinkerOpt write fPassLinkerOpt; property PassLinkerOptions: Boolean read fPassLinkerOpt write fPassLinkerOpt;
property LinkerOptions: String read fLinkerOptions write SetLinkerOptions; property LinkerOptions: String read fLinkerOptions write SetLinkerOptions;
property Win32GraphicApp: boolean read FWin32GraphicApp write FWin32GraphicApp; property Win32GraphicApp: boolean read FWin32GraphicApp write FWin32GraphicApp;