Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » Issue with building large libraries on Windows
Issue with building large libraries on Windows [message #492495] Tue, 20 October 2009 15:47 Go to next message
Laurent Gauthier is currently offline Laurent GauthierFriend
Messages: 2
Registered: October 2009
Junior Member
Hi there,

We are in the process of moving some of our software builds over to RTSC, and are running into an issue that we think is related to very long command lines on Windows.

We create a library with over 400 C source files in it. The target is a C64+ target.

Here is the relevant error message we get, slightly edited to protect the innocent:
... package/lib/./lib/OurLibrary_ReleaseTB/source/chm/src/zzzzzzzzzzzz.o64 package/lib/./lib/OurLibrary_ReleaseTB/source/chm/src/xxxxxx.o64 package/lib/./lib/OurLibrary_ReleaseTB/source/chm/src/yyyyyy.o64 into lib/OurLibrary_ReleaseTB.a64 ..., ...) failed.
make (e=87): The parameter is incorrect.
gmake.exe: *** [lib/OurLibrary_ReleaseTB.a64] Error 87


To work around this problem our previous build system has a work-around built-in that consist in passing to the archiver the list of object files for the libraryin a file rather than on the command line.

Another work-around I have seen implemented in another build system was a creation of the library archive in several pass (creation of the archive with a first set of object files, and addition of more object files in several increments) each of the passes having a limited command line length.

The questions we have are:
1) Is there already a mechanism built-in to avoid this command line limitation (appart from splitting our large library in several smaller libs)? If so a pointer to how to do it would be appreciated.
2) If there is no such mechanism, are there way to add such a mechanism to RTSC as is, or would a change to RTSC be required...


Based on my experience with building large code bases, this is a required feature to support large projects, as splitting in smaller libraries is not always easy/convenient.

Thanks in advance, Laurent.

Re: Issue with building large libraries on Windows [message #492604 is a reply to message #492495] Wed, 21 October 2009 00:04 Go to previous messageGo to next message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
comments below

Laurent Gauthier wrote:
> Hi there,
>
> We are in the process of moving some of our software builds over to
> RTSC, and are running into an issue that we think is related to very
> long command lines on Windows.
>
> We create a library with over 400 C source files in it. The target is a
> C64+ target.
>
[snip]
>
> To work around this problem our previous build system has a work-around
> built-in that consist in passing to the archiver the list of object
> files for the library in a file rather than on the command line.
>
> Another work-around I have seen implemented in another build system was
> a creation of the library archive in several pass (creation of the
> archive with a first set of object files, and addition of more object
> files in several increments) each of the passes having a limited command
> line length.
>
> The questions we have are:
> 1) Is there already a mechanism built-in to avoid this command line
> limitation (apart from splitting our large library in several smaller
> libs)? If so a pointer to how to do it would be appreciated.
> 2) If there is no such mechanism, are there way to add such a mechanism
> to RTSC as is, or would a change to RTSC be required...
>
Since every tool chain has unique options for getting around command
line length limitations, the RTSC build system has to rely on the target
to supply commands that can be executed. For example, the TI archiver
supports a command file approach but the GNU archiver (as far as I know)
does not - it requires the second workaround you describe above.

Since RTSC targets can supply one or more arbitrary commands to perform
the archiving, the problem you are experiencing can be solved in at
least two ways:
1. fix the TI targets to use command files, or
2. create a "target filter" that replaces long lines with command
files

The first option is to fix the ti.targets.ITarget code to always use
command files supported by the TI tool chain. Since ti.targets is
currently bundled with XDCtools, this requires a re-release of XDCtools
from TI and no doubt you don't want to wait for a new release. On the
other hand, this fix should be added to the list of "bugs" to be addressed.

The second option is something that is supported by the RTSC build
engine and allows you to "filter" each command used as part of a build.
In particular, you can write a small filter that changes each archive
command (that would normally be added to the generated makefile) into a
command that uses the -@ option.

Reference docs for target filters are here:
http://rtsc.eclipse.org/cdoc-tip/index.html#xdc/bld/ITargetF ilter.html.

I've created a small example that I believe works with the TI tool chain
and I'll put it in the RTSC SVN repository. The core of the filter is
the following XDCscript file which "implements" the
xdc.bld.ITargetFilter interface:

/*
* ======== archive ========
*/
function archive(container, lib, objList, archArgs, res)
{
/* replace ar command with one that uses the arguments in a file */
res.cmds = mkCommandFile(container, res.cmds);
}

/*
* ======== mkCommandFile ========
*/
function mkCommandFile(archiveName, command)
{
var tokens = command.split(/\s+/);
var cmd = tokens.shift() + " -@" + archiveName + ".cmd";

/* create a command file to hold ar's command line options */
var file = new java.io.BufferedWriter(
new java.io.FileWriter(archiveName + ".cmd"));

/* put archiver options in the file*/
file.write(tokens.shift() + '\n');

/* replace $@ token with actual archive name */
tokens.shift(); /* should be == $@ */
file.write(archiveName + '\n');

/* finally, put all objects to go into the archive */
for (var i = 0; i < tokens.length; i++) {
file.write(tokens[i] + '\n');
}

file.flush();

/* return new ar command to be placed in makefile */
return (cmd);
}
Re: Issue with building large libraries on Windows [message #525641 is a reply to message #492604] Wed, 07 April 2010 09:53 Go to previous messageGo to next message
Patrick Geremia is currently offline Patrick GeremiaFriend
Messages: 79
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------020206000408070007030009
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

-------- Original Message --------
Subject: Re: Issue with building large libraries on Windows
From: dave russo <d-russo@ti.com>
To:
Date: Wed Oct 21 2009 02:04:37 GMT+0200 (CEST)

> comments below
>
> Laurent Gauthier wrote:
>> Hi there,
>>
>> We are in the process of moving some of our software builds over to
>> RTSC, and are running into an issue that we think is related to very
>> long command lines on Windows.
>>
>> We create a library with over 400 C source files in it. The target is
>> a C64+ target.
>>
> [snip]
>>
>> To work around this problem our previous build system has a
>> work-around built-in that consist in passing to the archiver the
>> list of object files for the library in a file rather than on the
>> command line.
>>
>> Another work-around I have seen implemented in another build system
>> was a creation of the library archive in several pass (creation of the
>> archive with a first set of object files, and addition of more object
>> files in several increments) each of the passes having a limited
>> command line length.
>>
>> The questions we have are:
>> 1) Is there already a mechanism built-in to avoid this command line
>> limitation (apart from splitting our large library in several smaller
>> libs)? If so a pointer to how to do it would be appreciated.
>> 2) If there is no such mechanism, are there way to add such a
>> mechanism to RTSC as is, or would a change to RTSC be required...
>>
> Since every tool chain has unique options for getting around command
> line length limitations, the RTSC build system has to rely on the target
> to supply commands that can be executed. For example, the TI archiver
> supports a command file approach but the GNU archiver (as far as I know)
> does not - it requires the second workaround you describe above.
>
> Since RTSC targets can supply one or more arbitrary commands to perform
> the archiving, the problem you are experiencing can be solved in at
> least two ways:
> 1. fix the TI targets to use command files, or
> 2. create a "target filter" that replaces long lines with command
> files
>
> The first option is to fix the ti.targets.ITarget code to always use
> command files supported by the TI tool chain. Since ti.targets is
> currently bundled with XDCtools, this requires a re-release of XDCtools
> from TI and no doubt you don't want to wait for a new release. On the
> other hand, this fix should be added to the list of "bugs" to be addressed.
>
> The second option is something that is supported by the RTSC build
> engine and allows you to "filter" each command used as part of a build.
> In particular, you can write a small filter that changes each archive
> command (that would normally be added to the generated makefile) into a
> command that uses the -@ option.
>
> Reference docs for target filters are here:
> http://rtsc.eclipse.org/cdoc-tip/index.html#xdc/bld/ITargetF ilter.html
>
> I've created a small example that I believe works with the TI tool chain
> and I'll put it in the RTSC SVN repository. The core of the filter is
> the following XDCscript file which "implements" the
> xdc.bld.ITargetFilter interface:
>
> /*
> * ======== archive ========
> */
> function archive(container, lib, objList, archArgs, res)
> {
> /* replace ar command with one that uses the arguments in a file */
> res.cmds = mkCommandFile(container, res.cmds);
> }
>
> /*
> * ======== mkCommandFile ========
> */
> function mkCommandFile(archiveName, command)
> {
> var tokens = command.split(/\s+/);
> var cmd = tokens.shift() + " -@" + archiveName + ".cmd";
>
> /* create a command file to hold ar's command line options */
> var file = new java.io.BufferedWriter(
> new java.io.FileWriter(archiveName + ".cmd"));
>
> /* put archiver options in the file*/
> file.write(tokens.shift() + '\n');
>
> /* replace $@ token with actual archive name */
> tokens.shift(); /* should be == $@ */
> file.write(archiveName + '\n');
>
> /* finally, put all objects to go into the archive */
> for (var i = 0; i < tokens.length; i++) {
> file.write(tokens[i] + '\n');
> }
>
> file.flush();
>
> /* return new ar command to be placed in makefile */
> return (cmd);
> }
>
>
Dave,

