This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dda7f1de crypto/mbedtls: fix build break on sha256.c
7dda7f1de is described below

commit 7dda7f1dee8a75bd6a7f8011f6c0ce8ae408e11a
Author: chao an <[email protected]>
AuthorDate: Wed Apr 19 17:26:10 2023 +0800

    crypto/mbedtls: fix build break on sha256.c
    
    Build break on Assemble compiler if -fno-omit-frame-pointer and -O3 enabled 
at same time
    
    {standard input}: Assembler messages:
    {standard input}:2560: Error: branch out of range
    make[2]: *** [apps/Application.mk:170: mbedtls/library/sha256.o] Error 1
    
    Signed-off-by: chao an <[email protected]>
---
 crypto/mbedtls/Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/crypto/mbedtls/Makefile b/crypto/mbedtls/Makefile
index efa1b9756..f5ebf0f89 100644
--- a/crypto/mbedtls/Makefile
+++ b/crypto/mbedtls/Makefile
@@ -38,7 +38,18 @@ MBEDTLS_UNPACKPROGDIR = $(MBEDTLS_UNPACKNAME)$(DELIM)programs
 # This lets Mbed TLS better use some of the POSIX features we have
 CFLAGS += ${DEFINE_PREFIX}__unix__
 
-library/bignum.c_CFLAGS += -fno-lto
+mbedtls/library/bignum.c_CFLAGS += -fno-lto
+
+# Build break on Assemble compiler if -fno-omit-frame-pointer and -O3 enabled 
at same time
+# {standard input}: Assembler messages:
+# {standard input}:2560: Error: branch out of range
+# make[2]: *** [apps/Application.mk:170: mbedtls/library/sha256.o] Error 1
+
+ifeq ($(CONFIG_FRAME_POINTER),y)
+  ifeq ($(CONFIG_DEBUG_OPTLEVEL),"-O3")
+    mbedtls/library/sha256.c_CFLAGS += -O2
+  endif
+endif
 
 ifeq ($(CONFIG_ARCH_SIM),y)
   CFLAGS += -O0

Reply via email to