Просмотр исходного кода

change: mbedtls配置文件改名, c编译参数禁用gcc自带的几个函数

Wendal Chen 3 лет назад
Родитель
Сommit
690fadb567
2 измененных файлов с 6 добавлено и 2 удалено
  1. 2 1
      app/port/mbedtls_config_air101.h
  2. 4 1
      xmake.lua

+ 2 - 1
app/port/mbedtls_config.h → app/port/mbedtls_config_air101.h

@@ -965,7 +965,7 @@
  * This option is only useful if both MBEDTLS_SHA256_C and
  * This option is only useful if both MBEDTLS_SHA256_C and
  * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
  * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
  */
  */
-//#define MBEDTLS_ENTROPY_FORCE_SHA256
+// #define MBEDTLS_ENTROPY_FORCE_SHA256
 
 
 /**
 /**
  * \def MBEDTLS_ENTROPY_NV_SEED
  * \def MBEDTLS_ENTROPY_NV_SEED
@@ -2424,6 +2424,7 @@
  * This module is required for the SSL/TLS 1.2 PRF function.
  * This module is required for the SSL/TLS 1.2 PRF function.
  */
  */
 #define MBEDTLS_SHA256_C
 #define MBEDTLS_SHA256_C
+#define MBEDTLS_SHA224_C
 
 
 /**
 /**
  * \def MBEDTLS_SHA512_C
  * \def MBEDTLS_SHA512_C

+ 4 - 1
xmake.lua

@@ -49,11 +49,14 @@ set_warnings("all")
 set_optimize("smallest")
 set_optimize("smallest")
 -- set language: c99
 -- set language: c99
 set_languages("c99")
 set_languages("c99")
-add_defines("MBEDTLS_CONFIG_FILE=\"mbedtls_config.h\"")
+add_defines("MBEDTLS_CONFIG_FILE=\"mbedtls_config_air101.h\"")
 add_asflags(flto .. "-DTLS_CONFIG_CPU_XT804=1 -DGCC_COMPILE=1 -mcpu=ck804ef -std=gnu99 -c -mhard-float -Wa,--gdwarf2 -fdata-sections -ffunction-sections")
 add_asflags(flto .. "-DTLS_CONFIG_CPU_XT804=1 -DGCC_COMPILE=1 -mcpu=ck804ef -std=gnu99 -c -mhard-float -Wa,--gdwarf2 -fdata-sections -ffunction-sections")
 add_cflags(flto .. "-DTLS_CONFIG_CPU_XT804=1 -DGCC_COMPILE=1 -mcpu=ck804ef -std=gnu99 -c -mhard-float -Wall -fdata-sections -ffunction-sections")
 add_cflags(flto .. "-DTLS_CONFIG_CPU_XT804=1 -DGCC_COMPILE=1 -mcpu=ck804ef -std=gnu99 -c -mhard-float -Wall -fdata-sections -ffunction-sections")
 add_cxflags(flto .. "-DTLS_CONFIG_CPU_XT804=1 -DGCC_COMPILE=1 -mcpu=ck804ef -std=gnu99 -c -mhard-float -Wall -fdata-sections -ffunction-sections")
 add_cxflags(flto .. "-DTLS_CONFIG_CPU_XT804=1 -DGCC_COMPILE=1 -mcpu=ck804ef -std=gnu99 -c -mhard-float -Wall -fdata-sections -ffunction-sections")
 
 
+
+add_cflags("-fno-builtin-exit -fno-builtin-strcat -fno-builtin-strncat -fno-builtin-strcpy -fno-builtin-strlen -fno-builtin-calloc")
+
 set_dependir("$(buildir)/.deps")
 set_dependir("$(buildir)/.deps")
 set_objectdir("$(buildir)/.objs")
 set_objectdir("$(buildir)/.objs")