Le mardi 11 juin 2013 21:12:15, Stephan Beal a écrit :
> On Tue, Jun 11, 2013 at 8:41 PM, Stevie G. Messervey
> > #!/usr/local/bin/tcc -run -Iinclude -Llib -lccgi -luuid -lgmp -lcrypt
> > -lsqlite3 -lmagic -lgd -lcurl -lquickmail -lgif -lfoo -lbar
> > Take note the space between -lfoo and -lbar; if there is only a single
> > space between
> > -lfoo and -lbar, tcc complains it cannot find -lb.
> You're hitting a limit of the shell. You can work around it by using a
> shorter path to tcc, but that's of very limited use.
Not a shell limit. The shell is not involved here. The kernel reads the elf
interpreter, sees the shebang and call the interpreter specified in the shebang
directly. There is a limit in the
/* sizeof(linux_binprm->buf) */
#define BINPRM_BUF_SIZE 128
Cf include/uapi/linux/binfmts.h for this definition and fs/binfmt_script.c for
With the space the truncation is done just after the hyphen in -lbar. Hence
tcc is waiting for input on STDIN. Without extra space it truncates after the
'b' in -lbar, hence the error that it cannot find -lb.
It looks like I am in for a kernel recompile.
I use tcc as a CGI script interpreter, and as my web apps grow in complexity,
the shebang line will also grow.