vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| In article <3fabd096$0$13292$626a54ce@news.free.fr>, yim wrote: > Hi all, > > I got the error message "Arg list too long" when linking a very long object > files. > Does anyone know how to resolve this problem ? > > Thanks for help, > > Sakun > > Create a library of your various *.o files and link to the library? Mike |
| |||
| Mike wrote: > In article <3fabd096$0$13292$626a54ce@news.free.fr>, yim wrote: > >>I got the error message "Arg list too long" when linking a very long object >>files. >>Does anyone know how to resolve this problem ? > > Create a library of your various *.o files and link to the library? Or perhaps pre-link sets of the object files using ld -r. Or, on AIX 5, change the size of your command line buffer: smitty chgsys and look at the end of the list for "ARG/ENV list size". Default used to be 24K characters, and can now go up to 1/2 MB. It's a system-wide change and affects the footprint of every process, BTW. -- Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE __________________________________________________ ______________________ |
| |||
| Thanks for your reponse. - I tried the first solution but I run into another problem : cyclic dependencies. Seem to be hard to resolve this one. - The solution seems to fit me. Unfortunately, I used AIX 4. 3 and there is no command chgsys on it. Sakun "Gary R. Hook" <nospam@nospammers.net> wrote in message news:8vTqb.2125$nI6.875597948@newssvr30.news.prodi gy.com... > Mike wrote: > > > In article <3fabd096$0$13292$626a54ce@news.free.fr>, yim wrote: > > > >>I got the error message "Arg list too long" when linking a very long object > >>files. > >>Does anyone know how to resolve this problem ? > > > > Create a library of your various *.o files and link to the library? > > Or perhaps pre-link sets of the object files using ld -r. > > Or, on AIX 5, change the size of your command line buffer: > smitty chgsys > and look at the end of the list for "ARG/ENV list size". > Default used to be 24K characters, and can now go up to > 1/2 MB. It's a system-wide change and affects the footprint > of every process, BTW. > > -- > Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE > __________________________________________________ ______________________ > |
| |||
| In article <3faf6558$0$27586$626a54ce@news.free.fr>, yim wrote: > Thanks for your reponse. > > - I tried the first solution but I run into another problem : cyclic > dependencies. Seem to be hard to > resolve this one. > > - The solution seems to fit me. Unfortunately, I used AIX 4. 3 and there is > no command chgsys on it. > > Sakun > > > > "Gary R. Hook" <nospam@nospammers.net> wrote in message > news:8vTqb.2125$nI6.875597948@newssvr30.news.prodi gy.com... >> Mike wrote: >> >> > In article <3fabd096$0$13292$626a54ce@news.free.fr>, yim wrote: >> > >> >>I got the error message "Arg list too long" when linking a very long > object >> >>files. >> >>Does anyone know how to resolve this problem ? >> > >> > Create a library of your various *.o files and link to the library? >> >> Or perhaps pre-link sets of the object files using ld -r. >> >> Or, on AIX 5, change the size of your command line buffer: >> smitty chgsys >> and look at the end of the list for "ARG/ENV list size". >> Default used to be 24K characters, and can now go up to >> 1/2 MB. It's a system-wide change and affects the footprint >> of every process, BTW. >> >> -- >> Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE >> __________________________________________________ ______________________ >> > > The old way to solve cyclic dependencies(?) is with lorder and tsort. Seems we would do something like: ar -c libPROJ.a `lorder *.o | tsort` |
| |||
| Mike wrote: > In article <3faf6558$0$27586$626a54ce@news.free.fr>, yim wrote: > > The old way to solve cyclic dependencies(?) is with lorder and tsort. > Seems we would do something like: > > ar -c libPROJ.a `lorder *.o | tsort` AIX does not require the use of lorder. The linker reads every symbol in every named object file (including archive members) and makes them all available during the link operation. Perhaps the term "cyclic dependencies" implies some other problem? Did you try the ld -r approach? All this does is combine .o files into a summary .o, which can then be used in the final link. If the issue is C++ static constructors, you may need to add -qtwolink to your final command line. In any event, I think more detail would be useful. -- Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE __________________________________________________ ______________________ |
| |||
| "yim" <yim@free.fr> writes: >- I tried the first solution but I run into another problem : cyclic >dependencies. Seem to be hard to >resolve this one. >- The solution seems to fit me. Unfortunately, I used AIX 4. 3 and there is >no command chgsys on it. >> >>I got the error message "Arg list too long" when linking a very long >object >> >>files. >> >>Does anyone know how to resolve this problem ? Look at the -f option to ld. It lets you create a file of file names to be processed by ld as if they were on the command line. Presumably, this file is not limited to 24k bytes. (xlC appears to understand -f and pass it on to ld.) -- Dale Talcott, IT Research Computing Services, Purdue University aeh@quest.cc.purdue.edu http://quest.cc.purdue.edu/~aeh/ |
| |||
| Mike <mikee@mikee.ath.cx> writes: > The old way to solve cyclic dependencies(?) is with lorder and tsort. I do not know of any recent UNIX that needs contents of a single archive library to be sorted in any way. And I thought tsort'ing was only a speed optimization in the ancient times it was used. > In article <3faf6558$0$27586$626a54ce@news.free.fr>, yim wrote: > > - I tried the first solution but I run into another problem : cyclic > > dependencies. Seem to be hard to resolve this one. I am pretty sure that AIX is one system where cyclic dependencies are never an issue, because the linker is essentially a 2-pass. Perhaps you are mis-diagnosing the problem? Cheers, -- In order to understand recursion you must first understand recursion. |
| ||||
| First of all, I would like to thank you for you all to help me to resolve this difficult problem. Please see my reponse below. Sakun "Gary R. Hook" <nospam@nospammers.net> wrote in message news:ZWNrb.2940$L17.1163199503@newssvr30.news.prod igy.com... > Mike wrote: > > In article <3faf6558$0$27586$626a54ce@news.free.fr>, yim wrote: > > > > The old way to solve cyclic dependencies(?) is with lorder and tsort. > > Seems we would do something like: > > > > ar -c libPROJ.a `lorder *.o | tsort` > > AIX does not require the use of lorder. The linker reads > every symbol in every named object file (including archive > members) and makes them all available during the link > operation. Perhaps the term "cyclic dependencies" implies > some other problem? Well, my work is part of a very big project. We have around 1000 C/C++ files. Among these files there are 317 generated C files. When I tried to link all files, I got "Arg list too long". I decided so to create an archive including the 317 generated files but got an error due to "pmaker" (it is imposed to use pmaker. I cannot even control how it is called as it is part of a big project -- I need just to list the files to compile). I don't know exactly why this error happened. After searching unsuccesfully for the info related to AIX, I decided to create 4 archives for the generated files (the first 3, let's say lib1.a, lib2.a and lib3.a, contains 100 files each and the last one, lib4.a, 17). But at link, it said that function F1 used in lib2.a is not found. F1 is in lib1.a and it can used a function in the other archives (that's why I said "cyclic dependencies"). Now I try to put every archive twice as the following and I am able to link. LINK_LINE = \ ..... \ lib1.a \ lib2.a \ lib3.a \ lib4.a \ lib1.a \ lib2.a \ lib3.a \ lib4.a \ ..... > Did you try the ld -r approach? No, I will try ! > All > this does is combine .o files into a summary .o, which can > then be used in the final link. If the issue is C++ > static constructors, you may need to add -qtwolink to your > final command line. > > In any event, I think more detail would be useful. > > -- > Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE > __________________________________________________ ______________________ > |