Page 1 of 1

WolfSSL bindings conflicting types for 'time_t'

Posted: Sat Mar 17, 2018 11:23 am
by ych
I try to build RT-STM32-LWIP-FATFS-USB-HTTPS demo from current stable_18.2.x branch and get next compile error:

Code: Select all

Compiling wolfssl_chibios.c
In file included from ../../../ext/wolfssl/wolfssl/wolfcrypt/types.h:28:0,
                 from ../../../os/various/wolfssl_bindings/wolfssl_chibios.h:42,
                 from ../../../os/various/wolfssl_bindings/wolfssl_chibios.c:41:
../../../ext/wolfssl/wolfssl/wolfcrypt/wc_port.h:442:18: error: conflicting types for 'time_t'
     typedef long time_t;
                  ^~~~~~
In file included from /Users/ych/projects/dev/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/sys/select.h:26:0,
                 from /Users/ych/projects/dev/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/sys/types.h:68,
                 from /Users/ych/projects/dev/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/time.h:28,
                 from ../../../ext/wolfssl/wolfssl/wolfcrypt/wc_port.h:399,
                 from ../../../ext/wolfssl/wolfssl/wolfcrypt/types.h:28,
                 from ../../../os/various/wolfssl_bindings/wolfssl_chibios.h:42,
                 from ../../../os/various/wolfssl_bindings/wolfssl_chibios.c:41:
/Users/ych/projects/dev/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/sys/_timeval.h:40:18: note: previous declaration of 'time_t' was here
 typedef _TIME_T_ time_t;
                  ^~~~~~
make[1]: *** [build-stm32f746_discovery/obj/wolfssl_chibios.o] Error 1
make: *** [all] Error 2

Re: WolfSSL bindings conflicting types for 'time_t'

Posted: Sat Mar 17, 2018 11:34 am
by Giovanni
Hi,

Are you using GCC 7?

Giovanni

Re: WolfSSL bindings conflicting types for 'time_t'

Posted: Sat Mar 17, 2018 1:40 pm
by ych
Amm yes :?.

Code: Select all

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Is it bad?
It seems everything except this compiles and works without any problem.

Re: WolfSSL bindings conflicting types for 'time_t'

Posted: Sat Mar 17, 2018 3:12 pm
by Giovanni
I suspect it is triggered by some change in GCC 7, could you try a lower version? not sure how to fix it, not my code.

Giovanni

Re: WolfSSL bindings conflicting types for 'time_t'

Posted: Tue Mar 20, 2018 9:24 am
by ych
Try to compile with GNU Arm Embedded Toolchain 4 — compiled without error, so open issue on wolfssl - https://github.com/wolfSSL/wolfssl/issues/1450.

Re: WolfSSL bindings conflicting types for 'time_t'

Posted: Wed Mar 21, 2018 10:14 am
by ych
After prompt from WolfSSL community, I apply next patch and this issue resolver under GNU Arm Embedded Toolchain 4 and 7:

Code: Select all

diff --git a/os/various/wolfssl_bindings/user_settings.h b/os/various/wolfssl_bindings/user_settings.h
index 4b491225e..0ae6b2767 100644
--- a/os/various/wolfssl_bindings/user_settings.h
+++ b/os/various/wolfssl_bindings/user_settings.h
@@ -13,7 +13,6 @@
 #define USER_TICKS
 #define WOLFSSL_USER_CURRTIME
 #define XMALLOC_OVERRIDE
-#define USE_WOLF_TIME_T
 #define XTIME(tl)       (LowResTimer())

Re: WolfSSL bindings conflicting types for 'time_t'

Posted: Thu Mar 22, 2018 9:49 am
by ych
Will this patch be applied or I need to provide some additional description?

Re: WolfSSL bindings conflicting types for 'time_t'

Posted: Thu Mar 22, 2018 10:34 am
by Giovanni
It is fine, everything in this forum is considered for inclusion and will get at least a comment.

Giovanni

Re: WolfSSL bindings conflicting types for 'time_t'

Posted: Fri Mar 23, 2018 1:08 pm
by Giovanni
Fixed thanks.

Giovanni