Something went wrong. Try again.
(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189# SPDX-License-Identifier: GPL-2.0-only
# Unlike the kernel space, exported headers are written in standard C.# - Forbid C++ style comments# - Use '__inline__', '__asm__' instead of 'inline', 'asm'## -std=c90 (equivalent to -ansi) catches the violation of those.# We cannot go as far as adding -Wpedantic since it emits too many warnings.UAPI_CFLAGS := -std=c90 -Werror=implicit-function-declarationUAPI_ARCH := $(or $(HEADER_ARCH),$(SRCARCH))
override c_flags = $(KBUILD_USERCFLAGS) $(UAPI_CFLAGS) -Wp,-MMD,$(depfile)cxx_flags = $(filter-out -Wmissing-prototypes -Wstrict-prototypes -std=%, $(KBUILD_USERCFLAGS)) -std=c++98
# The following are excluded for now because they fail to build.## Do not add a new header to the blacklist without legitimate reason.# Please consider to fix the header first.## Sorted alphabetically.no-header-test += asm/ucontext.hno-header-test += drm/vmwgfx_drm.hno-header-test += linux/am437x-vpfe.hno-header-test += linux/coda.hno-header-test += linux/cyclades.hno-header-test += linux/errqueue.hno-header-test += linux/hdlc/ioctl.hno-header-test += linux/ivtv.hno-header-test += linux/matroxfb.hno-header-test += linux/omap3isp.hno-header-test += linux/omapfb.hno-header-test += linux/patchkey.hno-header-test += linux/phonet.hno-header-test += linux/sctp.hno-header-test += linux/sysctl.hno-header-test += linux/usb/audio.hno-header-test += linux/v4l2-mediabus.hno-header-test += linux/v4l2-subdev.hno-header-test += linux/videodev2.hno-header-test += linux/vm_sockets.hno-header-test += sound/asequencer.hno-header-test += sound/asoc.hno-header-test += sound/asound.hno-header-test += sound/compress_offload.hno-header-test += sound/emu10k1.hno-header-test += sound/sfnt_info.hno-header-test += xen/evtchn.hno-header-test += xen/gntdev.hno-header-test += xen/privcmd.h
# More headers are broken in some architectures
ifneq ($(filter arc openrisc xtensa nios2, $(UAPI_ARCH)),)no-header-test += linux/bpf_perf_event.hendif
ifeq ($(UAPI_ARCH),sparc)no-header-test += asm/uctx.hno-header-test += asm/fbio.hendif
# asm-generic/*.h is used by asm/*.h, and should not be included directlyno-header-test += asm-generic/%
# The following are not compatible with C++.## Do not add a new header to the list without legitimate reason.# Please consider to fix the header first.## Sorted alphabetically.no-header-test-cxx += linux/auto_dev-ioctl.hno-header-test-cxx += linux/map_to_14segment.hno-header-test-cxx += linux/map_to_7segment.hno-header-test-cxx += linux/netfilter/xt_sctp.hno-header-test-cxx += linux/target_core_user.hno-header-test-cxx += linux/vhost.hno-header-test-cxx += linux/vhost_types.hno-header-test-cxx += linux/virtio_net.hno-header-test-cxx += linux/virtio_ring.hno-header-test-cxx += scsi/fc/fc_els.h
ifeq ($(UAPI_ARCH),x86)no-header-test-cxx += asm/elf.hendif
# The following are using libc header and types.## Do not add a new header to the list without legitimate reason.# Please consider to fix the header first.## Sorted alphabetically.uses-libc += linux/a.out.huses-libc += linux/atmbr2684.huses-libc += linux/auto_dev-ioctl.huses-libc += linux/auto_fs.huses-libc += linux/auto_fs4.huses-libc += linux/btrfs_tree.huses-libc += linux/cec-funcs.huses-libc += linux/cec.huses-libc += linux/dvb/dmx.huses-libc += linux/dvb/video.huses-libc += linux/ethtool.huses-libc += linux/ethtool_netlink.huses-libc += linux/fuse.huses-libc += linux/gsmmux.huses-libc += linux/icmp.huses-libc += linux/idxd.huses-libc += linux/if.huses-libc += linux/if_arp.huses-libc += linux/if_bonding.huses-libc += linux/if_pppox.huses-libc += linux/if_tunnel.huses-libc += linux/input.huses-libc += linux/ip6_tunnel.huses-libc += linux/joystick.huses-libc += linux/llc.huses-libc += linux/mctp.huses-libc += linux/mdio.huses-libc += linux/mii.huses-libc += linux/mptcp.huses-libc += linux/netdevice.huses-libc += linux/netfilter/xt_RATEEST.huses-libc += linux/netfilter/xt_hashlimit.huses-libc += linux/netfilter/xt_physdev.huses-libc += linux/netfilter/xt_rateest.huses-libc += linux/netfilter_arp/arp_tables.huses-libc += linux/netfilter_arp/arpt_mangle.huses-libc += linux/netfilter_bridge.huses-libc += linux/netfilter_bridge/ebtables.huses-libc += linux/netfilter_ipv4.huses-libc += linux/netfilter_ipv4/ip_tables.huses-libc += linux/netfilter_ipv6.huses-libc += linux/netfilter_ipv6/ip6_tables.huses-libc += linux/route.huses-libc += linux/shm.huses-libc += linux/soundcard.huses-libc += linux/string.huses-libc += linux/tipc_config.huses-libc += linux/uhid.huses-libc += linux/uinput.huses-libc += linux/vhost.huses-libc += linux/vhost_types.huses-libc += linux/virtio_ring.huses-libc += linux/wireless.huses-libc += regulator/regulator.huses-libc += scsi/fc/fc_els.h
ifeq ($(UAPI_ARCH),hexagon)uses-libc += asm/sigcontext.hendif
ifeq ($(UAPI_ARCH),nios2)uses-libc += asm/ptrace.hendif
ifeq ($(UAPI_ARCH),s390)uses-libc += asm/chpid.huses-libc += asm/chsc.hendif
always-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null))
# $(cc-option) forces '-x c' which breaks '-x c++' detection.cc-can-compile-cxx := $(call try-run,$(CC) $(CLANG_FLAGS) -c -x c++ /dev/null -o "$$TMP", 1)
target-libc = $(filter $(uses-libc), $*.h)target-can-compile = $(filter-out $(no-header-test), $*.h)target-can-compile-cxx = $(and $(cc-can-compile-cxx), $(target-can-compile), $(filter-out $(no-header-test-cxx), $*.h))
hdrtest-flags = -fsyntax-only -Werror \ -nostdinc -I $(obj) $(if $(target-libc), -I $(srctree)/usr/dummy-include)
# Include the header twice to detect missing include guard.quiet_cmd_hdrtest = HDRTEST $< cmd_hdrtest = \ $(CC) $(c_flags) $(hdrtest-flags) -x c /dev/null \ $(if $(target-can-compile), -include $< -include $<); \ $(if $(target-can-compile-cxx), \ $(CC) $(cxx_flags) $(hdrtest-flags) -x c++ /dev/null -include $<;) \ $(PERL) $(src)/headers_check.pl $(obj) $<; \ touch $@
$(obj)/%.hdrtest: $(obj)/%.h $(src)/headers_check.pl FORCE $(call if_changed_dep,hdrtest)
# Since GNU Make 4.3, $(patsubst $(obj)/%/,%,$(wildcard $(obj)/*/)) works.# To support older Make versions, use a somewhat tedious way.clean-files += $(filter-out Makefile headers_check.pl, $(notdir $(wildcard $(obj)/*)))