Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building MbedTLS 3.6 with GCC with LTO #9182

Closed
Zhenhang1213 opened this issue May 26, 2024 · 3 comments
Closed

Error when building MbedTLS 3.6 with GCC with LTO #9182

Zhenhang1213 opened this issue May 26, 2024 · 3 comments

Comments

@Zhenhang1213
Copy link

Zhenhang1213 commented May 26, 2024

Summary

Mbed TLS 3.6 does not build successfully with GCC when using LTO (link-time optimization

System information

Mbed TLS version (number or commit id): 3.6
Operating system and version: Linux kwephisprc06669 4.12.14-120-default #1 SMP Thu Nov 7 16:39:09 UTC 2019 (fd9dc36) x86_64 x86_64 x86_64 GNU/Linux
Configuration (if not default, please attach mbedtls_config.h):
#ifndef MBEDTLS_CONFIG_H
#define MBEDTLS_CONFIG_H
#include <string.h>
#include <stdio.h>
#include <securec.h>

//#define CHAR_BIT 8

#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_PKCS1_V21
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_OID_C
#define MBEDTLS_RSA_C
#define MBEDTLS_SHA1_C
#define MBEDTLS_SHA224_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_SHA384_C
#define MBEDTLS_SHA512_C
#define MBEDTLS_MD_C
#define MBEDTLS_MD5_C
#define MBEDTLS_NO_UDBL_DIVISION

#endif /* MBEDTLS_CONFIG_H */
Compiler and options (if you used a pre-built binary, please indicate how you obtained it): gcc arm64le 7.3
Additional environment information:

Expected behavior

Actual behavior

lto1: fatal error: target specific builtin not available
compilation terminated.
lto-wrapper: fatal error: /usr1/huawei/optix_rtn_6900_v100r024c00_srz_for_mbedtls/Bep/rtn/hcc_arm64le/bin/aarch64-target-linux-gnu-gcc returned 1 exit status
compilation terminated.
/usr/bin/../lib64/gcc/aarch64-target-linux-gnu/7.3.0/../../../../aarch64-target-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Steps to reproduce

Additional information

@Zhenhang1213 Zhenhang1213 changed the title Errorwhen building MbedTLS 3.6 with GCC with LTO Error when building MbedTLS 3.6 with GCC with LTO May 26, 2024
@Zhenhang1213
Copy link
Author

I find in common.h,define MBEDTLS_HAVE_NEON_INTRINSICS,so that failed, target doesn't support neon
#if defined(__ARM_NEON) #include <arm_neon.h> #define MBEDTLS_HAVE_NEON_INTRINSICS #elif defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64) #include <arm64_neon.h> #define MBEDTLS_HAVE_NEON_INTRINSICS #endif

@tom-cosgrove-arm
Copy link
Contributor

target doesn't support neon

We only use intrinsics if __ARM_NEON is set by the compiler: what compiler flags were you using?

@Zhenhang1213
Copy link
Author

target doesn't support neon

We only use intrinsics if __ARM_NEON is set by the compiler: what compiler flags were you using?

I set __ARM_NEON 1, my falut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants