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 5EC0A2034A893 for ; Wed, 8 Nov 2017 06:49:50 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 934BE72D0F; Wed, 8 Nov 2017 14:53:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 934BE72D0F Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-142.rdu2.redhat.com [10.10.120.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id B639E5D9CA; Wed, 8 Nov 2017 14:53:49 +0000 (UTC) To: Heyi Guo , "edk2-devel@lists.01.org" Cc: "Gao, Liming" References: <145387dc-028f-c75f-6df3-cb0ead996eb8@linaro.org> From: Laszlo Ersek Message-ID: <328f6c59-f41a-1b53-621c-a8ac000dcb45@redhat.com> Date: Wed, 8 Nov 2017 15:53:48 +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: <145387dc-028f-c75f-6df3-cb0ead996eb8@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 08 Nov 2017 14:53:50 +0000 (UTC) Subject: Re: Why do we use -g option of gcc even for RELEASE build? 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, 08 Nov 2017 14:49:50 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/08/17 03:25, Heyi Guo wrote: > Hi folks, > > From gcc manual, -g option seems to produce debugging information. In > tools_def.template, -g is included in GCC_ALL_CC_FLAGS, so it will also > be enabled for RELEASE build with gcc tool chain. Any special reason to > do that? In the edk2 tree, -g was added to GCC_ALL_CC_FLAGS and GCC44_ALL_CC_FLAGS in commit 52302d4dee58 ("Sync EDKII BaseTools to BaseTools project r1903.", 2010-02-28). If you check the history of the now-historical separate BaseTools project , "-g" was introduced in commit 46c1e64305d4 ("Upgrade the binutil 2.18.50.0.5 to 2.20.51.0.5 for UNIXGCC tool chain", 2010-02-25). I guess that the same for [Dynamic-Library-File] must be able to work for both DEBUG/NOOPT and RELEASE builds. So -g is included for all of those build targets, in the C flags. Ultimately the debug symbols are not copied into the .efi binaries, for RELEASE, I believe. Thanks Laszlo