[bug #58575] compilation error on ARMCC6

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #58575] compilation error on ARMCC6

Ashley Duncan
URL:
  <https://savannah.nongnu.org/bugs/?58575>

                 Summary: compilation error on ARMCC6
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: taraben_a
            Submitted on: Mon 15 Jun 2020 01:21:30 PM UTC
                Category: Platform ports
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

Hello all,

I am using STM32 on win32 and Keil-MDK and auto generated project using
CubeMX.
This comes with lwip 2.1.2

Using the compiler version 6 ARM-CC 6.1.4 clang based compiler, I run into
compiler problem.

../Middlewares/Third_Party/LwIP/system\arch/cc.h(46): error: 'sys/time.h' file
not found
#include <sys/time.h>
         ^~~~~~~~~~~~

in file cc.h line 44ff
...
>#if defined (__GNUC__) & !defined (__CC_ARM)
>
>#define LWIP_TIMEVAL_PRIVATE 0
>#include <sys/time.h>
>
>#endif
...

The test for compiler is not correct (i assume).
There are other tests in cmsis_compiler.h 33ff
...

>/*
> * Arm Compiler 4/5
> */
>#if   defined ( __CC_ARM )
>  #include "cmsis_armcc.h"
>
>
>/*
> * Arm Compiler 6 (armclang)
> */
>#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
>  #include "cmsis_armclang.h"
>
>
>/*
> * GNU Compiler
> */
>#elif defined ( __GNUC__ )
>  #include "cmsis_gcc.h"
...

I can resolve this error using following patch which applies the test logic of
cmsis_compiler.h on that in cc.h

Index: cc.h
===================================================================
--- cc.h (revision 18447)
+++ cc.h (working copy)
@@ -40,7 +40,7 @@
 
 #define LWIP_PROVIDE_ERRNO
 
-#if defined (__GNUC__) & !defined (__CC_ARM)
+#if defined (__GNUC__) && !defined (__CC_ARM) && !(defined(__ARMCC_VERSION)
&& (__ARMCC_VERSION >= 6010050))
 
 #define LWIP_TIMEVAL_PRIVATE 0
 #include <sys/time.h>





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 15 Jun 2020 01:21:30 PM UTC  Name: cc.h.patch  Size: 716B   By:
taraben_a
patch that fixes the compiler problem
<http://savannah.nongnu.org/bugs/download.php?file_id=49273>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?58575>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #58575] compilation error on ARMCC6

Ashley Duncan
Update of bug #58575 (project lwip):

                  Status:                    None => Invalid                
             Assigned to:                    None => goldsimon              
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #1:

That patch doesn't match any file we have in our repository. The file "cc.h"
is not shipped by us (only for thet unix and win32 example/test ports).

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?58575>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel