path: root/Makefile
diff options
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2018-08-20 22:49:53 +0200
committerGravatar Peter Korsgaard <peter@korsgaard.com>2018-10-24 14:29:53 +0200
commit2fcf3e129512fa1efba405b28750f40e5d03ed81 (patch)
tree5efd6480c13fb9445d4ee9f4b1806777640160b1 /Makefile
parent7b02eb66cd00cad901b43b0030341d5a76bd40b7 (diff)
core: detect and reject build paths which contain an '@'
gcc does not build when the srcdir path contains a '@', because that path is then substitued in a texi file as argument to an @include directive. But then, the '@' in the path will start a command evaluation of its own, thus breaking the build. For example, with a $(O) path set to /home/ymorin/dev/buildroot/O/to@ti : perl ../../gcc/../contrib/texi2pod.pl ../../gcc/doc/invoke.texi > gcc.pod ../../gcc/doc/invoke.texi:1678: unknown command `ti' ../../gcc/doc/invoke.texi:1678: @include: could not find /home/ymorin/dev/buildroot/O/to/build/host-gcc-initial-7.3.0/build/gcc/../../gcc/../libiberty/at-file.texi [Peter: use findstring instead of subst/compare] Reported-by: c32 on IRC Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com> (cherry picked from commit 7007dc2bc99ad191c418c468707cdc3980273cda) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'Makefile')
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 36614a8c35..83f64f491d 100644
--- a/Makefile
+++ b/Makefile
@@ -60,6 +60,11 @@ override O := $(patsubst %/,%,$(patsubst %.,%,$(O)))
# avoid empty CANONICAL_O in case on non-existing entry.
CANONICAL_O := $(shell mkdir -p $(O) >/dev/null 2>&1)$(realpath $(O))
+# gcc fails to build when the srcdir contains a '@'
+ifneq ($(findstring @,$(CANONICAL_O)),)
+$(error The build directory can not contain a '@')
REQ_UMASK = 0022