From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mx.groups.io with SMTP id smtpd.web10.2865.1660960318665134298 for ; Fri, 19 Aug 2022 18:51:59 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm2 header.b=eZY2zUBD; spf=pass (domain: bsdio.com, ip: 66.111.4.26, mailfrom: rebecca@bsdio.com) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F059E5C01E4; Fri, 19 Aug 2022 21:51:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Aug 2022 21:51:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1660960317; x=1661046717; bh=K4LIUEB7oB a7JYXPl8zcpo3PL9z2Mmj+7TGt0lVf2Ig=; b=eZY2zUBDe41Hswo0YY0F4OPMF3 mhQ52W585SUofSSeGQsjk9/p+rIWLzQ3IxZciY/Kw7bVz/4GfyNvUJc/9a6Y4vFy gyF2yeiO7epvuOTXwfmWa1gpPn8T17sMK9Iigudgm1tvaLc+54Bm8Mf3rDfRqweQ baRGnk+TBLtf23+h7lldF2peglcAukmjqeQRlnyQCilpR2IBlLwRzEet/E3K6wbk p2dctCWSHHXkyg+rauwqC/EbDJz21p0NWWDGdpZHNA1ML6ZrWJiFkmVTc7dMcnjw 4nBe0BovTUYVTU5ABLWWRpJoQrGEayDJ/t4gDfe/BBz+bGF+D9Bw9wJFOcpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660960317; x=1661046717; bh=K4LIUEB7oBa7JYXPl8zcpo3PL9z2 Mmj+7TGt0lVf2Ig=; b=zCL6nhxMVmnEQeymV5aVKUYR+ucPtuUNmZG1DL+nPOPB poVsIFcDIoi1chE/RXR9f+gAfKjHSfuUnhfyquq/zjGMOIUlRxYiwWWMiCPTraBI 7cUENPQwh2gjQEJ6nHl8Bm+GWYFuP3CjyxTCSO9ATptWDnyQr66raKcISGTbd2/X ZkWZM8IIn0/oYp7VX16SpR2OX90gszxwRUIOy1bhi0L6DK+H4VDwZLTBjuqCpbdL pjjN5PXxvM+i4GdN///ulGUsZKmloXJh9y2AURf//z1RFJQ8wbElL4oY/ht1kHRF LiRRwWkLEGSr5nuDfViAEEu5Sz/Q7vWys5lT1sVA1A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeivddghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesrgdtreertdefjeenucfhrhhomheptfgvsggv tggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrfgrth htvghrnhepkeffhefhtefhgfdthfdujeeggfdujeekgedthfejueduudegffevfeffkedu hffhnecuffhomhgrihhnpehgrhhouhhpshdrihhonecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprhgvsggvtggtrgessghsughiohdrtghomh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Aug 2022 21:51:56 -0400 (EDT) Message-ID: <7c9dad7d-a229-cfb2-6a19-e63178713f72@bsdio.com> Date: Fri, 19 Aug 2022 19:51:55 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [edk2-devel] Problems building some Arm platforms (__stack_chk_guard/__stack_chk_fail, _GLOBAL_OFFSET_TABLE_) To: Pedro Falcato , edk2-devel-groups-io Cc: "Kinney, Michael D" , Leif Lindholm , Ard Biesheuvel , =?UTF-8?Q?Marvin_H=c3=a4user?= References: <170CE325F85990DA.4359@groups.io> <5cd26f56-65c2-7994-04fa-1721fe9b1514@bsdio.com> From: "Rebecca Cran" In-Reply-To: Content-Type: multipart/alternative; boundary="------------aocg1Vf4q4fquDmCMj1SKMML" Content-Language: en-US --------------aocg1Vf4q4fquDmCMj1SKMML Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit I'm using gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) on Ubuntu 20.04.4, from the Ubuntu repo. I'm building it with: export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi export WORKSPACE=$PWD export GCC5_AARCH64_PREFIX=aarch64-linux-gnu- . ./edk2/edksetup.sh build -p ./Features/Ext4Pkg/Ext4Pkg.dsc -a AARCH64 -b RELEASE -t GCC5 Some of the messages are: "aarch64-linux-gnu-gcc" -o /home/bcran/src/beaglebone/Build/Ext4Pkg/RELEASE_GCC5/AARCH64/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe/DEBUG/Ext4Dxe.dll -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u _ModuleEntryPoint -Wl,-e,_ModuleEntryPoint,-Map,/home/bcran/src/beaglebone/Build/Ext4Pkg/RELEASE_GCC5/AARCH64/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe/DEBUG/Ext4Dxe.map -z common-page-size=0x20 -z common-page-size=0x1000 -flto -Os -L/home/bcran/src/beaglebone/edk2/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch -Wl,--start-group,@/home/bcran/src/beaglebone/Build/Ext4Pkg/RELEASE_GCC5/AARCH64/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe/OUTPUT/static_library_files.lst,--end-group -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=Ext4DxeStrings -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 -mcmodel=small -flto -Wno-unused-but-set-variable -Wno-unused-const-variable -D DISABLE_NEW_DEPRECATED_INTERFACES -Wl,--script=/home/bcran/src/beaglebone/edk2/BaseTools/Scripts/GccBase.lds -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 -Wno-error /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /tmp/Ext4Dxe.dll.sETaOX.ltrans0.ltrans.o: in function `InternalAllocatePool.constprop.0': /home/bcran/src/beaglebone/edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:368: undefined reference to `__stack_chk_guard' /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /tmp/Ext4Dxe.dll.sETaOX.ltrans0.ltrans.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `__stack_chk_guard' which may bind externally can not be used when making a shared object; recompile with -fPIC /home/bcran/src/beaglebone/edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:368:(.text.InternalAllocatePool.constprop.0+0xc): dangerous relocation: unsupported relocation /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/bcran/src/beaglebone/edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:368: undefined reference to `__stack_chk_guard' /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/bcran/src/beaglebone/edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:382: undefined reference to `__stack_chk_fail' /usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /tmp/Ext4Dxe.dll.sETaOX.ltrans0.ltrans.o: in function `OrderedCollectionInsert.constprop.0': /home/bcran/src/beaglebone/edk2/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:584: undefined reference to `__stack_chk_guard' -- Rebecca Cran On 8/19/22 18:46, Pedro Falcato wrote: > Hi Rebecca, > > What EDK2 toolchain are you using? And how is your toolchain > configured (or where did you get it from?)? It seems that it's trying > to use the stack protector automatically... > > Thanks, > Pedro > > > On Sat, 20 Aug 2022, 00:40 Rebecca Cran, wrote: > > ./Features/Ext4Pkg/Ext4Pkg.dsc is also failing - with errors about > __stack_chk_guard and __stack_chk_fail. > > > And I get an error from Andy Hayes' email: "Your message couldn't > be delivered to the recipient because you don't have permission to > send to it." > > > -- > Rebecca Cran > > > On 8/19/22 17:35, Rebecca Cran wrote: >> >> I have an armplatbld.sh script that goes through and tries to >> build as many of the Arm (AARCH64 and ARM) platforms in >> edk2-platforms as possible. >> >> I'm think this used to work for these, but I'm getting some >> errors now. >> >> I'm using edk2-platforms 46686eeb7e78efe603badd86f13777d9fb070fb8 >> and edk2 e2ac68a23b4954d5c0399913a1df3dd9fd90315d. >> >> >> Drivers/ASIX/Asix.dsc (fails with undefined references to >> __stack_chk_guard and __stack_chk_fail) >> >> Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkPkg.dsc (fails with >> undefined references to __stack_chk_guard and __stack_chk_fail) >> Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc (fails with >> bad definition for symbol '_GLOBAL_OFFSET_TABLE_'@0x72d8 or >> unsupported symbol type.  For example, absolute and undefined >> symbols are not supported.) >> >> Drivers/StandaloneMmCpu/StandaloneMmCpu (fails with undefined >> references to __stack_chk_guard and __stack_chk_fail) >> Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc(fails >> with bad definition for symbol '_GLOBAL_OFFSET_TABLE_'@0x72d8 or >> unsupported symbol type.  For example, absolute and undefined >> symbols are not supported.) >> >> >> -- >> Rebecca Cran >> >> > --------------aocg1Vf4q4fquDmCMj1SKMML Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

I'm using gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) on Ubuntu 20.04.4, from the Ubuntu repo.

I'm building it with:


export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi
export WORKSPACE=$PWD
export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-

. ./edk2/edksetup.sh
build -p ./Features/Ext4Pkg/Ext4Pkg.dsc -a AARCH64 -b RELEASE -t GCC5


Some of the messages are:


"aarch64-linux-gnu-gcc" -o /home/bcran/src/beaglebone/Build/Ext4Pkg/RELEASE_GCC5/AARCH64/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe/DEBUG/Ext4Dxe.dll -Wl,--emit-relocs -nostdlib -Wl,--gc-sections -u _ModuleEntryPoint -Wl,-e,_ModuleEntryPoint,-Map,/home/bcran/src/beaglebone/Build/Ext4Pkg/RELEASE_GCC5/AARCH64/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe/DEBUG/Ext4Dxe.map -z common-page-size=0x20 -z common-page-size=0x1000 -flto -Os -L/home/bcran/src/beaglebone/edk2/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -Wno-lto-type-mismatch -Wl,--start-group,@/home/bcran/src/beaglebone/Build/Ext4Pkg/RELEASE_GCC5/AARCH64/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe/OUTPUT/static_library_files.lst,--end-group   -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=Ext4DxeStrings -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-pic -fno-pie -ffixed-x18 -mcmodel=small -flto -Wno-unused-but-set-variable -Wno-unused-const-variable -D DISABLE_NEW_DEPRECATED_INTERFACES -Wl,--script=/home/bcran/src/beaglebone/edk2/BaseTools/Scripts/GccBase.lds -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 -Wno-error
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /tmp/Ext4Dxe.dll.sETaOX.ltrans0.ltrans.o: in function `InternalAllocatePool.constprop.0':
/home/bcran/src/beaglebone/edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:368: undefined reference to `__stack_chk_guard'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /tmp/Ext4Dxe.dll.sETaOX.ltrans0.ltrans.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `__stack_chk_guard' which may bind externally can not be used when making a shared object; recompile with -fPIC
/home/bcran/src/beaglebone/edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:368:(.text.InternalAllocatePool.constprop.0+0xc): dangerous relocation: unsupported relocation
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/bcran/src/beaglebone/edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:368: undefined reference to `__stack_chk_guard'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /home/bcran/src/beaglebone/edk2/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:382: undefined reference to `__stack_chk_fail'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /tmp/Ext4Dxe.dll.sETaOX.ltrans0.ltrans.o: in function `OrderedCollectionInsert.constprop.0':
/home/bcran/src/beaglebone/edk2/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c:584: undefined reference to `__stack_chk_guard'

--
Rebecca Cran


On 8/19/22 18:46, Pedro Falcato wrote:
Hi Rebecca,

What EDK2 toolchain are you using? And how is your toolchain configured (or where did you get it from?)? It seems that it's trying to use the stack protector automatically...

Thanks,
Pedro


On Sat, 20 Aug 2022, 00:40 Rebecca Cran, <rebecca@bsdio.com> wrote:

./Features/Ext4Pkg/Ext4Pkg.dsc is also failing - with errors about __stack_chk_guard and __stack_chk_fail.


And I get an error from Andy Hayes' email: "Your message couldn't be delivered to the recipient because you don't have permission to send to it."


--
Rebecca Cran


On 8/19/22 17:35, Rebecca Cran wrote:

I have an armplatbld.sh script that goes through and tries to build as many of the Arm (AARCH64 and ARM) platforms in edk2-platforms as possible.

I'm think this used to work for these, but I'm getting some errors now.

I'm using edk2-platforms 46686eeb7e78efe603badd86f13777d9fb070fb8 and edk2 e2ac68a23b4954d5c0399913a1df3dd9fd90315d.


Drivers/ASIX/Asix.dsc (fails with undefined references to __stack_chk_guard and __stack_chk_fail)

Drivers/DisplayLink/DisplayLinkPkg/DisplayLinkPkg.dsc (fails with undefined references to __stack_chk_guard and __stack_chk_fail)
Platform/Socionext/DeveloperBox/DeveloperBoxMm.dsc (fails with bad definition for symbol '_GLOBAL_OFFSET_TABLE_'@0x72d8 or unsupported symbol type.  For example, absolute and undefined symbols are not supported.)

Drivers/StandaloneMmCpu/StandaloneMmCpu (fails with undefined references to __stack_chk_guard and __stack_chk_fail)
Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc (fails with bad definition for symbol '_GLOBAL_OFFSET_TABLE_'@0x72d8 or unsupported symbol type.  For example, absolute and undefined symbols are not supported.)


--
Rebecca Cran

--------------aocg1Vf4q4fquDmCMj1SKMML--