From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BC8812035689B for ; Wed, 22 Nov 2017 00:40:58 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76CFD4A700; Wed, 22 Nov 2017 08:45:13 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-45.rdu2.redhat.com [10.10.120.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF74860600; Wed, 22 Nov 2017 08:45:12 +0000 (UTC) To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Leif Lindholm References: <20171117160913.17292-1-ard.biesheuvel@linaro.org> <20171117160913.17292-14-ard.biesheuvel@linaro.org> <0795247f-2296-e486-50f5-0ba4caaa150b@redhat.com> <4D4989D0-DC49-40D2-A20A-9B14A0973BA4@linaro.org> <4e079219-e2e1-20b1-6772-97249925a4bf@redhat.com> From: Laszlo Ersek Message-ID: <90052652-bba8-a83c-dba5-6a1ff22bfed5@redhat.com> Date: Wed, 22 Nov 2017 09:45:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 22 Nov 2017 08:45:13 +0000 (UTC) Subject: Re: [PATCH 13/15] ArmVirtPkg: implement ArmVirtMemInfo PPI, PEIM and library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 08:40:58 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/21/17 21:32, Ard Biesheuvel wrote: > On 21 November 2017 at 20:17, Laszlo Ersek > wrote: >> On 11/21/17 18:57, Ard Biesheuvel wrote: >>> So how do you propose i go about creating two versions of >>> QemuVirtMemInfoLib, only one of which has a constructor? Share >>> the .c file between two infs in the same directory? >> >> Hm, I think I missed the impact on ArmVirtQemuKernel. In the >> current set, its DSC file is only modified in patch 12. (I missed >> that too.) Are any changes necessary for ArmVirtQemuKernel that are >> not contained in this set? >> >> Either way, what you propose above seems to be the standard >> approach to me: use two INF files, keep the bulk of the code in one >> (shared) C file, and add the constructor to another (non-shared) C >> file (i.e., referenced by only one of the INF files). Should the >> constructor need shared utility functions from the shared C file, >> add an internal header for those. >> > > Would you object to having a single .c file, but only declare the > constructor in one of the two .INFs? The code will be pruned anyway, > due to our use of -ffunction-sections > I would frown, but not object. :) Please add a comment above the constructor function about the non-shared use. Thanks, Laszlo