FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.51k stars 1.05k forks source link

[BUG] I used Posix gcc to compile on glibc 2.24 and gcc 6.3.0, but failed to compile the demo #1077

Closed maxiaogood closed 3 weeks ago

maxiaogood commented 1 month ago

Describe the bug I used Posix gcc to compile on glibc 2.24 and gcc 6.3.0, but failed to compile the demo

Target

Host

To Reproduce

Expected behavior Can be compiled

Screenshots image

Additional context -- Configuring done -- Generating done -- Build files have been written to: /work/001_freertos/FreeRTOS/Demo/Posix_GCC/build Consolidate compiler generated dependencies of target freertos_kernel_port [ 2%] Building C object FreeRTOS-Kernel/portable/CMakeFiles/freertos_kernel_port.dir/ThirdParty/GCC/Posix/port.c.o In file included from /work/001_freertos/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:62:0: /usr/include/stdio.h:316:6: error: unknown type name '_IO_cookie_io_functions_t' _IO_cookie_io_functions_t __io_funcs) THROW wur; ^~~~~~~~~ In file included from /work/001_freertos/FreeRTOS/Source/include/./FreeRTOS.h:58:0, from /work/001_freertos/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:75: /work/001_freertos/FreeRTOS/Demo/Posix_GCC/./FreeRTOSConfig.h:178:33: fatal error: trcRecorder.h: No such file or directory

include "trcRecorder.h"

                             ^

compilation terminated. FreeRTOS-Kernel/portable/CMakeFiles/freertos_kernel_port.dir/build.make:75: recipe for target 'FreeRTOS-Kernel/portable/CMakeFiles/freertos_kernel_port.dir/ThirdParty/GCC/Posix/port.c.o' failed make[2]: [FreeRTOS-Kernel/portable/CMakeFiles/freertos_kernel_port.dir/ThirdParty/GCC/Posix/port.c.o] Error 1 CMakeFiles/Makefile2:187: recipe for target 'FreeRTOS-Kernel/portable/CMakeFiles/freertos_kernel_port.dir/all' failed make[1]: [FreeRTOS-Kernel/portable/CMakeFiles/freertos_kernel_port.dir/all] Error 2 Makefile:90: recipe for target 'all' failed make: *** [all] Error 2

aggarg commented 1 month ago

There seems to be 2 errors in the logs you shared:

1.

In file included from /work/001_freertos/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:62:0:
/usr/include/stdio.h:316:6: error: unknown type name '_IO_cookie_io_functions_t'

Does this go away if you change this line to:

#define _GNU_SOURCE

2.

n file included from /work/001_freertos/FreeRTOS/Source/include/./FreeRTOS.h:58:0,
from /work/001_freertos/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:75:
/work/001_freertos/FreeRTOS/Demo/Posix_GCC/./FreeRTOSConfig.h:178:33: fatal error: trcRecorder.h: No such file or directory
#include "trcRecorder.h"
^

Did you clone the submodules? You can do so with the following command:

git submodule update --init --recursive
maxiaogood commented 3 weeks ago
  1. This error is resolved using # define _GNU_SOURCE In file included from /work/001_freertos/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:62:0: /usr/include/stdio.h:316:6: error: unknown type name '_IO_cookie_io_functions_t'

2.After using git submodule update -- init -- recursive, there is no second error left n file included from /work/001_freertos/FreeRTOS/Source/include/./FreeRTOS.h:58:0, from /work/001_freertos/FreeRTOS/Source/portable/ThirdParty/GCC/Posix/port.c:75: /work/001_freertos/FreeRTOS/Demo/Posix_GCC/./FreeRTOSConfig.h:178:33: fatal error: trcRecorder.h: No such file or directory

include "trcRecorder.h"

aggarg commented 3 weeks ago

2.After using git submodule update -- init -- recursive, there is no second error left

So all your problems are solved, right?

maxiaogood commented 3 weeks ago

yes

aggarg commented 3 weeks ago

Thank you for confirming.