public override string GetLinkerArguments(IStandardProject superProject, IStandardProject project)
{
var settings = GetSettings(project);
if(superProject != null && project.Type != ProjectType.StaticLibrary)
{
GenerateLinkerScript(superProject);
}
var result = string.Empty;
result += string.Format("{0} ", settings.LinkSettings.MiscLinkerArguments);
switch (settings.CompileSettings.Fpu)
{
case FPUSupport.Soft:
result += " -mfpu=fpv4-sp-d16 -mfloat-abi=softfp ";
break;
case FPUSupport.Hard:
result += " -mfpu=fpv4-sp-d16 -mfloat-abi=hard ";
break;
}
if (settings.LinkSettings.NotUseStandardStartupFiles)
{
result += "-nostartfiles ";
}
if (settings.LinkSettings.DiscardUnusedSections)
{
result += "-Wl,--gc-sections ";
}
switch (settings.CompileSettings.Optimization)
{
case OptimizationLevel.None:
result += " -O0";
break;
case OptimizationLevel.Level1:
result += " -O1";
break;
case OptimizationLevel.Level2:
result += " -O2";
break;
case OptimizationLevel.Level3:
result += " -O3";
break;
}
result += string.Format(" -L{0} -Wl,-T\"{1}\"", project.CurrentDirectory, GetLinkerScriptLocation(project));
return result;
}