Commit a1b9805
Herton R. Krzesinski
kbuild: use $(src) instead of $(srctree)/$(src) for source directory
JIRA: https://issues.redhat.com/browse/RHEL-107194
commit b1992c3
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>1 parent 5332bc5 commit a1b9805
File tree
106 files changed
+178
-187
lines changed- Documentation
- devicetree/bindings
- kbuild
- arch
- arc/boot/dts
- arm64
- kernel/vdso
- kvm
- hyp
- arm
- boot
- mach-davinci
- mach-omap2
- mach-s3c
- mach-spear
- plat-orion
- plat-pxa
- plat-versatile
- tools
- csky
- boot/dts
- kernel/vdso
- ia64/kernel
- mips
- kernel/syscalls
- vdso
- nds32
- boot
- kernel/vdso
- nios2/boot/dts
- powerpc
- boot
- dts
- fsl
- kernel/vdso
- riscv/kernel/vdso
- s390/kernel
- syscalls
- vdso32
- vdso64
- sparc/vdso
- um/kernel
- x86
- boot
- entry/vdso
- kernel
- cpu
- mm
- um/vdso
- xtensa/boot/dts
- certs
- drivers
- crypto/intel/qat
- qat_420xx
- qat_4xxx
- qat_c3xxxvf
- qat_c3xxx
- qat_c62xvf
- qat_c62x
- qat_dh895xccvf
- qat_dh895xcc
- gpu/drm
- amd/amdgpu
- arm/display/komeda
- i915
- imagination
- msm
- nouveau
- xe
- hid
- amd-sfh-hid
- intel-ish-hid
- net
- ethernet
- aquantia/atlantic
- chelsio/libcxgb
- hisilicon/hns3
- hns3pf
- hns3vf
- wireless
- broadcom/brcm80211
- brcmfmac
- bca
- cyw
- wcc
- brcmsmac
- brcmutil
- intel/iwlwifi
- dvm
- mei
- mvm
- tests
- realtek/rtl818x
- rtl8180
- rtl8187
- scsi/aic7xxx
- staging
- rtl8188eu
- rtl8723bs
- unisys
- visorhba
- visornic
- fs
- iomap
- unicode
- xfs
- lib
- raid6
- net/wireless
- samples
- bpf
- hid
- scripts
- dtc
- gcc-plugins
- gdb/linux
- genksyms
- kconfig
- security/tomoyo
- usr
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
106 files changed
+178
-187
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
| 424 | + | |
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
506 | | - | |
| 505 | + | |
507 | 506 | | |
508 | 507 | | |
509 | 508 | | |
510 | | - | |
511 | | - | |
512 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
267 | 272 | | |
| 273 | + | |
| 274 | + | |
268 | 275 | | |
269 | 276 | | |
270 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
0 commit comments