gcc: sort the patches before they are hashed
authorArnout Vandecappelle <arnout@mind.be>
Sun, 4 Oct 2015 17:26:03 +0000 (18:26 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 4 Oct 2015 18:21:15 +0000 (20:21 +0200)
$(wildcard ...) in make doesn't sort the files, so the order of the
hashed files is not predictable. Therefore, the ccache hash could
change from one build to another. We don't want that, so sort the
files explicitly.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/gcc/gcc.mk

index 9025cdf6f9e7c43a0c7f7bd5fae306898670a612..4def65c94606783f1c9e22eed4473a44cfddc38c 100644 (file)
@@ -243,10 +243,10 @@ HOST_GCC_COMMON_CCACHE_HASH_FILES += $(DL_DIR)/$(GCC_SOURCE)
 # Cfr. PATCH_BASE_DIRS in .stamp_patched, but we catch both versioned and
 # unversioned patches unconditionally
 HOST_GCC_COMMON_CCACHE_HASH_FILES += \
-       $(wildcard \
+       $(sort $(wildcard \
                package/gcc/$(GCC_VERSION)/*.patch \
                $(addsuffix $((PKG)_RAWNAME)/$(GCC_VERSION)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))) \
-               $(addsuffix $((PKG)_RAWNAME)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR))))
+               $(addsuffix $((PKG)_RAWNAME)/*.patch,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)))))
 ifeq ($(BR2_xtensa),y)
 HOST_GCC_COMMON_CCACHE_HASH_FILES += $(HOST_GCC_XTENSA_OVERLAY_TAR)
 endif