]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: revert $(realpath ...) to $(shell cd ... && /bin/pwd)
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 2 Oct 2017 08:07:28 +0000 (17:07 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 7 Oct 2017 11:08:02 +0000 (20:08 +0900)
commit40780d20c83b6c3f73f367103c334b883784a7ec
tree6ffc6471517542ddb3d2470ccdc98fd93ac27fcc
parentb888c937506147d5d77f24afb038b53ae6e1b4f2
kbuild: revert $(realpath ...) to $(shell cd ... && /bin/pwd)

I thought commit 2e410c7ae16f ("kbuild: use $(abspath ...) instead of
$(shell cd ... && /bin/pwd)") was a safe conversion, but it changed
the behavior.

$(abspath ...) / $(realpath ...) does not expand shell special
characters, such as '~'.

Here is a simple Makefile example:

  ---------------->8----------------
  $(info /bin/pwd: $(shell cd ~/; /bin/pwd))
  $(info abspath: $(abspath ~/))
  $(info realpath: $(realpath ~/))
  all:
          @:
  ---------------->8----------------

  $ make
  /bin/pwd: /home/masahiro
  abspath: /home/masahiro/workspace/~
  realpath:

This can be a real problem if 'make O=~/foo' is invoked from another
Makefile or primitive shell like dash.

This commit partially reverts 2e410c7ae16f.

Fixes: 2e410c7ae16f ("kbuild: use $(abspath ...) instead of $(shell cd ... && /bin/pwd)")
Reported-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Makefile
tools/power/cpupower/Makefile
tools/scripts/Makefile.include