[edk2-devel] [PATCH edk2-platforms 1/5] Platform/ARM/SgiPkg: Remove '-march=armv8-a+nofp' flag

PierreGondois posted 5 patches 3 years ago
[edk2-devel] [PATCH edk2-platforms 1/5] Platform/ARM/SgiPkg: Remove '-march=armv8-a+nofp' flag
Posted by PierreGondois 3 years ago
From: Pierre Gondois <pierre.gondois@arm.com>

The '-march=armv8-a+nofp' flag abort the following build:
  build -a AARCH64 -p Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
  -t GCC5 -D SECURE_STORAGE_ENABLE
Error message:
  CryptoPkg/Library/OpensslLib/openssl/crypto/rand/drbg_lib.c:1009:12:
  error: ‘+nofp’ feature modifier is incompatible with the use of
  floating-point types
  static int drbg_add(const void *buf, int num, double randomness)
			 ^~~~~~~~

In SgiPlatformMm.dsc.inc, the '-march=armv8-a+nofp' flag was
originally added in:
commit 1974293d1975 ("Platform/ARM/SgiPkg: Build infrastructure for
StandaloneMm image")
as a linker flag. The flag seem to have been added to avoid triggering
an exception due to the floating point unit missing in RTL. With the
latest RTL, the exception is not triggered anymore.

commit 936e8dd57524 ("Platform/Sgi: Cleanup build options for
StandaloneMM context")
moves the flag from the linker to the compiler, making the build fail.

Remove the '-march=armv8-a+nofp' flag as it is not necessary anymore
for SgiPlatformMm.dsc.inc, and is probably not necessary for
PlatformStandaloneMmRpmb.dsc.

CC: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
CC: Pranav Madhu <pranav.madhu@arm.com>
CC: Sayanta Pattanayak <Sayanta.Pattanayak@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
index 01f0a7657c51..f9a516b341f0 100644
--- a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
@@ -146,5 +146,5 @@ [Components.AARCH64]
 #
 ###################################################################################################
 [BuildOptions.AARCH64]
-  GCC:*_*_*_CC_FLAGS = -mstrict-align -march=armv8-a+nofp -D DISABLE_NEW_DEPRECATED_INTERFACES
+  GCC:*_*_*_CC_FLAGS = -mstrict-align -D DISABLE_NEW_DEPRECATED_INTERFACES
   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99009): https://edk2.groups.io/g/devel/message/99009
Mute This Topic: https://groups.io/mt/96518042/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH edk2-platforms 1/5] Platform/ARM/SgiPkg: Remove '-march=armv8-a+nofp' flag
Posted by Sami Mujawar 3 years ago
Hi Pierre,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99127): https://edk2.groups.io/g/devel/message/99127
Mute This Topic: https://groups.io/mt/96518042/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH edk2-platforms 1/5] Platform/ARM/SgiPkg: Remove '-march=armv8-a+nofp' flag
Posted by Thomas Abraham 3 years ago

On 25/01/2023 10:27, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <pierre.gondois@arm.com>
> 
> The '-march=armv8-a+nofp' flag abort the following build:
>    build -a AARCH64 -p Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
>    -t GCC5 -D SECURE_STORAGE_ENABLE
> Error message:
>    CryptoPkg/Library/OpensslLib/openssl/crypto/rand/drbg_lib.c:1009:12:
>    error: ‘+nofp’ feature modifier is incompatible with the use of
>    floating-point types
>    static int drbg_add(const void *buf, int num, double randomness)
> 			 ^~~~~~~~
> 
> In SgiPlatformMm.dsc.inc, the '-march=armv8-a+nofp' flag was
> originally added in:
> commit 1974293d1975 ("Platform/ARM/SgiPkg: Build infrastructure for
> StandaloneMm image")
> as a linker flag. The flag seem to have been added to avoid triggering
> an exception due to the floating point unit missing in RTL. With the
> latest RTL, the exception is not triggered anymore.
> 
> commit 936e8dd57524 ("Platform/Sgi: Cleanup build options for
> StandaloneMM context")
> moves the flag from the linker to the compiler, making the build fail.
> 
> Remove the '-march=armv8-a+nofp' flag as it is not necessary anymore
> for SgiPlatformMm.dsc.inc, and is probably not necessary for
> PlatformStandaloneMmRpmb.dsc.
> 
> CC: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
> CC: Pranav Madhu <pranav.madhu@arm.com>
> CC: Sayanta Pattanayak <Sayanta.Pattanayak@arm.com>
> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
>   Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
> index 01f0a7657c51..f9a516b341f0 100644
> --- a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
> +++ b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
> @@ -146,5 +146,5 @@ [Components.AARCH64]
>   #
>   ###################################################################################################
>   [BuildOptions.AARCH64]
> -  GCC:*_*_*_CC_FLAGS = -mstrict-align -march=armv8-a+nofp -D DISABLE_NEW_DEPRECATED_INTERFACES
> +  GCC:*_*_*_CC_FLAGS = -mstrict-align -D DISABLE_NEW_DEPRECATED_INTERFACES
>     GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000

Thanks for this fix.

Reviewed-by: Thomas Abraham <thomas.abraham@arm.com>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99066): https://edk2.groups.io/g/devel/message/99066
Mute This Topic: https://groups.io/mt/96518042/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-