From 457e386a9480b367e46bd89487d96147c8624ceb Mon Sep 17 00:00:00 2001 From: Quentin Perret Date: Fri, 28 Feb 2020 16:05:46 +0000 Subject: [PATCH] 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: 3d0431a87ab1 ("BACKPORT: FROMLIST: kbuild: allow symbol whitelisting with TRIM_UNUSED_KSYMS") Signed-off-by: Quentin Perret Change-Id: I35449dc92437f2928a659c8ecd6fbf725e0e1b87 --- scripts/gen_autoksyms.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh index 82d035ed7ca1..3c88af58092b 100755 --- a/scripts/gen_autoksyms.sh +++ b/scripts/gen_autoksyms.sh @@ -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