This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: stringification of PREFIX etc...
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Basile Starynkevitch <basile at starynkevitch dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 27 Sep 2011 21:56:12 +0000 (UTC)
- Subject: Re: stringification of PREFIX etc...
- References: <20110926090753.GA28442@ours.starynkevitch.net>
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