[Buildroot] [PATCH] gcc: don't patch gcc if there are no patches to apply

Mischa Jonker Mischa.Jonker at synopsys.com
Mon Nov 11 14:36:36 UTC 2013

While the generic package handler checks for a directory with patches
before starting apply-patches.sh, this is not the case for gcc: the
script is called, even if there is no directory with patches. This results
into a build failure, as apply-patches exits with error code 1 if the
directory doesn't exist.

Signed-off-by: Mischa Jonker <mjonker at synopsys.com>
 package/gcc/gcc.mk |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 0c0cc99..41600ef 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -49,7 +49,9 @@ endif
-	support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) \*.patch
+	if test -d package/gcc/$(GCC_VERSION); then \
+	  support/scripts/apply-patches.sh $(@D) package/gcc/$(GCC_VERSION) \*.patch ; \
+	fi;

More information about the buildroot mailing list