This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Mon Apr 29 12:21:36 2024 >From spaans Wed Aug 6 17:06:58 2014 Original-Recipient: rfc822;jasper@telfort.nl Received: from pop3.telfort.nl [213.75.3.52] by squeeze.vs19.net with POP3 (fetchmail-6.3.21) for (single-drop); Wed, 06 Aug 2014 17:06:58 +0200 (CEST) Received: from cpxmta-msg07.kpnxchange.com (10.94.114.28) by cpxmbs-msg01.support.local (8.6.060.31) id 53D1ABF9007C57A4 for jasper@telfort.nl; Wed, 6 Aug 2014 17:02:14 +0200 Received: from cpsmtpb-ews02.kpnxchange.com (213.75.39.5) by cpxmta-msg07.kpnxchange.com (8.6.060.14) id 53B3603003EE0E84 for jasper@telfort.nl; Wed, 6 Aug 2014 17:02:14 +0200 Received: from cpsps-ews14.kpnxchange.com ([10.94.84.181]) by cpsmtpb-ews02.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Wed, 6 Aug 2014 17:02:13 +0200 Received: from vger.kernel.org ([209.132.180.67]) by cpsps-ews14.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Wed, 6 Aug 2014 17:02:13 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755564AbaHFPCD (ORCPT ); Wed, 6 Aug 2014 11:02:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:43511 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753558AbaHFPCB (ORCPT ); Wed, 6 Aug 2014 11:02:01 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 39744AB08; Wed, 6 Aug 2014 15:01:58 +0000 (UTC) Message-Id: <53E24365.6020405@suse.cz> Date: Wed, 06 Aug 2014 17:01:57 +0200 From: Michal Marek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 Mime-Version: 1.0 To: Konstantin Khlebnikov Cc: Linux Kernel Mailing List , linux-kbuild , Sascha Hauer , "x86@kernel.org" , Andrew Morton Subject: Re: [PATCH] kbuild: escape single backslashes in macro make-cmd References: <20140726163551.19857.17737.stgit@zurg> <53E2156E.9060700@suse.cz> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-Id: X-Mailing-List: linux-kernel@vger.kernel.org X-OriginalArrivalTime: 06 Aug 2014 15:02:13.0920 (UTC) FILETIME=[67EB2A00:01CFB187] X-RcptDomain: telfort.nl On 2014-08-06 14:19, Konstantin Khlebnikov wrote: > On Wed, Aug 6, 2014 at 3:45 PM, Michal Marek wrote: >> On 2014-07-26 18:35, Konstantin Khlebnikov wrote: >>> This already has been fixed in commit c353acba28fb3fa1fd05fd >>> ("kbuild: make: fix if_changed when command contains backslashes") >>> but escaping still isn't perfect and triggers false-positive rebuilds. >>> >>> For x86 problem happens every time, because rules in arch/x86/realmode/rm/ >>> and arch/x86/boot/ contains commands like sed -n -e 's/foo\(.*\)/\1/p'. >>> Backslash in \1 isn't escaped and turns into ascii symbol with code 1. >>> Macro if_changed detects command change and rebuilds target again and again. >>> >>> Backslash escaping conflicts with other passes because it's used for escaping >>> other symbols. To avoid that current macro handles only double backslashes. >>> Obviously this doesn't work for \1 like above. >>> >>> This patch reorders passes. It doubles all backslashes before escaping # and ' >>> >>> Visible effect in rebuilding x86/defconfig without changes, before patch: >>> >>> blind@zurg:~/src/linux$ make V=2 >>> CHK include/config/kernel.release >>> CHK include/generated/uapi/linux/version.h >>> CHK include/generated/utsrelease.h >>> CALL scripts/checksyscalls.sh - due to target missing >>> CHK include/generated/compile.h >>> PASYMS arch/x86/realmode/rm/pasyms.h - due to command line change >> >> With which make and shell version are you seeing this? While the patch >> looks correct, I can't reproduce the error here: > > /bin/sh points to dash (debian default setup). > > I cannot reproduce this using bash. That explains why this bug is still here. So the difference between the shells is that their 'echo' builtin treats \ differently: $ ./dash -c "echo '\2'"  $ ./dash -c "echo '\2'" | xxd 0000000: 020a .. $ /bin/bash -c "echo '\2'" \2 For some reason we fail to escape the \ and dash treats \2 as \02. POSIX says that this is implementation-defined, so none of the shells is wrong. I need to look into this a bit further. I'll most likely end up applying your patch, but I'd like to understand the fix in detail first. Thanks, Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/