ANDROID: GKI: Remove duplicates from symbol lists

scripts/gen_gki_modules_headers.sh:

Add an option to only keep unique symbols during the
symbol list prep phase as for header generation symbol
list needs to be unique union of all vendor symbol
lists in an ascending order.

This reduces the array size and improves the lookup
time for the binary search.

Bug: 232430739
Test: TH
Fixes: 13e6a16651 ("ANDROID: GKI: Header generation fix and improvements")
Change-Id: Ib6868f5a8eb0b3713e192bec111804e993e3d085
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
(cherry picked from commit 2069048a7398dd0dfde60c2e9b0d720c1e62f87e)
This commit is contained in:
Ramji Jiyani 2023-02-02 08:13:38 +00:00 committed by Treehugger Robot
parent 87b17926cd
commit f4011fc8ae

View file

@ -54,7 +54,7 @@ generate_header() {
sed -i '/^[[:space:]]*$/d; /^#/d; /\[abi_symbol_list\]/d' "${symbol_file}"
# Sort in byte order for kernel binary search at runtime
LC_ALL=C sort -o "${symbol_file}" "${symbol_file}"
LC_ALL=C sort -u -o "${symbol_file}" "${symbol_file}"
# Trim white spaces & +1 for null termination
local max_name_len=$(awk '