From 08b3afd706faef5f623d9b98ecd0bb56f4fca297 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 16 Feb 2023 09:04:40 -0700 Subject: [PATCH] ANDROID: GKI: Fix copying of protected_exports When building gki_defconfig outside of the Android build system, copying protected_exports fails: $ make -skj"$(nproc)" LLVM=1 O=build gki_defconfig all cp: cannot create regular file '/protected_exports': Permission denied ... OUT_DIR is an Android build.sh specific variable, so it will not be defined when using just kbuild. Use objtree instead, which is guaranteed to be available through kbuild directly; OUT_DIR is passed to make via O, which is used to ultimately define objtree, so there is no functional change. Bug: 268678245 Change-Id: I235cef7c848a7cf9df9d7d5343af33d95b501a15 Fixes: 3e08ef692d61 ("ANDROID: GKI: Do not modify protected exports source list") Signed-off-by: Nathan Chancellor --- scripts/gen_gki_modules_headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen_gki_modules_headers.sh b/scripts/gen_gki_modules_headers.sh index e67c5c667fb0..722dfaff37b1 100755 --- a/scripts/gen_gki_modules_headers.sh +++ b/scripts/gen_gki_modules_headers.sh @@ -100,7 +100,7 @@ if [ "$(basename "${TARGET}")" = "gki_module_unprotected.h" ]; then generate_header "${TARGET}" "${GKI_VENDOR_SYMBOLS}" "unprotected" else # Sorted list of exported symbols - GKI_EXPORTED_SYMBOLS="${OUT_DIR}/protected_exports" + GKI_EXPORTED_SYMBOLS="${objtree}/protected_exports" # Make a temp copy to avoid changing source during pre-processing cp -f "${SYMBOL_LIST}" "${GKI_EXPORTED_SYMBOLS}"