zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.01k stars 6.16k forks source link

ARCMWDT: Some of POSIX tests are broken #75105

Closed kokas-a closed 1 day ago

kokas-a commented 5 days ago

Describe the bug POSIX-compatible tests are broken for ARCMWDT compiler. Some types are not presented in MW library, some types mismatch with defined in Zephyr.

To Reproduce Steps to reproduce the behavior:

  1. export ZEPHYR_TOOLCHAIN_VARIANT=arcmwdt
  2. west build -p -b nsim/nsim_em tests/posix/headers/ -T portability.posix.headers.arcmwdtlib.without_posix_api
  3. See error

Expected behavior Clean build with no errors

Logs and console output

/home/user/sandbox/zephyrproject/zephyr/include/zephyr/posix/posix_types.h:24:13: error: typedef redefinition with different types ('int' vs 'long')
   24 | typedef int pid_t;
      |             ^
/home/user/ARC_202406rc1/MetaWare/arc/inc/sys/types.h:63:19: note: previous definition is here
   63 |     typedef     long    pid_t;
      |                         ^
1 error generated.

and

/home/user/sandbox/zephyrproject/zephyr/include/zephyr/posix/aio.h:24:18: error: field has incomplete type 'struct sigevent'
   24 |         struct sigevent aio_sigevent;
      |                         ^
/home/user/sandbox/zephyrproject/zephyr/include/zephyr/posix/aio.h:24:9: note: forward declaration of 'struct sigevent'
   24 |         struct sigevent aio_sigevent;
      |                ^
1 error generated.

Environment (please complete the following information):

cfriedt commented 3 days ago

I would also prefer if pid_t were long, but IIRC newlib set it as int.

Looking into a fix.