Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 457e386a authored by Quentin Perret's avatar Quentin Perret
Browse files

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: 3d0431a8 ("BACKPORT: FROMLIST: kbuild: allow symbol
whitelisting with TRIM_UNUSED_KSYMS")
Signed-off-by: default avatarQuentin Perret <qperret@google.com>
Change-Id: I35449dc92437f2928a659c8ecd6fbf725e0e1b87
parent 67e44085
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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