Centos-kernel-stream-9/lib
Herton R. Krzesinski a1b9805d99 kbuild: use $(src) instead of $(srctree)/$(src) for source directory
JIRA: https://issues.redhat.com/browse/RHEL-107194

commit b1992c3772e69a6fd0e3fc81cd4d2820c8b6eca0
Author: Masahiro Yamada <masahiroy@kernel.org>
Date:   Sat Apr 27 23:55:02 2024 +0900

    kbuild: use $(src) instead of $(srctree)/$(src) for source directory

    Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for
    checked-in source files. It is merely a convention without any functional
    difference. In fact, $(obj) and $(src) are exactly the same, as defined
    in scripts/Makefile.build:

        src := $(obj)

    When the kernel is built in a separate output directory, $(src) does
    not accurately reflect the source directory location. While Kbuild
    resolves this discrepancy by specifying VPATH=$(srctree) to search for
    source files, it does not cover all cases. For example, when adding a
    header search path for local headers, -I$(srctree)/$(src) is typically
    passed to the compiler.

    This introduces inconsistency between upstream and downstream Makefiles
    because $(src) is used instead of $(srctree)/$(src) for the latter.

    To address this inconsistency, this commit changes the semantics of
    $(src) so that it always points to the directory in the source tree.

    Going forward, the variables used in Makefiles will have the following
    meanings:

      $(obj)     - directory in the object tree
      $(src)     - directory in the source tree  (changed by this commit)
      $(objtree) - the top of the kernel object tree
      $(srctree) - the top of the kernel source tree

    Consequently, $(srctree)/$(src) in upstream Makefiles need to be replaced
    with $(src).

    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

Conflicts:

There is a extensive list of fixes/conflicts due the amount of files originally
changed by this commit, plus the difference of rhel-9 code against upstream. All
conflicts/differences are listed below:

- Context difference at Documentation/Makefile since RHEL 9 does not have the
  change "docs: allow to pass extra DOCS_CSS themes via make" and later changes.
- Conflict at Documentation/devicetree/bindings/Makefile, patch find_cmd instead
  of find_all_cmd since RHEL-9 doesn't have "dt-bindings: Consider
  DT_SCHEMA_FILES when finding all json-schema", "dt-bindings: kbuild: Split
  targets out to separate rules" and later changes.
- Conflict at Documentation/kbuild/makefiles.rst due different identation since
  RHEL-9 doesn't have the change "docs/kbuild/makefiles: clean up indentation
  and whitespace"
- Patched additional $(srctree)/$(src) references at:
   * arch/arm/mach-davinci/Makefile
   * arch/arm/mach-omap2/Makefile
   * arch/arm/mach-spear/Makefile
   * arch/arm/plat-pxa/Makefile
   * arch/arm/plat-versatile/Makefile
   * arch/ia64/kernel/Makefile
   * arch/nds32/boot/Makefile
   * arch/nds32/kernel/vdso/Makefile
   * drivers/net/ethernet/hisilicon/hns3/hns3pf/Makefile
   * drivers/net/ethernet/hisilicon/hns3/hns3vf/Makefile
   * drivers/staging/rtl8188eu/Makefile
   * drivers/staging/unisys/visorhba/Makefile
   * drivers/staging/unisys/visornic/Makefile
   * scripts/gcc-plugins/Makefile
  Since RHEL-9 does not have later upstream changes that dropped/made those
  references uneeded.
- Conflict at arch/arm/mach-s3c/Makefile since RHEL-9 doesn't have
  "ARM: s3c: remove s3c24xx specific hacks" and related changes. Also,
  extra locations needed patching because of not having the changes
  "ARM: s3c: remove all s3c24xx support" and "ARM: s3c: fix include path".
  Due lacking the last change also arch/arm/mach-s3c/Makefile.s3c64xx needs
  additional two places patched as well.
- Conflict at arch/arm/plat-orion/Makefile since RHEL-9 doesn't have
  the commit "ARM: orion: fix include path" and its previous related
  changes.
- Dropped changes for arch/loongarch since it doesn't exist on rhel-9
- Dropped changes to arch/parisc/kernel/{vdso32,vdso64}/Makefile since RHEL 9
  does not have the change "parisc: Add vDSO support" and later updates to it.
- Dropped change to arch/riscv/kernel/compat_vdso/Makefile since RHEL 9 does
  not have the change "riscv: compat: vdso: Add COMPAT_VDSO base code implementation"
- Dropped change to arch/riscv/kvm/Makefile since there is no KVM support/commits
  in RHEL 9 for riscv.
- Apply change for arch/riscv/kernel/vdso/Makefile in a different place since
  RHEL-9 does not have the change "riscv: explicitly use symbol offsets for VDSO"
  which changed the location of the $(srctree)/$(src) reference
