[Scons-users] =?GB2312?Q?Re=3A_=5BScons=2Dusers=5D_Re=3A_=5BScons=2Dusers=5D_is_there_any_way?= =?GB2312?Q?_that_I_can_get_the_final_command_line_from_scons=A3=BF?=

prife goprife at gmail.com
Sun Nov 18 12:52:46 EST 2012


hi Oberbrunner

windows7 32bit
scons 2.2.0

I guest I should add the following code in my SConsruct

if rtconfig.PLATFORM == 'armcc':
env["TEMPFILE"] = SCons.Platform.TempFileMunge
env["LINKCOM"] = "$LINK -o $TARGET $LINKFLAGS --via
${TEMPFILE('$SOURCES')}"
env["TEMPFILEPREFIX"] = ' ' # arm tool chain


Then I recompile with scons -j4 in CMD

armlink -o rtthread-stm32.axf --device DARMSTM --info sizes --info totals
--info
unused --info veneers --list rtthread-stm32.map --scatter stm32_rom.sct
--libpa
th D:/Keil/ARM/RV31/LIB --keep __fsym_* --keep __vsym_* --via
build\application.
o @c:\users\admini~1\appdata\local\temp\tmp5r9pd_.lnk
Using tempfile c:\users\admini~1\appdata\local\temp\tmpojzbmz.lnk for
command li
ne:
build\application.o build\startup.o build\board.o build\stm32f10x_it.o
build\rtc
.o build\usart.o build\serial.o build\led.o build\enc28j60.o
build\dm9000a.o bui
ld\touch.o build\calibration.o build\ssd1289.o build\src\clock.o
build\src\device
......

seems there two places are wrong.
the command line should be
1. there should not be an @ at the head of the tempfile's path,
while env["TEMPFILEPREFIX"] = ' ' doesn't help.
2. there is an ‘build\application.o’ behind “--via” in the command line,
but it is already in the tempfile, and should not be there

the Right command should be:
armlink -o rtthread-stm32.axf $LINKFLAGS --via
c:\users\admini~1\appdata\local\temp\tmp5r9pd_.lnk

Any suggestions?

Best Regards
prife


2012/11/19 Gary Oberbrunner <garyo at oberbrunner.com>


> Try using $TEMPFILE. MSVC uses it for this purpose. Start by wrapping

> the LINKCOM with TEMPFILE like ${TEMPFILE('$LINK ...')} and then maybe set

> $TEMPFILE to TempFileMunge, and check Platform/__init__.py for how

> TempFileMunge works; you'll need to make it use the --via or whatever your

> linker needs. If you come up with something useful, at least post it on

> the wiki, or make an add-on tool that people can use (e.g. by putting it in

> site_scons/tools).

>

>

> On Sun, Nov 18, 2012 at 9:09 AM, prife <goprife at gmail.com> wrote:

>

>> HI, all

>>

>> I use scons to build sources, and the C compiler is the armcc (which is

>> from MDK).

>> In most cases, scons works very well, but if when there are too many

>> objects in the final command line, then I will get an error.

>> like this:

>>

>> armlink -o rtthread-stm32.axf --device DARMSTM --info sizes --info totals

>> --info unused --info veneers --list rtthread-stm32.map --scatter

>> stm32_rom.sct --libpath D:/Keil/ARM/RV31/LIB --keep __fsym_* --keep

>> __vsym_* build\application.o build\startup.o build\board.o

>> build\stm32f10x_it.o build\rtc.o ........................(many objs)

>>

>> The Command line is too long.

>> scons: *** [rtthread-stm32.axf] Error 1

>>

>> because the armcc has a limited command line length. It provides an

>> option

>> --via=file

>> ARM Compiler toolchain v4.1 for µVision Linker Reference Home > Linker

>> command-line options > --via=file

>> --via=*file*

>>

>> This option reads an additional list of input filenames and linker

>> options from *file*.

>>

>> so, I want to get the final command line, the write some to an temp

>> files, and use this --via option, then I can solve this issue. In fact I

>> can get the link and link flags with:

>>

>> env['LINK']

>>

>> env['LINKFLAGS']

>>

>> like this:

>>

>> armlink -o rtthread-stm32.axf --device DARMSTM --info sizes --info totals

>> --info unused --info veneers --list rtthread-stm32.map --scatter

>> stm32_rom.sct --libpath D:/Keil/ARM/RV31/LIB --keep __fsym_* --keep

>> __vsym_* --via ojb_files

>>

>> so what I really need is the string include all the objects. Any

>> questions?

>>

>> Best Regards

>>

>> prife

>>

>> --

>> 把有限的时间投入到无限的学习中去

>>

>> _______________________________________________

>> Scons-users mailing list

>> Scons-users at scons.org

>> http://four.pairlist.net/mailman/listinfo/scons-users

>>

>>

>

>

> --

> Gary

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>



--
把有限的时间投入到无限的学习中去
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20121119/40b1fd8e/attachment.htm>


More information about the Scons-users mailing list