could you be a little bit more specific on how to implement 2) in
practice? I have hard-time understanding how to fit archive function
above in my config.bld (see attachment).

--
Patrick Geremia
Texas Instruments (http://www.ti.com)
Phone: +33 4 93 22 26 33
Email: p-geremia@ti.com
Availability: http://meetwith.me/patrickgeremia

--------------020206000408070007030009
Content-Type: text/plain;
name="config.bld"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="config.bld"

dm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k
IEdOVV9DR1RfRElSIG5vdCBzZXQgLi4uIik7CglwcmludCgiU2tpcHBpbmcg R05VIHRhcmdl
dHMgLi4uIik7Cn0KCg==
--------------020206000408070007030009--
Re: Issue with building large libraries on Windows [message #525732 is a reply to message #525641] Wed, 07 April 2010 15:32 Go to previous messageGo to next message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010608060505010600090503
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Target filters must be modules that implement the ITargetFilter
interface. The functions shown below (archive and mkCommandFile) must
be in the .xs file of the module that implements ITargetFilter.

See the attached example package basic.filter.

On 4/7/2010 2:53 AM, Patrick Geremia wrote:
> -------- Original Message --------
> Subject: Re: Issue with building large libraries on Windows
> From: dave russo <d-russo@ti.com>
> To:
> Date: Wed Oct 21 2009 02:04:37 GMT+0200 (CEST)
>
>> comments below
>>
>> Laurent Gauthier wrote:
>>> Hi there,
>>>
>>> We are in the process of moving some of our software builds over to
>>> RTSC, and are running into an issue that we think is related to very
>>> long command lines on Windows.
>>>
>>> We create a library with over 400 C source files in it. The target is
>>> a C64+ target.
>>>
>> [snip]
>>>
>>> To work around this problem our previous build system has a
>>> work-around built-in that consist in passing to the archiver the list
>>> of object files for the library in a file rather than on the command
>>> line.
>>>
>>> Another work-around I have seen implemented in another build system
>>> was a creation of the library archive in several pass (creation of
>>> the archive with a first set of object files, and addition of more
>>> object files in several increments) each of the passes having a
>>> limited command line length.
>>>
>>> The questions we have are:
>>> 1) Is there already a mechanism built-in to avoid this command line
>>> limitation (apart from splitting our large library in several smaller
>>> libs)? If so a pointer to how to do it would be appreciated.
>>> 2) If there is no such mechanism, are there way to add such a
>>> mechanism to RTSC as is, or would a change to RTSC be required...
>>>
>> Since every tool chain has unique options for getting around command
>> line length limitations, the RTSC build system has to rely on the
>> target to supply commands that can be executed. For example, the TI
>> archiver supports a command file approach but the GNU archiver (as far
>> as I know) does not - it requires the second workaround you describe
>> above.
>>
>> Since RTSC targets can supply one or more arbitrary commands to
>> perform the archiving, the problem you are experiencing can be solved
>> in at least two ways:
>> 1. fix the TI targets to use command files, or
>> 2. create a "target filter" that replaces long lines with command
>> files
>>
>> The first option is to fix the ti.targets.ITarget code to always use
>> command files supported by the TI tool chain. Since ti.targets is
>> currently bundled with XDCtools, this requires a re-release of
>> XDCtools from TI and no doubt you don't want to wait for a new
>> release. On the other hand, this fix should be added to the list of
>> "bugs" to be addressed.
>>
>> The second option is something that is supported by the RTSC build
>> engine and allows you to "filter" each command used as part of a
>> build. In particular, you can write a small filter that changes each
>> archive command (that would normally be added to the generated
>> makefile) into a command that uses the -@ option.
>>
>> Reference docs for target filters are here:
>> http://rtsc.eclipse.org/cdoc-tip/index.html#xdc/bld/ITargetF ilter.html
>>
>> I've created a small example that I believe works with the TI tool
>> chain and I'll put it in the RTSC SVN repository. The core of the
>> filter is the following XDCscript file which "implements" the
>> xdc.bld.ITargetFilter interface:
>>
>> /*
>> * ======== archive ========
>> */
>> function archive(container, lib, objList, archArgs, res)
>> {
>> /* replace ar command with one that uses the arguments in a file */
>> res.cmds = mkCommandFile(container, res.cmds);
>> }
>>
>> /*
>> * ======== mkCommandFile ========
>> */
>> function mkCommandFile(archiveName, command)
>> {
>> var tokens = command.split(/\s+/);
>> var cmd = tokens.shift() + " -@" + archiveName + ".cmd";
>>
>> /* create a command file to hold ar's command line options */
>> var file = new java.io.BufferedWriter(
>> new java.io.FileWriter(archiveName + ".cmd"));
>>
>> /* put archiver options in the file*/
>> file.write(tokens.shift() + '\n');
>>
>> /* replace $@ token with actual archive name */
>> tokens.shift(); /* should be == $@ */
>> file.write(archiveName + '\n');
>>
>> /* finally, put all objects to go into the archive */
>> for (var i = 0; i < tokens.length; i++) {
>> file.write(tokens[i] + '\n');
>> }
>>
>> file.flush();
>>
>> /* return new ar command to be placed in makefile */
>> return (cmd);
>> }
>>
>>
> Dave,
>
> could you be a little bit more specific on how to implement 2) in
> practice? I have hard-time understanding how to fit archive function
> above in my config.bld (see attachment).
>

