From: "Sami Mujawar" <sami.mujawar@arm.com>
To: <devel@edk2.groups.io>
Cc: Sami Mujawar <sami.mujawar@arm.com>, <ardb+tianocore@kernel.org>,
<mikuback@linux.microsoft.com>, <nathaniel.l.desimone@intel.com>,
<ankit.sinha@intel.com>, <npham@amperecomputing.com>,
<loc.ho@amperecomputing.com>, <jose.marinho@arm.com>,
<Samer.El-Haj-Mahmoud@arm.com>, <Matteo.Carlini@arm.com>,
<Akanksha.Jain2@arm.com>, <Ben.Adderson@arm.com>, <nd@arm.com>
Subject: [PATCH v1 3/5] PrmPkg: Build Prm Samples with GCC for AARCH64
Date: Wed, 3 Aug 2022 15:35:45 +0100 [thread overview]
Message-ID: <20220803143547.27772-4-sami.mujawar@arm.com> (raw)
In-Reply-To: <20220803143547.27772-1-sami.mujawar@arm.com>
From: Jose Marinho <jose.marinho@arm.com>
- Add the --prm flag to the GENFW_FLAGS
- Add the --no-gc-section to the linker flags so that apparently
unreferenced symbols are not prematurely removed from the .dll which
is used to generate the Prm module .efi.
- Force the linker to maintain the PrmModuleExportDescriptor symbol.
- Force the linker to maintain the PRM handler funtion's symbol.
Signed-off-by: Jose Marinho <jose.marinho@arm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---
PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf | 4 ++++
PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf b/PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf
index e8b71a970d83d44485430c2e3dc24e1a80da75c8..04addecc861e643cbb2be07e995708b42059719c 100644
--- a/PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf
+++ b/PrmPkg/Samples/PrmSampleAcpiParameterBufferModule/PrmSampleAcpiParameterBufferModule.inf
@@ -7,6 +7,7 @@
# code at OS runtime.
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -39,3 +40,6 @@ [Depex]
[BuildOptions.common]
MSFT:*_*_*_DLINK_FLAGS = /DLL /SUBSYSTEM:CONSOLE /VERSION:1.0
MSFT:*_*_*_GENFW_FLAGS = --keepoptionalheader
+
+ GCC:*_*_AARCH64_GENFW_FLAGS = --prm
+ GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,--no-gc-sections -Wl,--require-defined=PrmModuleExportDescriptor -Wl,--require-defined=CheckParamBufferPrmHandler
diff --git a/PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf b/PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf
index b97af923c47a70b280d270302aa8a7d058701c92..ff72a233669657c260f284cd2fbc4126077d4426 100644
--- a/PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf
+++ b/PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf
@@ -7,6 +7,7 @@
#
# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -42,3 +43,6 @@ [Depex]
[BuildOptions.common]
MSFT:*_*_*_DLINK_FLAGS = /DLL /SUBSYSTEM:CONSOLE /VERSION:1.0
MSFT:*_*_*_GENFW_FLAGS = --keepoptionalheader
+
+ GCC:*_*_AARCH64_GENFW_FLAGS = --keepoptionalheader --prm
+ GCC:*_*_AARCH64_DLINK_FLAGS = -Wl,--no-gc-sections -Wl,--require-defined=PrmModuleExportDescriptor -Wl,--require-defined=CheckStaticDataBufferPrmHandler
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
next prev parent reply other threads:[~2022-08-03 14:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-03 14:35 [PATCH v1 0/5] Add support to build PRM for AARCH64 using GCC Sami Mujawar
2022-08-03 14:35 ` [PATCH v1 1/5] Basetools/GenFw: Allow AARCH64 builds to use the --prm flag Sami Mujawar
2022-08-03 14:35 ` [PATCH v1 2/5] PrmPkg: Enable external visibility on PRM symbols Sami Mujawar
2022-08-03 14:35 ` Sami Mujawar [this message]
2022-08-03 14:35 ` [PATCH v1 4/5] PrmPkg: Support AArch64 builds using GCC Sami Mujawar
2022-08-03 14:35 ` [PATCH v1 5/5] PrmPkg: Add details on AArch64 build to the Readme Sami Mujawar
2022-08-04 4:09 ` [PATCH v1 0/5] Add support to build PRM for AARCH64 using GCC Michael Kubacki
2022-08-08 10:35 ` Sami Mujawar
2022-08-08 22:47 ` [edk2-devel] " Michael Kubacki
2022-08-04 10:32 ` Ard Biesheuvel
2022-08-05 15:08 ` Michael Kubacki
2022-08-08 10:34 ` Sami Mujawar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220803143547.27772-4-sami.mujawar@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox