PrmPkg: Build Prm Samples with GCC for AARCH64

- 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>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Jose Marinho 2022-04-05 18:57:23 +01:00 committed by mergify[bot]
parent 9f197e44b1
commit 21200d9fe6
2 changed files with 8 additions and 0 deletions

View File

@ -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 @@
[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

View File

@ -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 @@
[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