[Scons-users] Command line is too long Error in windows 64bit machine

Gouru, SrinivasReddy CCS Srinivas.Gouru at fs.utc.com
Thu Feb 6 10:59:04 EST 2014


Hi

I am using Scons with Renesas Compiler in windows platform ( 32 and 64 bit). I have too many libraries to link in liker stage. While linking I got an error like “ Command Line is too long”.
After some investigation I found the solution which is given below. I have applied this on 32 bit windows system and it is working fine.


if env['PLATFORM'] == 'win32':
import win32file
import win32event
import win32process
import win32security

def my_spawn(sh, escape, cmd, args, spawnenv):
for var in spawnenv:
spawnenv[var] = spawnenv[var].encode('ascii', 'replace')

sAttrs = win32security.SECURITY_ATTRIBUTES()
StartupInfo = win32process.STARTUPINFO()
newargs = ' '.join(map(escape, args[1:]))
cmdline = cmd + " " + newargs

# check for any special operating system commands
if cmd == 'del':
for arg in args[1:]:
win32file.DeleteFile(arg)
exit_code = 0
else:
# otherwise execute the command.
hProcess, hThread, dwPid, dwTid = win32process.CreateProcess(None, cmdline, None, None, 1, 0, spawnenv, None, StartupInfo)
win32event.WaitForSingleObject(hProcess, win32event.INFINITE)
exit_code = win32process.GetExitCodeProcess(hProcess)
win32file.CloseHandle(hProcess);
win32file.CloseHandle(hThread);
return exit_code

env['SPAWN'] = my_spawn

But while compiling on windows 64 bit machine I got some errors.
Error is:

= Linking start.abs
scons: *** [start.abs] error : (87, 'CreateProcess', 'The parameter is incorrect.')
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Taskmaster.py", line 246, in execute
self.targets[0].build()
File "C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Node\__init__.py", line 373, in build
self.get_executor()(self, **kw)
File "C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Executor.py", line 358, in __call__
return self.do_execute(target, kw)
File "C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Executor.py", line 340, in do_execute
status = act(*args, **kw)
File "C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Action.py", line 974, in __call__
return c.__call__(self, target, source, env, *args, **kw)
File "C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Action.py", line 584, in __call__
stat = self.execute(target, source, env, executor=executor)
File "C:\Python27\Lib\site-packages\scons-2.3.0\SCons\Action.py", line 806, in execute
result = spawn(shell, escape, cmd_line[0], cmd_line, ENV)
File "D:\root\build\rtu\tt2\main\ecs2_131078\ccrx\SConstruct", line 82, in my_spawn
hProcess, hThread, dwPid, dwTid = win32process.CreateProcess(None, cmdline, None, None, 1, 0, spawnenv, None, StartupInfo)
error: (87, 'CreateProcess', 'The parameter is incorrect.')

I thought like, above solution is not compatible with windows 64 bit. Can you please provide me the solution which will work on windows 32 as well as 64 bit machine.

Thanks,
Srinivas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140206/b2146e03/attachment.html


More information about the Scons-users mailing list