From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=L7CEy5k9; spf=pass (domain: linaro.org, ip: 209.85.221.68, mailfrom: leif.lindholm@linaro.org) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by groups.io with SMTP; Wed, 08 May 2019 05:08:27 -0700 Received: by mail-wr1-f68.google.com with SMTP id f7so16562269wrq.1 for ; Wed, 08 May 2019 05:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bEge7ISA14DIlNWZAG5McsKN2BNlLDeRa22kiO0OsyU=; b=L7CEy5k9mz09yBNBv2GwR2BvISB5KegXzjyUQc5ZaDkbob95b74vvMjFrfxspp3eKN sVM9lrxP7+zpzZS3mFnlpTZAB9wszXhzLvEc2ADrlr51TItOMpK1NyPN/NBwphuV7hLX YodcoE5xlxCsINsoitJhRk8mEqBQ3hqzBx5zmBlvBSu8EYRcrKMUhYwWNs75FP8mT0N/ onuUpqYf3OzEh6aWH0iVJRL+Qy9pPntxgBgn2xrrMFB20n0to1HdE2gsL4B3KeC5L2mC YCAk4Y1A+gC79kWxAr+GrBPi402NU2naGEYtaeB1BmEVqI2sdi8M6muKU9HGaj5MR6Gs 3n/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bEge7ISA14DIlNWZAG5McsKN2BNlLDeRa22kiO0OsyU=; b=fHmfeYAzETIX869u1zxsXNtfguorPCsYjXKKsvVajJFbJX375Zo2XhaBiIGwHwQwqV pYAGYmv716jzZ6YwLYhCU6+xSfgOTndeaDLgxxygXVHcyxceI6P+lx+LNdxN91d0/KpQ dAE2hcuo0HgxAQuh6YV6JBlf0wAlQDewZrtKWyueuhA6iZh5iN3CnShS8VIil6m6NM1k HKXS47E3wTHResmqLusQZcG4xS21TvRszZ8g2DEvIvufGKBfgk/IooIz+6mnIJeQz1u9 DfYmu9vBO1lzuwjHJlJFUxjPZ67pSjGtynVo1OYkrxE5amv2+Mx+7MUDq9Rx25/1PJAS pcXA== X-Gm-Message-State: APjAAAWMx8sXJO6h4rKHytgYkdBtPhFH83KzYshi0jhQknPV3JquzhxV 3BgYma08vI4ITrX5QF8LgJ+Elg== X-Google-Smtp-Source: APXvYqwKli0irFEU+dl+vn4ojC7G31uOYPTptLGlpF2ybUP1PQMoGiEU7jfszrsM1m/JryH+ohQebA== X-Received: by 2002:a5d:4649:: with SMTP id j9mr10494025wrs.64.1557317305373; Wed, 08 May 2019 05:08:25 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id j46sm5610364wre.54.2019.05.08.05.08.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 05:08:24 -0700 (PDT) Date: Wed, 8 May 2019 13:08:23 +0100 From: "Leif Lindholm" To: "Fan, ZhijuX" Cc: Andrew Fish , "devel@edk2.groups.io" , "Gao, Liming" , "Feng, Bob C" , Laszlo Ersek , Michael D Kinney Subject: Re: [edk2-devel] [PATCH V2] BaseTools:improve code to support C files with .C suffixes Message-ID: <20190508120823.urob54m7tojotq7n@bivouac.eciton.net> References: <5C1A24BA-648D-4A3F-AE88-034073AB5C13@apple.com> <20190507144002.gq3rdtappd3rupmd@bivouac.eciton.net> <55FC6AA1-43B5-4557-8A17-0E3B00E3EE9A@apple.com> <20190508090926.4r4e6jqlg45yg6yp@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Fan Zhiju, I understand your reasoning, but that strengthens my view that we should leave this change out. Actually, could we consider *dropping* support for .C files altogether, since we are striving to support multiple toolchains, and the two major families of toolchains we use consider .C files to be fundamentally different things? Andrew, Laszlo, Mike? Best Regards, Leif On Wed, May 08, 2019 at 10:57:09AM +0000, Fan, ZhijuX wrote: > Hi Leif, > > This patch is going to fix the bug in commit 05217d210e. > this patch and commit 05217d210e is just for MSVC. It doesn't have any effect on GCC. > this patch does not imply to compile .C as C instead of C++. > We just found out that they build break because the.C file was in the source file, > But the MSVC compiler allows.C files,So I fixed this bug to Change the original logic to support.C files. > > > Any question, please let me know. Thanks. > > Best Regards > Fan Zhiju > > > > > > -----Original Message----- > > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > > Sent: Wednesday, May 8, 2019 5:09 PM > > To: Andrew Fish > > Cc: devel@edk2.groups.io; Fan, ZhijuX ; Gao, Liming > > ; Feng, Bob C > > Subject: Re: [edk2-devel] [PATCH V2] BaseTools:improve code to support C > > files with .C suffixes > > > > On Tue, May 07, 2019 at 07:01:26PM -0700, Andrew Fish wrote: > > > > > > > > > > On May 7, 2019, at 7:40 AM, Leif Lindholm > > wrote: > > > > > > > > Hi Fan Zhiju, > > > > > > > > But where does the string come from that contains a .C suffix? > > > > Is the tool internally converting things to uppercase, or is some > > > > source file in the build incorrectly named? > > > > > > > > > > Leif, > > > > > > Our build system defines .C as correct! I think it has been that way a very > > long time. > > > > .C is valid, but at least for GCC it is equivalent to all of the other non-.c > > options - i.e., interpret as c++. Which is why I am wondering about the case > > that ends up with the build system internally processing this. > > > > If it is changed to permitting .C files to be compiled as C instead of > > C++ (which the patch seems to imply), that sounds incorrect to me. > > > > / > > Leif > > > > > > > https://github.com/tianocore/edk2/blob/master/BaseTools/Conf/build_rul > > > e.template#L109 > > > > > > [C-Code-File] > > > > > > ?.c > > > ?.C > > > ?.cc > > > ?.CC > > > ?.cpp > > > ?.Cpp > > > ?.CPP > > > > > > Thanks, > > > > > > Andrew Fish > > > > > > > > > > I am asking because it is not clear to me whether the patch resolves > > > > a problem or hides one. > > > > > > > > Best Regards, > > > > > > > > Leif > > > > > > > > On Tue, May 07, 2019 at 03:05:02AM +0000, Fan, ZhijuX wrote: > > > >> This problem has nothing to do with the file system, We just use > > > >> the filename as a string to compare with other strings Our unittest > > > >> tested minplatform, Ovmf. This problem was found when building a > > > >> platform inside Intel. > > > >> We've tested it on Linux and Windows. > > > >> > > > >> Any question, please let me know. Thanks. > > > >> > > > >> Best Regards > > > >> Fan Zhiju > > > >> > > > >> -----Original Message----- > > > >> From: afish@apple.com [mailto:afish@apple.com] > > > >> Sent: Tuesday, May 7, 2019 10:31 AM > > > >> To: devel@edk2.groups.io; Fan, ZhijuX > > > >> Cc: Gao, Liming ; Feng, Bob C > > > >> > > > >> Subject: Re: [edk2-devel] [PATCH V2] BaseTools:improve code to > > > >> support C files with .C suffixes > > > >> > > > >> This brings up a question? Do we tests on a file system that is case > > sensitive? Is this just lack of a test case? > > > >> > > > >> Thanks, > > > >> > > > >> Andrew Fish > > > >> > > > >>> On May 6, 2019, at 7:22 PM, Fan, ZhijuX wrote: > > > >>> > > > >>> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1773 > > > >>> > > > >>> Build break if C file suffixes of named .C instead of .c Code not > > > >>> recognize filenames with .C suffixes. > > > >>> > > > >>> This patch adds code to Support both .c file and .C file > > > >>> > > > >>> Cc: Bob Feng > > > >>> Cc: Liming Gao > > > >>> Signed-off-by: Zhiju.Fan > > > >>> --- > > > >>> BaseTools/Source/Python/AutoGen/GenMake.py | 3 ++- > > > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > > > >>> > > > >>> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > > > >>> b/BaseTools/Source/Python/AutoGen/GenMake.py > > > >>> index 0e0f9fd9b0..858ddedf8e 100644 > > > >>> --- a/BaseTools/Source/Python/AutoGen/GenMake.py > > > >>> +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > > > >>> @@ -1035,7 +1035,8 @@ cleanlib: > > > >>> CmdTargetDict[CmdSign] = "%s %s" % > > (CmdTargetDict[CmdSign], SingleCommandList[-1]) > > > >>> Index = CommandList.index(Item) > > > >>> CommandList.pop(Index) > > > >>> - if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, > > CmdSumDict[CmdSign.lstrip('/Fo').rsplit(TAB_SLASH, 1)[0]])): > > > >>> + if SingleCommandList[-1].endswith("%s%s.c" % > > (TAB_SLASH, CmdSumDict[T.Target.SubDir])) or \ > > > >>> + SingleCommandList[-1].endswith("%s%s.C" % > > (TAB_SLASH, CmdSumDict[T.Target.SubDir])): > > > >>> Cpplist = CmdCppDict[T.Target.SubDir] > > > >>> Cpplist.insert(0, '$(OBJLIST_%d): $(COMMON_DEPS)' % > > list(self.ObjTargetDict.keys()).index(T.Target.SubDir)) > > > >>> T.Commands[Index] = '%s\n\t%s' % (' > > > >>> \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign]) > > > >>> -- > > > >>> 2.14.1.windows.1 > > > >>> > > > >>> > > > >>> > > > >>> > > > >>> > > > >> > > > >> > > > >> > > > >> > > > > > > > > > > >