Fixed GCC ld issue

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@842 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jwang36 2006-07-09 05:14:01 +00:00
parent 4c29d43304
commit bf0ce309d1
1 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,7 @@ public class CommandLineUserDefine {
String outputDelimiter = null; String outputDelimiter = null;
public void command(CCTask cctask, UserDefineDef userdefine){ public void command(CCTask cctask, UserDefineDef userdefine){
boolean isGccCommand = userdefine.getFamily().equalsIgnoreCase("GCC");
File workdir; File workdir;
Project project = cctask.getProject(); Project project = cctask.getProject();
if(userdefine.getWorkdir() == null) { if(userdefine.getWorkdir() == null) {
@ -117,6 +118,9 @@ public class CommandLineUserDefine {
String[] libSet = userdefine.get_libset(); String[] libSet = userdefine.get_libset();
if (libSet != null && libSet.length > 0){ if (libSet != null && libSet.length > 0){
cmdLen = cmdLen + libSet.length; cmdLen = cmdLen + libSet.length;
if (isGccCommand) {
cmdLen += 2; // we need -( and -) to group libs for GCC
}
} }
// //
@ -190,9 +194,15 @@ public class CommandLineUserDefine {
} }
if (libSet != null && libSet.length > 0){ if (libSet != null && libSet.length > 0){
if (isGccCommand) {
cmd[index++] = "-(";
}
for (int k = 0; k < libSet.length ; k++){ for (int k = 0; k < libSet.length ; k++){
cmd[index++] = libSet[k]; cmd[index++] = libSet[k];
} }
if (isGccCommand) {
cmd[index++] = "-)";
}
} }
for (int j = 0; j < fileNames.length; j++){ for (int j = 0; j < fileNames.length; j++){
// execute the command // execute the command