From a4c2687cd943eb78eac6d41fdb08ddc64e4f8795 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 3 Nov 2022 16:12:31 -0700 Subject: [PATCH] ANDROID: kleaf: //common:all_headers should use linux_includes. A new attribute, linux_includes, is added to ddk_headers to denote that certain include directories should be added to LINUXINCLUDE, not ccflags-y. Change includes to linux_includes for the allowlist of ddk_headers targets in //common. These are already added to LINUXINCLUDE in common/Makefile, but we should make them explicit in BUILD files too so the ordering can be listed clearly in BUILD files. Test: build cuttlefish with DDK Bug: 257342715 Bug: 254735056 Change-Id: I97678264b37036cb5ab86973428e4e0d7f5b645d Signed-off-by: Yifan Hong (cherry picked from commit 943d5a70d5a3a79bae02690a20e600974c7a644a) --- BUILD.bazel | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index e2cdb460f726..d4fd6999f027 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -286,7 +286,8 @@ ddk_headers( ], # The list of include directories where source files can #include headers # from. In other words, these are the `-I` option to the C compiler. - includes = [ + # These are prepended to LINUXINCLUDE. + linux_includes = [ "arch/arm64/include", "arch/arm64/include/uapi", "include", @@ -303,7 +304,8 @@ ddk_headers( ], # The list of include directories where source files can #include headers # from. In other words, these are the `-I` option to the C compiler. - includes = [ + # These are prepended to LINUXINCLUDE. + linux_includes = [ "arch/x86/include", "arch/x86/include/uapi", "include", @@ -352,6 +354,7 @@ ddk_headers( ], # The list of include directories where source files can #include headers # from. In other words, these are the `-I` option to the C compiler. + # Unsafe include directories are appended to ccflags-y. includes = [], visibility = ["//visibility:private"], )