This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stringification of PREFIX etc...


On Mon, 26 Sep 2011, Basile Starynkevitch wrote:

> Hello All,
> 
> It seems to me (file gcc/Makefile.in, definition of DRIVER_DEFINES) that 
> the configure-d PREFIX is wired inside gcc.o (hence inside the gcc 
> driver executable) without precautions.
> 
> In particular, I don't understand if someone can configure gcc with a 
> prefix containing weird characters, such as double-quotes " or 
> backslashes \ or perhaps even spaces.
> 
> My intuition is that GCC won't even build if the prefix contains such 
> naughty characters. If it is the case, should we document that.?

In general it's hard to support this in full generality because of 
difficulty escaping things for "make" (and you have "make" - multiple 
levels thereof - the shell and C escaping to consider at least).  If the 
paths to the source and build directories contain special characters it's 
particularly problematic (configure scripts get involved as well; some 
past autoconf versions had their own problems in this regard, although 
this may have been fixed).

You may be able to get spaces working, but the other characters are likely 
harder.  There is or was a proposal going through the Austin Group (POSIX) 
to disallow newlines in filenames (the hardest case of all to handle in 
shell scripts using standard POSIX utilities), but I haven't followed the 
exact status of that proposal.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]