--------------010608060505010600090503
Content-Type: application/gzip;
name="filter.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="filter.tar.gz"

H4sIANqkvEsAA+09a1fjOLL9lfwKTZqzOBCcd7IHtvcODXQPZ5qGA/Td2UMY 2kmUxI1jZ22H
x8zy329VSXLkR4CeTad397rOTCexpZJUqpdKJdGzArtfGdpOyP3Kq28DVYBO q/WqWqu16+0q
/a41m/Qp4VWt1mh1avV6vVaDcvVms/6Ktb5Rf2IwC0LLZ+zVwH+6XDDl/dD3 3FX0aYXQ0+f/
sD/2zPtBf8lt4AQ3cb4XzH+zg/Nf79TatU61Ae9rzWod5r+65H5kwv/z+a9s /lBgm4y9kcAU
D0RP6PUeAyqNeMgEp7BwbIUssCdT54FNfdsNA2axCQ8Ca8ShQqUw4aHlufB2 4g1mDie0zHbH
3LehLOA3e87APLogrO8IaeH3gu3CbLh9vlNgANQ3BL1/shGte7LEqc+H9j3z hoxb/XFUbmAH
U8d64ANZsEKffc8d2iN2HkLfR3OcrLgBKP+6UdzNKOVaEyoCLx8L33velgUZ 8h8su41n5L/e
ajZQ/zearXa72sZyjU6tkcv/KqCyGRd/y++P7VtdvEBihjO3H9qeq94aIBih ZbvcLzPH7pWZ
1/vywQ7CMhXY80dBmfk8KIFEoxiRgjCKCrVUIaZpFku7egEpcgLzDiuyrfnP dElomCSaiZLw
00QJTReE9ngwLyj7CuWkkmHWdMrdASiwqReE21Pf64M+QIkPQj5VGgPGY/Yn g4BtgQrouuvG
8fn7EiEMx3ZgKhUif2JPhMIB2IJiavDJJnoPcxzrQlea61gblUwhOTt9bzKF 0SyYHflWnx2h
tcts5FkOaFlepkKLZkihX9IMSZOhCC9+Lpgk7KA2m6q/6YKBN/P7XBTUKKyG ZQZ+X1oC7SFo
OZ4odD4bQiGNC6Y+31Z8gF8TbBB6wq4oGiXZArjia3ki0cz6XxZzAzzc6Lob 8KEazOQPx3Zv
F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HehG OpCMC7jjPCR3
qIP87GMOOeSQQw455JBDDjnkkEMOOeSQQw455JBDDjnkkEMOOeSQQw455JBD DjnkkEMOOeSw
Mvg/qrFy/gCgAAA=
--------------010608060505010600090503--
Re: Issue with building large libraries on Windows [message #526005 is a reply to message #525732] Thu, 08 April 2010 14:10 Go to previous messageGo to next message
Patrick Geremia is currently offline Patrick GeremiaFriend
Messages: 79
Registered: July 2009
Member
-------- Original Message --------
Subject: Re: Issue with building large libraries on Windows
From: dave russo <d-russo@ti.com>
To:
Date: Wed Apr 07 2010 17:32:28 GMT+0200 (CEST)
> Target filters must be modules that implement the ITargetFilter
> interface. The functions shown below (archive and mkCommandFile) must
> be in the .xs file of the module that implements ITargetFilter.
>
> See the attached example package basic.filter.
>
> On 4/7/2010 2:53 AM, Patrick Geremia wrote:
>> -------- Original Message --------
>> Subject: Re: Issue with building large libraries on Windows
>> From: dave russo <d-russo@ti.com>
>> To:
>> Date: Wed Oct 21 2009 02:04:37 GMT+0200 (CEST)
>>
>>> comments below
>>>
>>> Laurent Gauthier wrote:
>>>> Hi there,
>>>>
>>>> We are in the process of moving some of our software builds over to
>>>> RTSC, and are running into an issue that we think is related to very
>>>> long command lines on Windows.
>>>>
>>>> We create a library with over 400 C source files in it. The target is
>>>> a C64+ target.
>>>>
>>> [snip]
>>>>
>>>> To work around this problem our previous build system has a
>>>> work-around built-in that consist in passing to the archiver the list
>>>> of object files for the library in a file rather than on the command
>>>> line.
>>>>
>>>> Another work-around I have seen implemented in another build system
>>>> was a creation of the library archive in several pass (creation of
>>>> the archive with a first set of object files, and addition of more
>>>> object files in several increments) each of the passes having a
>>>> limited command line length.
>>>>
>>>> The questions we have are:
>>>> 1) Is there already a mechanism built-in to avoid this command line
>>>> limitation (apart from splitting our large library in several smaller
>>>> libs)? If so a pointer to how to do it would be appreciated.
>>>> 2) If there is no such mechanism, are there way to add such a
>>>> mechanism to RTSC as is, or would a change to RTSC be required...
>>>>
>>> Since every tool chain has unique options for getting around command
>>> line length limitations, the RTSC build system has to rely on the
>>> target to supply commands that can be executed. For example, the TI
>>> archiver supports a command file approach but the GNU archiver (as far
>>> as I know) does not - it requires the second workaround you describe
>>> above.
>>>
>>> Since RTSC targets can supply one or more arbitrary commands to
>>> perform the archiving, the problem you are experiencing can be solved
>>> in at least two ways:
>>> 1. fix the TI targets to use command files, or
>>> 2. create a "target filter" that replaces long lines with command
>>> files
>>>
>>> The first option is to fix the ti.targets.ITarget code to always use
>>> command files supported by the TI tool chain. Since ti.targets is
>>> currently bundled with XDCtools, this requires a re-release of
>>> XDCtools from TI and no doubt you don't want to wait for a new
>>> release. On the other hand, this fix should be added to the list of
>>> "bugs" to be addressed.
>>>
>>> The second option is something that is supported by the RTSC build
>>> engine and allows you to "filter" each command used as part of a
>>> build. In particular, you can write a small filter that changes each
>>> archive command (that would normally be added to the generated
>>> makefile) into a command that uses the -@ option.
>>>
>>> Reference docs for target filters are here:
>>> http://rtsc.eclipse.org/cdoc-tip/index.html#xdc/bld/ITargetF ilter.html
>>>
>>> I've created a small example that I believe works with the TI tool
>>> chain and I'll put it in the RTSC SVN repository. The core of the
>>> filter is the following XDCscript file which "implements" the
>>> xdc.bld.ITargetFilter interface:
>>>
>>> /*
>>> * ======== archive ========
>>> */
>>> function archive(container, lib, objList, archArgs, res)
>>> {
>>> /* replace ar command with one that uses the arguments in a file */
>>> res.cmds = mkCommandFile(container, res.cmds);
>>> }
>>>
>>> /*
>>> * ======== mkCommandFile ========
>>> */
>>> function mkCommandFile(archiveName, command)
>>> {
>>> var tokens = command.split(/\s+/);
>>> var cmd = tokens.shift() + " -@" + archiveName + ".cmd";
>>>
>>> /* create a command file to hold ar's command line options */
>>> var file = new java.io.BufferedWriter(
>>> new java.io.FileWriter(archiveName + ".cmd"));
>>>
>>> /* put archiver options in the file*/
>>> file.write(tokens.shift() + '\n');
>>>
>>> /* replace $@ token with actual archive name */
>>> tokens.shift(); /* should be == $@ */
>>> file.write(archiveName + '\n');
>>>
>>> /* finally, put all objects to go into the archive */
>>> for (var i = 0; i < tokens.length; i++) {
>>> file.write(tokens[i] + '\n');
>>> }
>>>
>>> file.flush();
>>>
>>> /* return new ar command to be placed in makefile */
>>> return (cmd);
>>> }
>>>
>>>
>> Dave,
>>
>> could you be a little bit more specific on how to implement 2) in
>> practice? I have hard-time understanding how to fit archive function
>> above in my config.bld (see attachment).
>>
Dave,

