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-prev] [day] [month] [year] [list]
Message-ID: <20250207213439.GA661404@ax162>
Date: Fri, 7 Feb 2025 14:34:39 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Nicolas Schier <nicolas@...sle.eu>, llvm@...ts.linux.dev
Subject: Re: [PATCH] gen_compile_commands.py: remove code for '\#' replacement

On Thu, Feb 06, 2025 at 02:18:02AM +0900, Masahiro Yamada wrote:
> Since commit 9564a8cf422d ("Kbuild: fix # escaping in .cmd files for
> future Make"), '#' in the build command is replaced with $(pound) rather
> than '\#'.
> 
> Calling .replace(r'\#', '#') is only necessary when this tool is used
> to parse .*.cmd files generated by Linux 4.16 or earlier, which is
> unlikely happen.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>

Reviewed-by: Nathan Chancellor <nathan@...nel.org>

> ---
> 
>  scripts/clang-tools/gen_compile_commands.py | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py
> index e4fb686dfaa9..96e6e46ad1a7 100755
> --- a/scripts/clang-tools/gen_compile_commands.py
> +++ b/scripts/clang-tools/gen_compile_commands.py
> @@ -167,10 +167,10 @@ def process_line(root_directory, command_prefix, file_path):
>              root_directory or file_directory.
>      """
>      # The .cmd files are intended to be included directly by Make, so they
> -    # escape the pound sign '#', either as '\#' or '$(pound)' (depending on the
> -    # kernel version). The compile_commands.json file is not interepreted
> -    # by Make, so this code replaces the escaped version with '#'.
> -    prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#')
> +    # escape the pound sign '#' as '$(pound)'. The compile_commands.json file
> +    # is not interepreted by Make, so this code replaces the escaped version
> +    # with '#'.
> +    prefix = command_prefix.replace('$(pound)', '#')
>  
>      # Return the canonical path, eliminating any symbolic links encountered in the path.
>      abs_path = os.path.realpath(os.path.join(root_directory, file_path))
> -- 
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