[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] argument length limt for scripts?

From: Stevie G. Messervey
Subject: Re: [Tinycc-devel] argument length limt for scripts?
Date: Thu, 13 Jun 2013 07:22:23 -0700 (PDT)

From: Thomas Preud'homme <address@hidden>
To: address@hidden
Cc: Stephan Beal <address@hidden>; Stevie G. Messervey <address@hidden>
Sent: Wednesday, June 12, 2013 4:46 AM
Subject: Re: [Tinycc-devel] argument length limt for scripts?

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 kernel though:

/* sizeof(linux_binprm->buf) */
#define BINPRM_BUF_SIZE 128

Cf include/uapi/linux/binfmts.h for this definition and fs/binfmt_script.c for
its usage.

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.

Best regards,


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.

Thank you,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]