it worked like a charm! Thanks.
Do you happen to have readily available the filter for gcc i.e. suppling
and MRI script to ar (ar -M <mri_script>)?

--
Patrick Geremia
Texas Instruments (http://www.ti.com)
Phone: +33 4 93 22 26 33
Email: p-geremia@ti.com
Availability: http://meetwith.me/patrickgeremia
Re: Issue with building large libraries on Windows [message #526037 is a reply to message #526005] Thu, 08 April 2010 14:48 Go to previous messageGo to next message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
On 4/8/2010 7:10 AM, Patrick Geremia wrote:
>
> it worked like a charm! Thanks.
> Do you happen to have readily available the filter for gcc i.e. suppling
> and MRI script to ar (ar -M <mri_script>)?
>
I'm not familiar with MRI scripts but did find this post
http://old.nabble.com/Re%3A-Creating-a-static-lib-from-objec ts-and-another-static-lib-p16131684.html

It should be easy to create such a script but it might be better to
simply break the ar command into multiple commands; e.g.,
ar -ca lib.a foo1.o
ar -a lib.a foo2.o
:

This approach works with all the archivers I'm familiar with (ti, posix,
microsoft).
Re: Issue with building large libraries on Windows [message #526038 is a reply to message #526037] Thu, 08 April 2010 14:52 Go to previous messageGo to next message
Patrick Geremia is currently offline Patrick GeremiaFriend
Messages: 79
Registered: July 2009
Member
-------- Original Message --------
Subject: Re: Issue with building large libraries on Windows
From: dave russo <d-russo@ti.com>
To:
Date: Thu Apr 08 2010 16:48:37 GMT+0200 (CEST)
>
>
> On 4/8/2010 7:10 AM, Patrick Geremia wrote:
>>
>> it worked like a charm! Thanks.
>> Do you happen to have readily available the filter for gcc i.e. suppling
>> and MRI script to ar (ar -M <mri_script>)?
>>
> I'm not familiar with MRI scripts but did find this post
> http://old.nabble.com/Re%3A-Creating-a-static-lib-from-objec ts-and-another-static-lib-p16131684.html
>
>
> It should be easy to create such a script but it might be better to
> simply break the ar command into multiple commands; e.g.,
> ar -ca lib.a foo1.o
> ar -a lib.a foo2.o
> :
>
> This approach works with all the archivers I'm familiar with (ti,
> posix, microsoft).
Dave,

why don't you make it default or at least configurable in in RTSC?

--
Patrick Geremia
Texas Instruments (http://www.ti.com)
Phone: +33 4 93 22 26 33
Email: p-geremia@ti.com
Availability: http://meetwith.me/patrickgeremia
Re: Issue with building large libraries on Windows [message #526083 is a reply to message #526038] Thu, 08 April 2010 15:52 Go to previous message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
On 4/8/2010 7:52 AM, Patrick Geremia wrote:
[snip]
>>
>> This approach works with all the archivers I'm familiar with (ti,
>> posix, microsoft).
> Dave,
>
> why don't you make it default or at least configurable in in RTSC?
>
The RTSC build engine simply takes commands from provided by the target
and adds them to the makefile; there is no common method for creating an
archive or adding elements to the archive. So it's the target's
responsibility to not generate command lines too long for the host OS.

The problems you are experiencing are essentially "bugs" in the targets.
They should limit the length of the commands passed to the RTSC build
engine using what every technique is appropriate for the particular tool
chain.

Of course, we've been getting away with this because, over time,
Microsoft has dramatically increased the maximum command line length
from 128 bytes to many K bytes.

Patches to the targets are welcome.
Previous Topic:disabling dependencies generation
Next Topic:use of requires statement
Goto Forum:
  


Current Time: Tue Oct 08 15:11:58 GMT 2024

Powered by FUDForum. Page generated in 0.09213 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top