[PATCH] kbuild: scripts/gdb: bring the "abspath" back

Joel Granados via B4 Relay posted 1 patch 1 year, 5 months ago
There is a newer version of this series
scripts/gdb/linux/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH] kbuild: scripts/gdb: bring the "abspath" back
Posted by Doug Anderson 1 year, 5 months ago
Hi,

On Thu, Jun 20, 2024 at 12:48 PM Joel Granados via B4 Relay
<devnull+j.granados.samsung.com@kernel.org> wrote:
>
> From: Joel Granados <j.granados@samsung.com>
>
> Use the "abspath" call when symlinking the gdb python scripts in
> scripts/gdb/linux. This call is needed to avoid broken links when
> running the scripts_gdb target on a different build directory
> (O=builddir).
>
> Fixes: 659bbf7e1b08 ("kbuild: scripts/gdb: Replace missed $(srctree)/$(src) w/ $(src)")
> Signed-off-by: Joel Granados <j.granados@samsung.com>
> ---
>  scripts/gdb/linux/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Ah, good call. Yeah, this makes sense to me and also seems to produce
reasonable symlinks. Sorry for not coming up with this originally.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Re: [PATCH] kbuild: scripts/gdb: bring the "abspath" back
Posted by Joel Granados 1 year, 5 months ago
On Thu, Jun 20, 2024 at 02:51:41PM -0700, Doug Anderson wrote:
> Hi,
> 
> On Thu, Jun 20, 2024 at 12:48 PM Joel Granados via B4 Relay
> <devnull+j.granados.samsung.com@kernel.org> wrote:
> >
> > From: Joel Granados <j.granados@samsung.com>
> >
> > Use the "abspath" call when symlinking the gdb python scripts in
> > scripts/gdb/linux. This call is needed to avoid broken links when
> > running the scripts_gdb target on a different build directory
> > (O=builddir).
> >
> > Fixes: 659bbf7e1b08 ("kbuild: scripts/gdb: Replace missed $(srctree)/$(src) w/ $(src)")
> > Signed-off-by: Joel Granados <j.granados@samsung.com>
> > ---
> >  scripts/gdb/linux/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Ah, good call. Yeah, this makes sense to me and also seems to produce
> reasonable symlinks. Sorry for not coming up with this originally.
No worries. Please tell me if you need me to do something else to
upstream this 

Best

-- 

Joel Granados
Re: [PATCH] kbuild: scripts/gdb: bring the "abspath" back
Posted by Masahiro Yamada 1 year, 5 months ago
On Mon, Jun 24, 2024 at 3:20 PM Joel Granados <j.granados@samsung.com> wrote:
>
> On Thu, Jun 20, 2024 at 02:51:41PM -0700, Doug Anderson wrote:
> > Hi,
> >
> > On Thu, Jun 20, 2024 at 12:48 PM Joel Granados via B4 Relay
> > <devnull+j.granados.samsung.com@kernel.org> wrote:
> > >
> > > From: Joel Granados <j.granados@samsung.com>
> > >
> > > Use the "abspath" call when symlinking the gdb python scripts in
> > > scripts/gdb/linux. This call is needed to avoid broken links when
> > > running the scripts_gdb target on a different build directory
> > > (O=builddir).

For preciseness, please rephrase it to something like this:

 running the scripts_gdb target on a build directory located
 directly under the source tree (e.g., O=builddir).






O=foo/builddir does not cause this issue because
$(src) is already an absolute path.

This issue occurs only when the output directory is
a direct subdirectory of the source tree, in other words,
srctree is '..'


See this line:

https://github.com/torvalds/linux/blob/v6.10-rc5/Makefile#L254







-- 
Best Regards
Masahiro Yamada
Re: [PATCH] kbuild: scripts/gdb: bring the "abspath" back
Posted by Joel Granados 1 year, 5 months ago
On Wed, Jun 26, 2024 at 12:08:15AM +0900, Masahiro Yamada wrote:
> On Mon, Jun 24, 2024 at 3:20 PM Joel Granados <j.granados@samsung.com> wrote:
> >
> > On Thu, Jun 20, 2024 at 02:51:41PM -0700, Doug Anderson wrote:
> > > Hi,
> > >
> > > On Thu, Jun 20, 2024 at 12:48 PM Joel Granados via B4 Relay
> > > <devnull+j.granados.samsung.com@kernel.org> wrote:
> > > >
> > > > From: Joel Granados <j.granados@samsung.com>
> > > >
> > > > Use the "abspath" call when symlinking the gdb python scripts in
> > > > scripts/gdb/linux. This call is needed to avoid broken links when
> > > > running the scripts_gdb target on a different build directory
> > > > (O=builddir).
> 
> For preciseness, please rephrase it to something like this:
> 
>  running the scripts_gdb target on a build directory located
>  directly under the source tree (e.g., O=builddir).
I'll add this to a V2. Thx for the feedback

Best

-- 

Joel Granados