X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FCpptasks%2Fnet%2Fsf%2Fantcontrib%2Fcpptasks%2Fuserdefine%2FCommandLineUserDefine.java;h=1e4c0ce2b7e34ad34fc5209bb9cc6b5e54af3964;hp=b77f2db624f5f6f23d88c2e351c6bc456ecb70fc;hb=bf0ce309d12976a2c36335118b183cc5d38bdc00;hpb=4c29d43304de904175ffa3b771533f0dd93beff9 diff --git a/Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java b/Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java index b77f2db624..1e4c0ce2b7 100644 --- a/Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java +++ b/Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java @@ -39,6 +39,7 @@ public class CommandLineUserDefine { String outputDelimiter = null; public void command(CCTask cctask, UserDefineDef userdefine){ + boolean isGccCommand = userdefine.getFamily().equalsIgnoreCase("GCC"); File workdir; Project project = cctask.getProject(); if(userdefine.getWorkdir() == null) { @@ -117,6 +118,9 @@ public class CommandLineUserDefine { String[] libSet = userdefine.get_libset(); if (libSet != null && libSet.length > 0){ 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 (isGccCommand) { + cmd[index++] = "-("; + } for (int k = 0; k < libSet.length ; k++){ cmd[index++] = libSet[k]; } + if (isGccCommand) { + cmd[index++] = "-)"; + } } for (int j = 0; j < fileNames.length; j++){ // execute the command