Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e391b118 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "kbuild: skip install/check of headers right under uapi directories"

parents 1641722a 59b85967
Loading
Loading
Loading
Loading
+33 −15
Original line number Diff line number Diff line
@@ -3,25 +3,43 @@ cc_binary_host {
    srcs: ["scripts/unifdef.c"],
    sanitize: {
        never: true,
    },
}

genrule {
    name: "gen-headers_install.sh",
    srcs: ["scripts/headers_install.sh"],
    tools: ["unifdef"],
    out: ["headers_install.sh"],
    cmd: "sed 's+scripts/unifdef+$(location unifdef)+g' $(in) > $(out)",
}

gensrcs {
    name: "qseecom-kernel-includes",
cc_prebuilt_binary {
    name: "headers_install.sh",
    device_supported: false,
    host_supported: true,
    srcs: [":gen-headers_install.sh"],
}

    // move to out/ as root for header generation because of scripts/unifdef
    // storage - at the expense of extra ../ references
    cmd: "pushd out && mkdir -p scripts && rm -f scripts/unifdef && ln -s ../../$(location unifdef) scripts/unifdef && ../$(location scripts/headers_install.sh) `dirname ../$(out)` ../ $(in) && popd",
// Use the following for verbose output from kernel_headers.py.
// kernel_headers_verbose = "--verbose "
// Use the following for minimal output from kernel_headers.py.
kernel_headers_verbose = ""

    tools: ["unifdef"],
    tool_files: ["scripts/headers_install.sh"],
    export_include_dirs: ["include/uapi"],
    srcs: ["include/uapi/linux/qseecom.h"],
    output_extension: "h",
}
build = ["gen_headers_arm.bp", "gen_headers_arm64.bp"]

cc_library_headers {
    name: "qseecom-kernel-headers",
    generated_headers: ["qseecom-kernel-includes"],
    export_generated_headers: ["qseecom-kernel-includes"],
    name: "qti_kernel_headers",
    arch: {
        arm: {
            generated_headers: ["qti_generate_kernel_headers_arm"],
            export_generated_headers: ["qti_generate_kernel_headers_arm"],
        },
        arm64: {
            generated_headers: ["qti_generate_kernel_headers_arm64"],
            export_generated_headers: ["qti_generate_kernel_headers_arm64"],
        },
    },
    vendor: true,
    recovery_available: true,
}
+27 −52
Original line number Diff line number Diff line
@@ -44,11 +44,10 @@ This document describes the Linux kernel Makefiles.
	   --- 6.11 Post-link pass

	=== 7 Kbuild syntax for exported headers
		--- 7.1 header-y
		--- 7.2 genhdr-y
		--- 7.3 destination-y
		--- 7.4 generic-y
		--- 7.5 generated-y
		--- 7.1 no-export-headers-y
		--- 7.2 generic-y
		--- 7.3 generated-y
		--- 7.4 mandatory-y

	=== 8 Kbuild Variables
	=== 9 Makefile language
@@ -1236,7 +1235,7 @@ When kbuild executes, the following steps are followed (roughly):
	that may be shared between individual architectures.
	The recommended approach how to use a generic header file is
	to list the file in the Kbuild file.
	See "7.4 generic-y" for further info on syntax etc.
	See "7.2 generic-y" for further info on syntax etc.

--- 6.11 Post-link pass

@@ -1263,53 +1262,21 @@ The pre-processing does:
- drop include of compiler.h
- drop all sections that are kernel internal (guarded by ifdef __KERNEL__)

Each relevant directory contains a file name "Kbuild" which specifies the
headers to be exported.
See subsequent chapter for the syntax of the Kbuild file.

	--- 7.1 header-y

	header-y specifies header files to be exported.

		Example:
			#include/linux/Kbuild
			header-y += usb/
			header-y += aio_abi.h

	The convention is to list one file per line and
	preferably in alphabetic order.

	header-y also specifies which subdirectories to visit.
	A subdirectory is identified by a trailing '/' which
	can be seen in the example above for the usb subdirectory.

	Subdirectories are visited before their parent directories.

	--- 7.2 genhdr-y

	genhdr-y specifies generated files to be exported.
	Generated files are special as they need to be looked
	up in another directory when doing 'make O=...' builds.
