ANDROID: kbuild: fix UNUSED_KSYMS_WHITELIST backport

The backport of the UNUSED_KSYMS_WHITELIST feature to android-4.19
missed a dependency on $MODVERDIR (which is still there in 4.19), hence
causing it to un-export any symbol that is not on the whitelist, even if
it has an in-tree user.

I was _really_ close to call that a 'feature', but it wasn't exactly
intended, so I'll call it a 'bug' instead.

Kill the bugger.

Bug: 148277666
Fixes: 3d0431a87a ("BACKPORT: FROMLIST: kbuild: allow symbol
whitelisting with TRIM_UNUSED_KSYMS")
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I35449dc92437f2928a659c8ecd6fbf725e0e1b87
This commit is contained in:
Quentin Perret 2020-02-28 16:05:46 +00:00
commit 457e386a94

View file

@ -39,12 +39,12 @@ cat > "$output_file" << EOT
EOT
[ -f modules.order ] && modlist=modules.order || modlist=/dev/null
sed 's/ko$/mod/' $modlist |
xargs -n1 sed -n -e '3{s/ /\n/g;/^$/!p;}' -- |
cat - "$ksym_wl" |
sort -u |
sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file"
for mod in "$MODVERDIR"/*.mod; do
[ -f "$mod" ] && sed -n -e '3{s/ /\n/g;/^$/!p;}' "$mod"
done | cat - "$ksym_wl" | sort -u |
while read sym; do
echo "#define __KSYM_${sym} 1"
done >> "$output_file"
# Special case for modversions (see modpost.c)
if [ -n "$CONFIG_MODVERSIONS" ]; then