2008-07-18 12:15:21 +02:00
|
|
|
#! /bin/bash
|
|
|
|
|
2021-03-11 20:22:33 +01:00
|
|
|
# This is a list of toolchain-dependent configs. That is: only those which
|
|
|
|
# change .config when gcc, ld, or similar changes.
|
|
|
|
#
|
|
|
|
# please keep them sorted alphabetically
|
2021-03-10 09:06:35 +01:00
|
|
|
declare -a IGNORED_CONFIGS_RE=(
|
2022-10-19 10:17:50 +02:00
|
|
|
'AS_HAS_[A-Z0-9_]*'
|
2021-04-14 09:27:17 +02:00
|
|
|
'AS_VERSION'
|
2021-03-11 20:22:33 +01:00
|
|
|
'CC_CAN_[A-Z_]*'
|
|
|
|
'CC_HAS_[A-Z_]*'
|
|
|
|
'CC_HAVE_[A-Z_]*'
|
|
|
|
'CC_VERSION_TEXT'
|
2023-01-09 12:38:41 +01:00
|
|
|
'FTRACE_MCOUNT_USE_[A-Z_]*'
|
2021-03-11 20:22:33 +01:00
|
|
|
'GCC_VERSION'
|
2022-06-23 08:25:06 +02:00
|
|
|
'G*CC[0-9]*_NO_[A-Z_]*'
|
2021-03-11 20:22:33 +01:00
|
|
|
'HAVE_[A-Z]*_COMPILER'
|
|
|
|
'LD_VERSION'
|
2022-03-07 08:03:33 +01:00
|
|
|
'PAHOLE_VERSION'
|
2022-12-02 09:18:13 +01:00
|
|
|
'TOOLCHAIN_HAS_[A-Z_]*'
|
2021-03-11 20:22:33 +01:00
|
|
|
'TOOLS_SUPPORT_[A-Z_]*'
|
2023-01-09 12:38:41 +01:00
|
|
|
'OBJTOOL'
|
2021-03-10 09:06:35 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
declare -a SED_ARGS=()
|
|
|
|
|
|
|
|
for CONFIG in "${IGNORED_CONFIGS_RE[@]}"; do
|
2021-03-11 20:22:33 +01:00
|
|
|
SED_ARGS+=(-e "/\\<CONFIG_$CONFIG\\>/ d")
|
2021-03-10 09:06:35 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
SED_ARGS+=(
|
|
|
|
-e '/^# .* is not set$/p'
|
|
|
|
-e '/^$\|^#/d'
|
|
|
|
)
|
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
differences="$(
|
2021-03-10 09:06:35 +01:00
|
|
|
diff -bU0 <(sed "${SED_ARGS[@]}" "$1" | sort) \
|
|
|
|
<(sed "${SED_ARGS[@]}" "$2" | sort) \
|
2008-07-18 12:15:21 +02:00
|
|
|
| grep '^[-+][^-+]'
|
|
|
|
)" || true
|
|
|
|
if [ -n "$differences" ]; then
|
|
|
|
echo
|
|
|
|
echo "Changes after running \`make oldconfig':"
|
|
|
|
echo "$differences"
|
|
|
|
echo
|
|
|
|
if echo "$differences" | grep -q '^+' ; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|