lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 08 Jun 2023 16:14:58 +0100
From:   David Howells <dhowells@...hat.com>
To:     Masahiro Yamada <masahiroy@...nel.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nicolas Schier <nicolas@...sle.eu>
cc:     dhowells@...hat.com, linux-kbuild@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [RFC][PATCH] build: Deal with change in "make --no-print-directory" behaviour change

Hi Masahiro & the kbuild crew,

Here's a patch to fix a change in make behaviour in make-4.4.  It's almost
certainly the wrong solution, but it works for me for now.

Note that I tried just adding "--print-directory" to the $(MAKE) line after
the line I added, and that does seem to work - but it then prints a lot of
additional "entering directory" lines (though they all seem to be the same).

David
---
Emacs (and probably other IDEs) parse the "make: Entering directory" lines
in the build output so that they can correctly resolve relative pathnames
in messages from the compiler.  However, a change in make has broken this.
I think it might be:

        [/usr/share/doc/make/NEWS]
        ...
        Version 4.4 (31 Oct 2022)
        ...
        * WARNING: Backward-incompatibility!
          Previously if --no-print-directory was seen anywhere in the environment or
          command line it would take precedence over any --print-directory.  Now, the
          last setting of directory printing options seen will be used, so a command
          line such as "--no-print-directory -w" _will_ show directory entry/exits.

Doing a kernel build now only prints the directory passed to the "-C" flag
if present and no other directories.  This includes any build directory
indicated with "O=".  So if I do:

        make -C /my/data/linux O=build

I see:

        make: Entering directory '/my/data/linux'

and all the path in messages emitted by the compiler are prefixed with ".."
- but then doing "M-x next-error" in emacs will prompt emacs to ask where
the file is rather than jumping to it because it can't find it.

On the previous version of Fedora with make-4.3, an extra line is emitted
by make:

        make[1]: Entering directory '/my/data/linux/build'

and that was sufficient for emacs to be able to resolve paths.

Fix this by manually printing the missing line.

Signed-off-by: David Howells <dhowells@...hat.com>
cc: Masahiro Yamada <masahiroy@...nel.org>
cc: Nathan Chancellor <nathan@...nel.org>
cc: Nick Desaulniers <ndesaulniers@...gle.com>
cc: Nicolas Schier <nicolas@...sle.eu>
cc: linux-kbuild@...r.kernel.org
---
 Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 836643eaefee..7f7c75087626 100644
--- a/Makefile
+++ b/Makefile
@@ -223,6 +223,7 @@ $(filter-out $(this-makefile), $(MAKECMDGOALS)) __all: __sub-make
 
 # Invoke a second make in the output directory, passing relevant variables
 __sub-make:
+	@echo "make[1]: Entering directory '$(abs_objtree)'"
 	$(Q)$(MAKE) -C $(abs_objtree) -f $(abs_srctree)/Makefile $(MAKECMDGOALS)
 
 endif # need-sub-make

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