- Dropped change to certs/Makefile related to check-blacklist-hashes.awk since
  that script was only added with commit "certs: Check that builtin blacklist
  hashes are valid" which is not backported/available in RHEL 9 code right now.
- Dropped change to drivers/md/dm-vdo/Makefile since dm-vdo was never backported
  to RHEL-9 main.
- Dropped change to drivers/net/ethernet/fungible/funeth/Makefile since fungible
  ethernet driver/devices code is not available/backported to RHEL-9.
- Fixed conflict at drivers/net/ethernet/hisilicon/hns3/Makefile since RHEL-9
  does not have the change "net: hns3: refactor hns3 makefile to support
  hns3_common module"
- Fixed conflict at drivers/net/wireless/intel/iwlwifi/mvm/Makefile due already
  backported commit "wifi: iwlwifi: mvm: implement link grading"
- Dropped change to init/Makefile since we are not backporting
  "kbuild: build init/built-in.a just once" that introduced the section patched.
- Dropped change to rust/Makefile since there is no rust support backported
  to RHEL-9.
- Fixed conflict at scripts/dtc/Makefile since RHEL-9 does not have the change
  "dt-bindings: kbuild: Use DTB files for validation"
- Dropped change to security/tomoyo/Makefile since it's not needed, it's just
  reverting the change "tomoyo: fix broken dependency on *.conf.default" which
  was never applied to RHEL-9. However, we also bring a different change/patch
  location since RHEL-9 does not have the change "tomoyo: Omit use of bin2c".
- Dropped change to usr/include/Makefile since "kbuild: move headers_check.pl to
  usr/include/" is not being backported to RHEL-9.
