WolfSSL bindings conflicting types for 'time_t' Topic is solved

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

WolfSSL bindings conflicting types for 'time_t'  Topic is solved

Postby ych » Sat Mar 17, 2018 11:23 am

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: 11156
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 392 times
Been thanked: 323 times
Contact:

Re: WolfSSL bindings conflicting types for 'time_t'

Postby Giovanni » Sat Mar 17, 2018 11:34 am

Hi,

Are you using GCC 7?

Giovanni

ych
Posts: 27
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 3 times
Been thanked: 6 times

Re: WolfSSL bindings conflicting types for 'time_t'

Postby ych » Sat Mar 17, 2018 1:40 pm

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: 11156
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 392 times
Been thanked: 323 times
Contact:

Re: WolfSSL bindings conflicting types for 'time_t'

Postby Giovanni » Sat Mar 17, 2018 3:12 pm

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: 27
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 3 times
Been thanked: 6 times

Re: WolfSSL bindings conflicting types for 'time_t'

Postby ych » Tue Mar 20, 2018 9:24 am

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: 27
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 3 times
Been thanked: 6 times

Re: WolfSSL bindings conflicting types for 'time_t'

Postby ych » Wed Mar 21, 2018 10:14 am

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: 27
Joined: Tue Mar 03, 2015 11:38 pm
Has thanked: 3 times
Been thanked: 6 times

Re: WolfSSL bindings conflicting types for 'time_t'

Postby ych » Thu Mar 22, 2018 9:49 am

Will this patch be applied or I need to provide some additional description?

User avatar
Giovanni
Site Admin
Posts: 11156
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 392 times
Been thanked: 323 times
Contact:

Re: WolfSSL bindings conflicting types for 'time_t'

Postby Giovanni » Thu Mar 22, 2018 10:34 am

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: 11156
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 392 times
Been thanked: 323 times
Contact:

Re: WolfSSL bindings conflicting types for 'time_t'

Postby Giovanni » Fri Mar 23, 2018 1:08 pm

Fixed thanks.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests