From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web11.5312.1580817735506658600 for ; Tue, 04 Feb 2020 04:02:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iO1g1olX; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580817734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KZg9C2H4vrpTpB62Dte7ooeRJnmb9b9Pl1EH60f+Rr4=; b=iO1g1olXSGJvKjhCQ1Wsuslz2hGDu8c9AIu+tTJJnBPrwJwSLl1O1br4R6YhezGnFgn+b+ iZqDQBt/oZWJ9rIMMut02rG2afIUeHIsfPLQCE82xCegWqSOX977Mu2ff06nh/Z6ebKpPW fZ8jsRc2G3RzThzQd6Pnf+UolcfGpz8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18--loAFCn1MAewB2no92Z_dw-1; Tue, 04 Feb 2020 07:02:04 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B0BF18A8C89; Tue, 4 Feb 2020 12:02:03 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.36.118.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3060A60BE0; Tue, 4 Feb 2020 12:02:01 +0000 (UTC) Subject: Re: [edk2-devel] [Patch] BaseTools tools_def.template: Add back -fno-pie option in GCC49 tool chain To: devel@edk2.groups.io, liming.gao@intel.com Cc: Bob Feng , Ard Biesheuvel References: <20200204045456.241-1-liming.gao@intel.com> From: "Laszlo Ersek" Message-ID: <9cfe929c-0448-d7d2-2ce1-cd491ce16083@redhat.com> Date: Tue, 4 Feb 2020 13:02:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200204045456.241-1-liming.gao@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: -loAFCn1MAewB2no92Z_dw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit (+Ard) On 02/04/20 05:54, Liming Gao wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2502 > This option is required to make GCC49 tool chain work with the high > version GCC compiler. > > Cc: Bob Feng > Signed-off-by: Liming Gao > --- > BaseTools/Conf/tools_def.template | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template > index feee2bbf16..d02424ae44 100755 > --- a/BaseTools/Conf/tools_def.template > +++ b/BaseTools/Conf/tools_def.template > @@ -1974,7 +1974,7 @@ DEFINE GCC48_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_ASLDLINK_FLAGS) -Wl,--oformat > DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_ASLDLINK_FLAGS) > DEFINE GCC48_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) > > -DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) > +DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -fno-pic -fno-pie > DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) > DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 > DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable > @@ -1997,7 +1997,7 @@ DEFINE GCC49_ARM_ASLDLINK_FLAGS = DEF(GCC48_ARM_ASLDLINK_FLAGS) > DEFINE GCC49_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS) > DEFINE GCC49_ASLCC_FLAGS = DEF(GCC48_ASLCC_FLAGS) > > -DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -fno-pic -fno-pie > +DEFINE GCC5_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) > DEFINE GCC5_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) > DEFINE GCC5_IA32_X64_DLINK_COMMON = DEF(GCC49_IA32_X64_DLINK_COMMON) > DEFINE GCC5_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) > - What has changed relative to commit 11d0cd23dd1b ("BaseTools/tools_def IA32: drop -no-pie linker option for GCC49", 2018-06-18)? - Also, if we are reverting one half of 11d0cd23dd1b (the compiler flags), shouldn't we then revert the other half too (the linker flags)? - The commit message says, "work with the high version GCC compiler". What does that mean? If it is 4.9.x, with x>2, then I agree the patch is justified (because commit 11d0cd23dd1b was apparently made for 4.9.2). But if the phrase stands for gcc8 or so (just an example), then I don't think the patch is a good idea; users of gcc8 can just specify the GCC5 toolchain. Ah, indeed, I need only look at TianoCore#2502: "GCC49 tool chain meets with the build failure when GCC7.4 compiler". So I think this approach is wrong. Unless there is a new gcc-4.9.x release, i.e., after gcc-4.9.2, I think we still need commit 11d0cd23dd1b in place. And, please use GCC5 for gcc-7.4 -- is there a problem with that? Thanks Laszlo