Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Setting -mcpu=cortex-a53 breaks build in openssl/lib/libcrypto




> On May 19, 2019, at 7:37 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
> 
> 
> 
>> On May 18, 2019, at 1:17 PM, Sad Clouds <cryintothebluesky%gmail.com@localhost> wrote:
>> 
>> In file included from /netbsd_build/netbsd-current-src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/aes-armv4.S:43:0:
>> /netbsd_build/netbsd-current-src/crypto/external/bsd/openssl/dist/crypto/arm_arch.h:65:4: error: #error "__ARM_MAX_ARCH__ can't be less than __ARM_ARCH__"
>> #  error "__ARM_MAX_ARCH__ can't be less than __ARM_ARCH__"
>>   ^~~~~
>> *** [aes-armv4.pico] Error code 1
>> 
>> Well, changing -mcpu to -mtune avoids the above error, but does anyone
>> think this is a bug in openssl, that you can't build it with -mcpu flag?
> 
> I guess that's happening here is that you configured GCC for ARMv7, so __ARM_MAX_ARCH__ is being set to 7, but when you say -mcpu=cortex-a53, you're saying "Hey, I want to use an ARMv8 CPU", so __ARM_ARCH_8A__ gets defined, and thus __ARM_ARCH__ winds up being 8 due to the checks in OpenSSL's arm_arch.h.

Well, that's exactly what's happening, except I don't see __ARM_MAX_ARCH__ defined by GCC:

BigMac:thorpej$ armv7--netbsdelf-eabihf-gcc -E -dM - < /dev/null | grep ARCH
#define __ARM_ARCH_ISA_ARM 1
#define __ARM_ARCH_PROFILE 65
#define __ARM_ARCH_ISA_THUMB 2
#define __ARM_ARCH 7
#define __ARM_ARCH_7A__ 1
BigMac:thorpej$ armv7--netbsdelf-eabihf-gcc -mcpu=cortex-a53 -E -dM - < /dev/null | grep ARCH
#define __ARM_ARCH_ISA_ARM 1
#define __ARM_ARCH_8A__ 1
#define __ARM_ARCH_PROFILE 65
#define __ARM_ARCH_ISA_THUMB 2
#define __ARM_ARCH 8
#define __ARM_ARCH_EXT_IDIV__ 1
BigMac:thorpej$ 

-- thorpej



Home | Main Index | Thread Index | Old Index