WolfSSL bindings conflicting types for 'time_t' Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

WolfSSL bindings conflicting types for 'time_t'

Post 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
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: WolfSSL bindings conflicting types for 'time_t'

Post by Giovanni »

Hi,

Are you using GCC 7?

Giovanni
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: WolfSSL bindings conflicting types for 'time_t'

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: WolfSSL bindings conflicting types for 'time_t'

Post 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
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: WolfSSL bindings conflicting types for 'time_t'

Post 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.
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: WolfSSL bindings conflicting types for 'time_t'

Post 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())
ych
Posts: 45
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 17 times
Been thanked: 11 times

Re: WolfSSL bindings conflicting types for 'time_t'

Post by ych »

Will this patch be applied or I need to provide some additional description?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: WolfSSL bindings conflicting types for 'time_t'

Post by Giovanni »

It is fine, everything in this forum is considered for inclusion and will get at least a comment.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: WolfSSL bindings conflicting types for 'time_t'

Post by Giovanni »

Fixed thanks.

Giovanni
Post Reply