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: 3e08ef692d ("ANDROID: GKI: Do not modify protected exports source list")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
Nathan Chancellor 2023-02-16 09:04:40 -07:00 committed by Treehugger Robot
parent 041c1f054d
commit 08b3afd706

View file

@ -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}"