In Kbuild, to specify a compilation unit, there are cases where the path and the realpath do not achieve the same result, for instance, in commit 1fc31638eb79eff8b1fb0e1bfcd5f9dbddbf16e2
kmax will not find the Makefile build constraints for the realpath, because the Makefile in amdgpu is what has the constraints for ../display, unlike most (but not all) paths in kbuild where the realpath has the Makefiles in each subdirectory in the path
klocalizer/koverage cannot compile the unit, because make requires having the relative paths and will not find the object file in the Makefiles
These have the same root cause: the Makefiles reference compilation units in non-descendant directories by looking into parent directories with ../.
Right now, there is support for solving (2) above, the --build-paths, but this works per-compilation unit (see #189) and does nothing to help (1).
Let's instead have a general solution that helps with both. If we instead rewrite any incoming compilation unit paths according to a mapping, then this should help solve both (1) and (2) at once. There can be a built-in mapping (that can be disabled) and user-specific mappings to replace the build-targets.
where defconfig is from make defconfig after checking out 1fc31638eb79eff8b1fb0e1bfcd5f9dbddbf16e2 and doing git show > 1fc31638eb79eff8b1fb0e1bfcd5f9dbddbf16e2.patch
In Kbuild, to specify a compilation unit, there are cases where the path and the realpath do not achieve the same result, for instance, in commit
1fc31638eb79eff8b1fb0e1bfcd5f9dbddbf16e2
will not be built, but a file that has the same realpath, but with some included relative paths, will be built
This affects krepair in two ways:
These have the same root cause: the Makefiles reference compilation units in non-descendant directories by looking into parent directories with
../
.Right now, there is support for solving (2) above, the --build-paths, but this works per-compilation unit (see #189) and does nothing to help (1).
Let's instead have a general solution that helps with both. If we instead rewrite any incoming compilation unit paths according to a mapping, then this should help solve both (1) and (2) at once. There can be a built-in mapping (that can be disabled) and user-specific mappings to replace the build-targets.
A test of whether this is working can use
where defconfig is from
make defconfig
after checking out1fc31638eb79eff8b1fb0e1bfcd5f9dbddbf16e2
and doinggit show > 1fc31638eb79eff8b1fb0e1bfcd5f9dbddbf16e2.patch