Skip to contentSkip to conversation

scripts/gdb: Use $(abspath ...) instead of $(shell cd ... && pwd)

PATCH In review Thierry Reding 2 participants 4 messages Apr 8, 2016 – Apr 18, 2016 GDB kernel debugging helper scripts

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/gdb: Use $(abspath ...) instead of $(shell cd ... && pwd)

From: Thierry Reding <[email protected]>

Avoid forking off a shell to resolve the absolute path of the output directory when make's builtin $(abspath ...) function will do an adequate job.

---
 scripts/gdb/linux/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gdb/linux/Makefile +1 -1
index 6cf1ecf61057..d8b88e22e16a 100644
@@ -1,6 +1,6 @@
 always := gdb-scripts
 
-SRCTREE := $(shell cd $(srctree) && /bin/pwd)
+SRCTREE := $(abspath $(srctree))
 
 $(obj)/gdb-scripts:
 ifneq ($(KBUILD_SRC),)
Signature · 1 line
2.8.0
maintainer
#1 lore raw
Quoted 17 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Avoid forking off a shell to resolve the absolute path of the output directory when make's builtin $(abspath ...) function will do an adequate job.

---
 scripts/gdb/linux/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gdb/linux/Makefile +0 -0
index 6cf1ecf61057..d8b88e22e16a 100644

scripts/gdb/linux/Makefile line 6

Quoted 7 lines
scripts/gdb/linux/Makefile +1 -1
@@ -1,6 +1,6 @@
 always := gdb-scripts
 
-SRCTREE := $(shell cd $(srctree) && /bin/pwd)
+SRCTREE := $(abspath $(srctree))
 
 $(obj)/gdb-scripts:
 ifneq ($(KBUILD_SRC),)

Thanks, good cleanup. Queued.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 19 lines · Jan Kiszka
Quoted 18 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Avoid forking off a shell to resolve the absolute path of the output directory when make's builtin $(abspath ...) function will do an adequate job.

---
 scripts/gdb/linux/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gdb/linux/Makefile +0 -0
index 6cf1ecf61057..d8b88e22e16a 100644
@@ -1,6 +1,6 @@
 always := gdb-scripts
 
Quoted 8 lines

scripts/gdb/linux/Makefile line 6

Quoted 6 lines
scripts/gdb/linux/Makefile +1 -1
-SRCTREE := $(shell cd $(srctree) && /bin/pwd)
+SRCTREE := $(abspath $(srctree))
 
 $(obj)/gdb-scripts:
 ifneq ($(KBUILD_SRC),)

Thanks, good cleanup. Queued.

You might want to remove this, if it's not too late yet. I posted another similar thread and people objected to it because it requires GNU make 3.81, whereas the kernel build process officially still supports 3.80.

Thierry

maintainer
#3 lore raw
Quoted 23 lines · Thierry Reding
Quoted 22 lines · Jan Kiszka
Quoted 21 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Avoid forking off a shell to resolve the absolute path of the output directory when make's builtin $(abspath ...) function will do an adequate job.

---
 scripts/gdb/linux/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gdb/linux/Makefile +1 -1
index 6cf1ecf61057..d8b88e22e16a 100644
@@ -1,6 +1,6 @@
 always := gdb-scripts
 
-SRCTREE := $(shell cd $(srctree) && /bin/pwd)
+SRCTREE := $(abspath $(srctree))
 
Quoted 7 lines
Quoted 5 lines

scripts/gdb/linux/Makefile line 6

Quoted 3 lines
scripts/gdb/linux/Makefile +0 -0
 $(obj)/gdb-scripts:
 ifneq ($(KBUILD_SRC),)

Thanks, good cleanup. Queued.

You might want to remove this, if it's not too late yet. I posted

Still in my queue only.

Quoted 3 lines

another similar thread and people objected to it because it requires GNU make 3.81, whereas the kernel build process officially still supports 3.80.

Hmm, I scanned the kernel for this pattern before, and there were hits... ah, only in tools/, not in the main build. OK, will drop again.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux