diff mbox

[edk2] CryptoPkg: use correct OpenSSL #define for LP64 data model

Message ID 0877601216922E4B83A7129715B5DA2BBE7474DF27@GEORGE.Emea.Arm.com
State New
Headers show

Commit Message

Olivier Martin Sept. 18, 2014, 6:55 p.m. UTC
Reviewed-By: Olivier Martin <olivier.martin@arm.com>

Maybe it would be safer to add '-m64' to the command line to be consistent. In case '-m32' has been specified earlier in the command line.

Comments

Ard Biesheuvel Sept. 18, 2014, 7:03 p.m. UTC | #1
On 18 September 2014 11:55, Olivier Martin <Olivier.Martin@arm.com> wrote:
> Reviewed-By: Olivier Martin <olivier.martin@arm.com>
>
> Maybe it would be safer to add '-m64' to the command line to be consistent. In case '-m32' has been specified earlier in the command line.
>

That is something different entirely: -m32 switches not only the data
model to *32*-bit pointers, it also affects the emitted instructions.

This is only about the distinction between a 32-bit long type or a
64-bit long type on systems where the pointer type is always 64-bit.
Andrew Fish Sept. 18, 2014, 7:43 p.m. UTC | #2
On Sep 18, 2014, at 12:03 PM, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> On 18 September 2014 11:55, Olivier Martin <Olivier.Martin@arm.com> wrote:
>> Reviewed-By: Olivier Martin <olivier.martin@arm.com>
>> 
>> Maybe it would be safer to add '-m64' to the command line to be consistent. In case '-m32' has been specified earlier in the command line.
>> 
> 
> That is something different entirely: -m32 switches not only the data
> model to *32*-bit pointers, it also affects the emitted instructions.
> 
> This is only about the distinction between a 32-bit long type or a
> 64-bit long type on systems where the pointer type is always 64-bit.
> 

And the sizeof(long) is a different between VC++ and most of the other 64-bit tool chains, so this was probably a copy paste error. Good catch Ard!

Thanks,

Andrew Fish 

> -- 
> Ard.
> 
> 
>> 
>> 
>> ________________________________________
>> From: Ard Biesheuvel [ard.biesheuvel@linaro.org]
>> Sent: 18 September 2014 18:45
>> To: edk2-devel@lists.sourceforge.net
>> Cc: Olivier Martin; afish@apple.com; Ard Biesheuvel
>> Subject: [PATCH] CryptoPkg: use correct OpenSSL #define for LP64 data model
>> 
>> Users of the LP64 data model should declare SIXTY_FOUR_BIT_LONG,
>> not SIXTY_FOUR_BIT when building OpenSSL.
>> 
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>> CryptoPkg/Library/OpensslLib/OpensslLib.inf | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
>> index d380158a4339..20991529b1c4 100644
>> --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
>> +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
>> @@ -655,10 +655,10 @@
>>    INTEL:*_*_X64_CC_FLAGS                 = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
>>    INTEL:*_*_IPF_CC_FLAGS                 = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
>>    GCC:*_*_IA32_CC_FLAGS                  = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
>> -   GCC:*_*_X64_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT
>> -   GCC:*_*_IPF_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT
>> +   GCC:*_*_X64_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
>> +   GCC:*_*_IPF_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
>>    GCC:*_*_ARM_CC_FLAGS                   = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
>> -   GCC:*_*_AARCH64_CC_FLAGS               = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT
>> +   GCC:*_*_AARCH64_CC_FLAGS               = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
>> 
>>    # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
>>    # 1295: Deprecated declaration <entity> - give arg types
>> --
>> 1.8.3.2
>> 
>> 
>> 
>> -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.
>> 
>> ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2557590
>> ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2548782
>> 


------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
diff mbox

Patch

diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
index d380158a4339..20991529b1c4 100644
--- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf
+++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf
@@ -655,10 +655,10 @@ 
    INTEL:*_*_X64_CC_FLAGS                 = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    INTEL:*_*_IPF_CC_FLAGS                 = -U_WIN32 -U_WIN64 -U_MSC_VER -U__ICC $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) /w -DSIXTY_FOUR_BIT
    GCC:*_*_IA32_CC_FLAGS                  = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
-   GCC:*_*_X64_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT
-   GCC:*_*_IPF_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT
+   GCC:*_*_X64_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
+   GCC:*_*_IPF_CC_FLAGS                   = -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG
    GCC:*_*_ARM_CC_FLAGS                   = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DTHIRTY_TWO_BIT
-   GCC:*_*_AARCH64_CC_FLAGS               = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT
+   GCC:*_*_AARCH64_CC_FLAGS               = $(OPENSSL_FLAGS) $(OPENSSL_EXFLAGS) -w -DSIXTY_FOUR_BIT_LONG

    # suppress the following warnings in openssl so we don't break the build with warnings-as-errors:
    # 1295: Deprecated declaration <entity> - give arg types