From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mx.groups.io with SMTP id smtpd.web10.141961.1680727265937694036 for ; Wed, 05 Apr 2023 13:41:06 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm3 header.b=FlhCNjqt; spf=pass (domain: bsdio.com, ip: 66.111.4.27, mailfrom: rebecca@bsdio.com) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2F0D95C006C; Wed, 5 Apr 2023 16:41:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 05 Apr 2023 16:41:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:reply-to:sender:subject:subject:to:to; s= fm3; t=1680727265; x=1680813665; bh=MY+zMN4K+C03z+PAZRkKnbFtFPa+ eCVO2nLhG4JkKQQ=; b=FlhCNjqtSG6z/+QUsOKns6xQ9suDNT2ymRbOG4VgHRr4 6Jtt3+5JnrrX8FQaN5Wm9LefKYkDJ3m4dArsdOD8KQc4hPXaqQK0Zu9VaYYYZqzg 69DngIzXkP07oL01efI2R03rYHvr0vKNIqdp/WDzusBr4s+49lDAmLu77jOyeUdJ wr53jKO49vT7OEtyUm9hi0XGO6/N2ikVGMhT8tXLfL2hvfCw45vXCX6veBVtSFT1 y0ET4GNA4yqFlJpNvMAtqzwJjq7I7r0H/z2r4KQozBwluOSw3BlKVSDa3PkmnR7M mQBw5CVEawYbAA8i5HRk00gcArlSgLDoXnvVQtTXbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1680727265; x=1680813665; bh=MY+zMN4K+C03z+PAZRkKnbFtFPa+ eCVO2nLhG4JkKQQ=; b=aoQ3FS25jCLJ0Xa5X8PKKoFVMFY4e4WTm86rW0WU+m+o jJ/x0USkRiXxnHAytn5E3zJnn5h4D7oI5IQevheOGgXYqn3fu9SN8PUcoLVuZmpj cbA205Rj0x+kN21NzhLzsSeE1ZAdytRfq+RhlASMft2cukyXdx5CqpiWl58ZlJO5 bjsYEXUFpJC1guRXv1Q52dLic0rCcUiTwEBsqIVWhutXt5E5BZ7fb9Wm94Xqzqsy 2NDYyPK2SItJ4K35ugHuOhzvVaFQ9FojKEUyiL810T2vrro1eg0RdA/X2DQS2afn eO57YY7Y/b+LnPCSwuJ9dVNdxymH23VyQ2VW0x7x3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejuddgudehgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffhvfevrhhfjggtgf esthekredttdefjeenucfhrhhomheptfgvsggvtggtrgcuvehrrghnuceorhgvsggvtggt rgessghsughiohdrtghomheqnecuggftrfgrthhtvghrnhepvefggefguedttdeifefhue egieejtdeludefleefieekjeegleejhfejueetfeegnecuffhomhgrihhnpehgihhthhhu sgdrtghomhdpthhirghnohgtohhrvgdrohhrghdpghhrohhuphhsrdhiohenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrvggsvggttggrsegs shguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Apr 2023 16:41:03 -0400 (EDT) Message-ID: <438e0fb3-fae6-4e0b-9e11-783f786d6636@bsdio.com> Date: Wed, 5 Apr 2023 14:41:02 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools/Conf/tools_def: Fix linking using CLANGDWARF_IA32 From: "Rebecca Cran" To: devel@edk2.groups.io, patrick.rudolph@9elements.com Cc: gaoliming@byosoft.com.cn, bob.c.feng@intel.com, yuwei.chen@intel.com, gua.guo@intel.com, james.lu@intel.co, ardb@kernel.org Reply-To: devel@edk2.groups.io, rebecca@bsdio.com References: <20230330094803.978890-1-patrick.rudolph@9elements.com> <1753195A0E9C6D3F.3578@groups.io> In-Reply-To: <1753195A0E9C6D3F.3578@groups.io> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Pushed as https://github.com/tianocore/edk2/commit/2bb693894920e634153275bea60278a9f192a8ef -- Rebecca Cran On 4/5/23 11:15 AM, Rebecca Cran wrote: > Reviewed-by: Rebecca Cran > > > On 3/30/23 3:48 AM, Patrick Rudolph wrote: >> The clang toolchain might default to fPIE/fPIC, which prevents >> lld from linking the objects into a binary. >> >> Specify -fno-pie -fno-pic as done on GCC to fix linking. >> >> Test: >> Building the Universal Payload using the command >> 'python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32' actually >> works. >> >> Signed-off-by: Patrick Rudolph >> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4356 >> --- >>   BaseTools/Conf/tools_def.template | 14 +++++++------- >>   1 file changed, 7 insertions(+), 7 deletions(-) >> >> diff --git a/BaseTools/Conf/tools_def.template >> b/BaseTools/Conf/tools_def.template >> index 471eb67c0c..9b59bd75c3 100755 >> --- a/BaseTools/Conf/tools_def.template >> +++ b/BaseTools/Conf/tools_def.template >> @@ -2888,7 +2888,7 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS = >> -Wl,--defsym=PECOFF_HEADER_SIZE=0x22 >>   *_CLANGDWARF_IA32_RC_PATH              = >> DEF(CLANGDWARF_IA32_PREFIX)llvm-rc >>     *_CLANGDWARF_IA32_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS) >> -m32 -fno-lto DEF(CLANG38_IA32_TARGET) >> -*_CLANGDWARF_IA32_ASLDLINK_FLAGS       = >> DEF(CLANGDWARF_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 -fuse-ld=lld >> +*_CLANGDWARF_IA32_ASLDLINK_FLAGS       = >> DEF(CLANGDWARF_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386 -fuse-ld=lld >> -no-pie >>   *_CLANGDWARF_IA32_ASM_FLAGS            = DEF(GCC5_ASM_FLAGS) -m32 >> -march=i386 DEF(CLANG38_IA32_TARGET) >>   *_CLANGDWARF_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS) >>   *_CLANGDWARF_IA32_OBJCOPY_FLAGS        = >> @@ -2897,17 +2897,17 @@ DEFINE CLANGDWARF_X64_DLINK2_FLAGS        = >> -Wl,--defsym=PECOFF_HEADER_SIZE=0x22 >>   *_CLANGDWARF_IA32_ASLPP_FLAGS          = DEF(GCC_ASLPP_FLAGS) >> DEF(CLANG38_IA32_TARGET) >>   *_CLANGDWARF_IA32_VFRPP_FLAGS          = DEF(GCC_VFRPP_FLAGS) >> DEF(CLANG38_IA32_TARGET) >>   -DEBUG_CLANGDWARF_IA32_CC_FLAGS         = DEF(CLANG38_ALL_CC_FLAGS) >> -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) -g -malign-double >> +DEBUG_CLANGDWARF_IA32_CC_FLAGS         = DEF(CLANG38_ALL_CC_FLAGS) >> -fno-pic -fno-pie -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) >> -g -malign-double >>   DEBUG_CLANGDWARF_IA32_DLINK_FLAGS      = >> DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 -Wl,-melf_i386 >> -Wl,--oformat,elf32-i386 >> -DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS     = >> DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld >> +DEBUG_CLANGDWARF_IA32_DLINK2_FLAGS     = >> DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld -no-pie >>   -RELEASE_CLANGDWARF_IA32_CC_FLAGS       = DEF(CLANG38_ALL_CC_FLAGS) >> -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) -malign-double >> +RELEASE_CLANGDWARF_IA32_CC_FLAGS       = DEF(CLANG38_ALL_CC_FLAGS) >> -fno-pic -fno-pie -m32 -Oz -flto -march=i586 DEF(CLANG38_IA32_TARGET) >> -malign-double >>   RELEASE_CLANGDWARF_IA32_DLINK_FLAGS    = >> DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -flto -Wl,-O3 -Wl,-melf_i386 >> -Wl,--oformat,elf32-i386 >> -RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS   = >> DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld >> +RELEASE_CLANGDWARF_IA32_DLINK2_FLAGS   = >> DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O3 -fuse-ld=lld -no-pie >>   -NOOPT_CLANGDWARF_IA32_CC_FLAGS         = DEF(CLANG38_ALL_CC_FLAGS) >> -m32 -O0 -march=i586 DEF(CLANG38_IA32_TARGET) -g -malign-double >> +NOOPT_CLANGDWARF_IA32_CC_FLAGS         = DEF(CLANG38_ALL_CC_FLAGS) >> -fno-pic -fno-pie -m32 -O0 -march=i586 DEF(CLANG38_IA32_TARGET) -g >> -malign-double >>   NOOPT_CLANGDWARF_IA32_DLINK_FLAGS      = >> DEF(CLANGDWARF_IA32_X64_DLINK_FLAGS) -Wl,-O0 -Wl,-melf_i386 >> -Wl,--oformat,elf32-i386 >> -NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS     = >> DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O0 -fuse-ld=lld >> +NOOPT_CLANGDWARF_IA32_DLINK2_FLAGS     = >> DEF(CLANGDWARF_IA32_DLINK2_FLAGS) -O0 -fuse-ld=lld -no-pie >>     ########################## >>   # CLANGDWARF X64 definitions > > > > >