@@ -112,19 +112,27 @@ include builders/$(build_os).mk
112
112
include builders/default.mk
113
113
include packages/packages.mk
114
114
115
+ full_env =$(shell printenv)
116
+
115
117
build_id_string: =$(BUILD_ID_SALT )
116
- build_id_string+ =$(shell $(build_CC ) --version 2>/dev/null)
117
- build_id_string+ =$(shell $(build_AR ) --version 2>/dev/null)
118
- build_id_string+ =$(shell $(build_CXX ) --version 2>/dev/null)
119
- build_id_string+ =$(shell $(build_RANLIB ) --version 2>/dev/null)
120
- build_id_string+ =$(shell $(build_STRIP ) --version 2>/dev/null)
118
+
119
+ # GCC only prints COLLECT_LTO_WRAPPER when invoked with just "-v", but we want
120
+ # the information from "-v -E -" as well, so just include both.
121
+ #
122
+ # '3>&1 1>&2 2>&3 > /dev/null' is supposed to swap stdin and stdout and silence
123
+ # stdin, since we only want the stderr output
124
+ build_id_string+ =$(shell $(build_CC ) -v < /dev/null 3>&1 1>&2 2>&3 > /dev/null) $(shell $(build_CC ) -v -E - < /dev/null 3>&1 1>&2 2>&3 > /dev/null)
125
+ build_id_string+ =$(shell $(build_AR ) --version 2>/dev/null) $(filter AR_% ,$(full_env ) ) ZERO_AR_DATE=$(ZERO_AR_DATE )
126
+ build_id_string+ =$(shell $(build_CXX ) -v < /dev/null 3>&1 1>&2 2>&3 > /dev/null) $(shell $(build_CXX ) -v -E - < /dev/null 3>&1 1>&2 2>&3 > /dev/null)
127
+ build_id_string+ =$(shell $(build_RANLIB ) --version 2>/dev/null) $(filter RANLIB_% ,$(full_env ) )
128
+ build_id_string+ =$(shell $(build_STRIP ) --version 2>/dev/null) $(filter STRIP_% ,$(full_env ) )
121
129
122
130
$(host_arch)_$(host_os)_id_string: =$(HOST_ID_SALT )
123
- $(host_arch)_$(host_os)_id_string+ =$(shell $(host_CC ) --version 2> /dev/null)
124
- $(host_arch)_$(host_os)_id_string+ =$(shell $(host_AR ) --version 2>/dev/null)
125
- $(host_arch)_$(host_os)_id_string+ =$(shell $(host_CXX ) --version 2> /dev/null)
126
- $(host_arch)_$(host_os)_id_string+ =$(shell $(host_RANLIB ) --version 2>/dev/null)
127
- $(host_arch)_$(host_os)_id_string+ =$(shell $(host_STRIP ) --version 2>/dev/null)
131
+ $(host_arch)_$(host_os)_id_string+ =$(shell $(host_CC ) -v < /dev/null 3>&1 1>&2 2>&3 > /dev/null) $( shell $( host_CC ) -v -E - < /dev/null 3>&1 1>&2 2>&3 > /dev/null)
132
+ $(host_arch)_$(host_os)_id_string+ =$(shell $(host_AR ) --version 2>/dev/null) $( filter AR_ % , $( full_env ) ) ZERO_AR_DATE= $( ZERO_AR_DATE )
133
+ $(host_arch)_$(host_os)_id_string+ =$(shell $(host_CXX ) -v < /dev/null 3>&1 1>&2 2>&3 > /dev/null) $( shell $( host_CXX ) -v -E - < /dev/null 3>&1 1>&2 2>&3 > /dev/null)
134
+ $(host_arch)_$(host_os)_id_string+ =$(shell $(host_RANLIB ) --version 2>/dev/null) $( filter RANLIB_ % , $( full_env ) )
135
+ $(host_arch)_$(host_os)_id_string+ =$(shell $(host_STRIP ) --version 2>/dev/null) $( filter STRIP_ % , $( full_env ) )
128
136
129
137
ifneq ($(strip $(FORCE_USE_SYSTEM_CLANG ) ) ,)
130
138
# Make sure that cache is invalidated when switching between system and
0 commit comments