All headers under include/uapi/, include/generated/uapi/,
arch/<arch>/include/uapi/ and arch/<arch>/include/generated/uapi/
are exported.

		Example:
			#include/linux/Kbuild
			genhdr-y += version.h

	--- 7.3 destination-y

	When an architecture has a set of exported headers that needs to be
	exported to a different directory destination-y is used.
	destination-y specifies the destination directory for all exported
	headers in the file where it is present.
A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
arch/<arch>/include/asm/ to list asm files coming from asm-generic.
See subsequent chapter for the syntax of the Kbuild file.

		Example:
			#arch/xtensa/platforms/s6105/include/platform/Kbuild
			destination-y := include/linux
	--- 7.1 no-export-headers

	In the example above all exported headers in the Kbuild file
	will be located in the directory "include/linux" when exported.
	no-export-headers is essentially used by include/uapi/linux/Kbuild to
	avoid exporting specific headers (e.g. kvm.h) on architectures that do
	not support it. It should be avoided as much as possible.

	--- 7.4 generic-y
	--- 7.2 generic-y

	If an architecture uses a verbatim copy of a header from
	include/asm-generic then this is listed in the file
@@ -1336,11 +1303,10 @@ See subsequent chapter for the syntax of the Kbuild file.
		Example: termios.h
			#include <asm-generic/termios.h>

	--- 7.5 generated-y
	--- 7.3 generated-y

	If an architecture generates other header files alongside generic-y
	wrappers, and not included in genhdr-y, then generated-y specifies
	them.
	wrappers, generated-y specifies them.

	This prevents them being treated as stale asm-generic wrappers and
	removed.
@@ -1349,6 +1315,15 @@ See subsequent chapter for the syntax of the Kbuild file.
			#arch/x86/include/asm/Kbuild
			generated-y += syscalls_32.h

	--- 7.4 mandatory-y

	mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
	to define the minimun set of headers that must be exported in
	include/asm.

	The convention is to list one subdir per line and
	preferably in alphabetic order.

=== 8 Kbuild Variables

The top Makefile exports the following variables:
+3 −3
Original line number Diff line number Diff line
@@ -1300,7 +1300,7 @@ firmware_install:
export INSTALL_HDR_PATH = $(objtree)/usr

# If we do an all arch process set dst to asm-$(hdr-arch)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/arch-$(hdr-arch), dst=include)

PHONY += archheaders
archheaders:
@@ -1321,7 +1321,7 @@ headers_install: __headers
	$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
	  $(error Headers not exportable for the $(SRCARCH) architecture))
	$(Q)$(MAKE) $(hdr-inst)=include/uapi
	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)
	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi $(hdr-dst)
	$(Q)$(MAKE) $(hdr-inst)=techpack

PHONY += headers_check_all
@@ -1331,7 +1331,7 @@ headers_check_all: headers_install_all
PHONY += headers_check
headers_check: headers_install
	$(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1
	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi $(hdr-dst) HDRCHECK=1
	$(Q)$(MAKE) $(hdr-inst)=techpack HDRCHECK=1

# ---------------------------------------------------------------------------
+0 −41
Original line number Diff line number Diff line
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

header-y += a.out.h
header-y += auxvec.h
header-y += bitsperlong.h
header-y += byteorder.h
header-y += compiler.h
header-y += console.h
header-y += errno.h
header-y += fcntl.h
header-y += fpu.h
header-y += gentrap.h
header-y += ioctl.h
header-y += ioctls.h
header-y += ipcbuf.h
header-y += kvm_para.h
header-y += mman.h
header-y += msgbuf.h
header-y += pal.h
header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ptrace.h
header-y += reg.h
header-y += regdef.h
header-y += resource.h
header-y += sembuf.h
header-y += setup.h
header-y += shmbuf.h
header-y += sigcontext.h
header-y += siginfo.h
header-y += signal.h
header-y += socket.h
header-y += sockios.h
header-y += stat.h
header-y += statfs.h
header-y += swab.h
header-y += sysinfo.h
header-y += termbits.h
header-y += termios.h
header-y += types.h
header-y += unistd.h
+0 −3
Original line number Diff line number Diff line
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm
header-y += elf.h
header-y += page.h
header-y += cachectl.h
Loading