Hi,
I am working on compile a UEFI project for AARCH64 platform on a Windows 7 machince using the following toolchain.
http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aa...
Now everything compiles except the last step of using "aarch64-none-elf-ar". We have about 100 obj files (say from OBJ#001 to OBJ#100) and "aarch64-none-elf-ar" reported "OBJ#50 file is missing".
It seems to me that "aarch64-none-elf-ar" has a limit of the command line string size.I tried to shorten the directory name (and file name), the situation got improved a little bit, now "aarch64-none-elf-ar" reports ""OBJ#85 is missing".
Does anyone is there a such limit and how could we circumvent this problem?
Thanks Jianning
This also occurs when OpenSSL is added and this is what we did to work around it:
[Object-File] <InputFile> *.obj *.o
<OutputFile> $(OUTPUT_DIR)(+)$(MODULE_NAME).lib
<Command.MSFT, Command.INTEL> "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} @$(OBJECT_FILES_LIST)
<Command.GCC> "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) @$(OBJECT_FILES_LIST)
<Command.RVCT, Command.WINRVCT> "$(SLINK)" $(SLINK_FLAGS) ${dst} --via $(OBJECT_FILES_LIST)
<Command.RVCTCYGWIN, Command.ARMGCC, Command.ARMLINUXGCC, Command.WINGCC, Command.ARM> # # The original workaround for this... # "$(OBJECT_FILES_LIST) has wrong paths for cygwin" # ...was to use the $(OBJECT_FILES) inline. # "$(SLINK)" $(SLINK_FLAGS) ${dst} $(OBJECT_FILES) # However, when OpenSSL is included the resultant command line passed to AR is # ~75Kb and AR fails to invoke with a command line this large. # Therefore, instead we post process the object file list into the right form # for AR (swapping the path separators) and pass the object list as a file. # sed "s:\:/:g" $(OBJECT_FILES_LIST) > $(OBJECT_FILES_LIST).unix "$(SLINK)" $(SLINK_FLAGS) ${dst} @$(OBJECT_FILES_LIST).unix
<Command.XCODE> "$(SLINK)" $(SLINK_FLAGS) ${dst} -filelist $(OBJECT_FILES_LIST)
Regards,
Paul.
From: linaro-uefi-bounces@lists.linaro.org [mailto:linaro-uefi-bounces@lists.linaro.org] On Behalf Of Jianning Wang Sent: Tuesday, February 17, 2015 1:39 PM To: linaro-uefi@lists.linaro.org Cc: Daniel Samuelraj Subject: [Linaro-uefi] "aarch64-none-elf-ar" has command line string size limit??
Hi,
I am working on compile a UEFI project for AARCH64 platform on a Windows 7 machince using the following toolchain.
http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aa...
Now everything compiles except the last step of using "aarch64-none-elf-ar". We have about 100 obj files (say from OBJ#001 to OBJ#100) and "aarch64-none-elf-ar" reported "OBJ#50 file is missing".
It seems to me that "aarch64-none-elf-ar" has a limit of the command line string size.I tried to shorten the directory name (and file name), the situation got improved a little bit, now "aarch64-none-elf-ar" reports ""OBJ#85 is missing".
Does anyone is there a such limit and how could we circumvent this problem?
Thanks Jianning
On Tue, Feb 17, 2015 at 04:39:22PM -0500, Jianning Wang wrote:
I am working on compile a UEFI project for AARCH64 platform on a Windows 7 machince using the following toolchain.
http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aa...
Now everything compiles except the last step of using "aarch64-none-elf-ar". We have about 100 obj files (say from OBJ#001 to OBJ#100) and "aarch64-none-elf-ar" reported "OBJ#50 file is missing".
Any chance of showing us the build system - how you are ending up with this long a command line?
It seems to me that "aarch64-none-elf-ar" has a limit of the command line string size.I tried to shorten the directory name (and file name), the situation got improved a little bit, now "aarch64-none-elf-ar" reports ""OBJ#85 is missing".
Does anyone is there a such limit and how could we circumvent this problem?
I think the limit you are encountering is in that of Windows, not of the cross compiler.
The workarounds I could suggest would be to either build on Linux, or trying under a Unix-like environment like cygwin or mingw.
But I'm thinking there could be modifications done to your build system that would resolve this.
/ Leif
On 02/17/2015 03:04 PM, Leif Lindholm wrote:
On Tue, Feb 17, 2015 at 04:39:22PM -0500, Jianning Wang wrote:
I am working on compile a UEFI project for AARCH64 platform on a Windows 7 machince using the following toolchain.
http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aa...
Now everything compiles except the last step of using "aarch64-none-elf-ar". We have about 100 obj files (say from OBJ#001 to OBJ#100) and "aarch64-none-elf-ar" reported "OBJ#50 file is missing".
Any chance of showing us the build system - how you are ending up with this long a command line?
It seems to me that "aarch64-none-elf-ar" has a limit of the command line string size.I tried to shorten the directory name (and file name), the situation got improved a little bit, now "aarch64-none-elf-ar" reports ""OBJ#85 is missing".
Does anyone is there a such limit and how could we circumvent this problem?
I think the limit you are encountering is in that of Windows, not of the cross compiler.
Agreed; this limit is not in the cross-compiler but in the Windows command line.
The workarounds I could suggest would be to either build on Linux, or trying under a Unix-like environment like cygwin or mingw.
But I'm thinking there could be modifications done to your build system that would resolve this.
/ Leif
Tricks I've used in the past are to just break up the command line, and keep appending objects to the library -- e.g., a whole series of steps invoking "aarch64-none-elf-ar r".
Sometimes, using "aarch64-none-elf-ar @file" will let you put a long list of file names in the file instead.
Or, depending on where you are in the linking process, some combination of "aarch64-none-elf-ld -r" steps can be used to build up the .o you're trying to get to.
I had the same issue a couple years ago.
I found WinXP has a limitation of 8191 characters (http://support.microsoft.com/kb/830473).
But the unix-like environment I was using (mingw) was limiting the command line at 750 characters.
I also tried Paul’s suggestion at that time but arm-linux-gnueabihf-ar.exe was not accepting the syntax ‘@<object_files_list>’.
It looks it has been fixed.
From: linaro-uefi-bounces@lists.linaro.org [mailto:linaro-uefi-bounces@lists.linaro.org] On Behalf Of Jianning Wang Sent: 17 February 2015 21:39 To: linaro-uefi@lists.linaro.org Cc: Daniel Samuelraj Subject: [Linaro-uefi] "aarch64-none-elf-ar" has command line string size limit??
Hi,
I am working on compile a UEFI project for AARCH64 platform on a Windows 7 machince using the following toolchain.
http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aa...
Now everything compiles except the last step of using "aarch64-none-elf-ar". We have about 100 obj files (say from OBJ#001 to OBJ#100) and "aarch64-none-elf-ar" reported "OBJ#50 file is missing".
It seems to me that "aarch64-none-elf-ar" has a limit of the command line string size.I tried to shorten the directory name (and file name), the situation got improved a little bit, now "aarch64-none-elf-ar" reports ""OBJ#85 is missing".
Does anyone is there a such limit and how could we circumvent this problem?
Thanks
Jianning