- Misc/minor context differences at other places.

Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2025-08-19 20:06:24 -03:00
..
842
crypto
dim dim: pass dim_sample to net_dim() by reference 2025-06-03 14:20:04 +02:00
fonts
kunit
livepatch selftests: livepatch: test livepatching a kprobed function 2025-03-06 13:32:22 -05:00
lz4
lzo
math
mpi
pldmfw pldmfw: enable selected component update 2025-05-30 09:42:18 +02:00
raid6 kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2025-08-19 20:06:24 -03:00
reed_solomon
test_fortify
vdso
xz lib/xz, lib/decompress_unxz.c: Fix spelling in comments 2025-01-17 18:47:24 +08:00
zlib_deflate
zlib_dfltcc
zlib_inflate
zstd
.gitignore
Kconfig lib: packing: add KUnit tests adapted from selftests 2025-05-27 08:59:39 +02:00
Kconfig.debug Merge: Update rcu to v6.12 2025-07-30 15:15:18 -03:00
Kconfig.kasan
Kconfig.kcsan
Kconfig.kfence
Kconfig.kgdb
Kconfig.kmsan
Kconfig.ubsan
Makefile kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2025-08-19 20:06:24 -03:00
argv_split.c
ashldi3.c
ashrdi3.c
asn1_decoder.c
asn1_encoder.c
assoc_array.c
atomic64.c
atomic64_test.c
audit.c
base64.c
bcd.c
bch.c
bitfield_kunit.c
bitmap.c lib: bitmap: fix many kernel-doc warnings 2025-02-12 15:16:16 +00:00
bitrev.c
bootconfig-data.S
bootconfig.c
bsearch.c
btree.c
bucket_locks.c
bug.c
build_OID_registry
buildid.c lib/buildid: Handle memfd_secret() files in build_id_parse() 2025-01-21 11:27:08 +01:00
bust_spinlocks.c
check_signature.c
checksum.c
checksum_kunit.c
clz_ctz.c
clz_tab.c
cmdline.c
cmdline_kunit.c
cmpdi2.c
compat_audit.c
cpu_rmap.c
cpumask.c
cpumask_kunit.c
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
crc4.c
crc7.c
crc8.c
crc16.c
crc32.c
crc32defs.h
crc32test.c
crc64-rocksoft.c
crc64.c
ctype.c
debug_info.c
debug_locks.c
debugobjects.c
dec_and_lock.c
decompress.c
decompress_bunzip2.c
decompress_inflate.c
decompress_unlz4.c
decompress_unlzma.c
decompress_unlzo.c
decompress_unxz.c lib/xz, lib/decompress_unxz.c: Fix spelling in comments 2025-01-17 18:47:24 +08:00
decompress_unzstd.c
devmem_is_allowed.c
devres.c
digsig.c
dump_stack.c
dynamic_debug.c
dynamic_queue_limits.c
earlycpio.c
errname.c
error-inject.c
errseq.c
extable.c
fault-inject-usercopy.c
fault-inject.c
fdt.c
fdt_addresses.c
fdt_empty_tree.c
fdt_ro.c
fdt_rw.c
fdt_strerror.c
fdt_sw.c
fdt_wip.c
find_bit.c Merge: update cpuidle to match Linux v6.12 2025-02-04 15:39:49 +01:00
find_bit_benchmark.c
flex_proportions.c
fw_table.c
gen_crc32table.c
gen_crc64table.c
genalloc.c
generic-radix-tree.c
glob.c
globtest.c
group_cpus.c lib/group_cpus: fix NULL pointer dereference from group_cpus_evenly() 2025-07-08 09:01:25 +08:00
hashtable_test.c
hexdump.c
hweight.c
idr.c
inflate.c
interval_tree.c
interval_tree_test.c
iomap.c
iomap_copy.c
iommu-helper.c
iov_iter.c lib/iov_iter: fix import_iovec_ubuf iovec management 2025-04-21 18:31:29 +08:00
irq_poll.c
irq_regs.c
is_single_threaded.c
kasprintf.c
kfifo.c kfifo: add kfifo_dma_out_prepare_mapped() 2025-05-28 16:18:58 +02:00
klist.c
kobject.c
kobject_uevent.c
kstrtox.c
kstrtox.h
libcrc32c.c
linear_ranges.c
list-test.c
list_debug.c
list_sort.c
llist.c
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-rtmutex.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c
lockref.c
logic_iomem.c
logic_pio.c
lru_cache.c
lshrdi3.c
lwq.c
maple_tree.c
memcat_p.c
memcpy_kunit.c
memory-notifier-error-inject.c
memregion.c
memweight.c
muldi3.c
net_utils.c
netdev-notifier-error-inject.c
nlattr.c
nmi_backtrace.c
notifier-error-inject.c
notifier-error-inject.h
objagg.c
of-reconfig-notifier-error-inject.c
oid_registry.c lib/oid_registry.c: remove unused sprint_OID 2025-07-19 20:58:08 -03:00
once.c
overflow_kunit.c
packing.c lib: packing: add pack_fields() and unpack_fields() 2025-05-27 08:59:39 +02:00
packing_test.c lib: packing: catch kunit_kzalloc() failure in the pack() test 2025-05-27 08:59:39 +02:00
parman.c
parser.c
percpu-refcount.c
percpu_counter.c
percpu_test.c
plist.c
pm-notifier-error-inject.c
polynomial.c
radix-tree.c
random32.c
ratelimit.c
rbtree.c
rbtree_test.c
rcuref.c
ref_tracker.c
refcount.c
rhashtable.c
sbitmap.c
scatterlist.c
seq_buf.c
sg_pool.c
sg_split.c
sha1.c
siphash.c
siphash_kunit.c
slub_kunit.c
smp_processor_id.c
sort.c
stackdepot.c
stackinit_kunit.c
stmp_device.c
strcat_kunit.c
string.c
string_helpers.c
strncpy_from_user.c
strnlen_user.c
strscpy_kunit.c
syscall.c
test-kstrtox.c
test-string_helpers.c
test_bitmap.c
test_bitops.c
test_bits.c
test_blackhole_dev.c
test_bpf.c
test_debug_virtual.c
test_firmware.c
test_fprobe.c
test_fpu.c
test_free_pages.c
test_hash.c
test_hexdump.c
test_hmm.c
test_hmm_uapi.h
test_ida.c
test_kmod.c lib/test_kmod: do not hardcode/depend on any filesystem 2025-06-18 10:38:54 -03:00
test_linear_ranges.c
test_list_sort.c
test_lockup.c
test_maple_tree.c
test_memcat_p.c
test_meminit.c
test_min_heap.c
test_module.c
test_objagg.c
test_parman.c
test_printf.c
test_ref_tracker.c
test_rhashtable.c
test_scanf.c
test_sort.c
test_static_key_base.c
test_static_keys.c
test_string.c
test_sysctl.c testing: use the copyleft-next-0.3.1 SPDX tag 2025-06-18 10:38:53 -03:00
test_ubsan.c
test_user_copy.c
test_uuid.c
test_vmalloc.c
test_xarray.c
textsearch.c
timerqueue.c
trace_readwrite.c
ts_bm.c
ts_fsm.c
ts_kmp.c
ubsan.c
ubsan.h
ucmpdi2.c
ucs2_string.c lib/ucs2_string: Add UCS-2 strscpy function 2025-01-31 18:36:01 -05:00
union_find.c Union-Find: add a new module in kernel library 2025-04-09 21:58:35 -04:00
usercopy.c
uuid.c
vsprintf.c wrapper for access to ->bd_partno 2025-03-14 16:48:08 +08:00
win_minmax.c
xarray.c
xxhash.c