Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open-amp: enable C library cause open-amp\open-amp\lib\common\sh_mem.c compile error #8104

Closed
Jeepgoing opened this issue Jun 1, 2018 · 19 comments
Assignees
Labels
area: C Library C Standard Library area: IPC Inter-Process Communication bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@Jeepgoing
Copy link

Jeepgoing commented Jun 1, 2018

i am designing application program. when i enabled C Library, open-amp library compile error, as below:


`/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:204:18: error: expected specifier-qualifier-list before ‘int_least8_t’
 typedef _Atomic(int_least8_t)  atomic_int_least8_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:205:18: error: expected specifier-qualifier-list before ‘uint_least8_t’
 typedef _Atomic(uint_least8_t)  atomic_uint_least8_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:206:18: error: expected specifier-qualifier-list before ‘int_least16_t’
 typedef _Atomic(int_least16_t)  atomic_int_least16_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:207:18: error: expected specifier-qualifier-list before ‘uint_least16_t’
 typedef _Atomic(uint_least16_t)  atomic_uint_least16_t;
                  ^~~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:208:18: error: expected specifier-qualifier-list before ‘int_least32_t’
 typedef _Atomic(int_least32_t)  atomic_int_least32_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:209:18: error: expected specifier-qualifier-list before ‘uint_least32_t’
 typedef _Atomic(uint_least32_t)  atomic_uint_least32_t;
                  ^~~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:210:18: error: expected specifier-qualifier-list before ‘int_least64_t’
 typedef _Atomic(int_least64_t)  atomic_int_least64_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:211:18: error: expected specifier-qualifier-list before ‘uint_least64_t’
 typedef _Atomic(uint_least64_t)  atomic_uint_least64_t;
                  ^~~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:212:18: error: expected specifier-qualifier-list before ‘int_fast8_t’
 typedef _Atomic(int_fast8_t)  atomic_int_fast8_t;
                  ^~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:213:18: error: expected specifier-qualifier-list before ‘uint_fast8_t’
 typedef _Atomic(uint_fast8_t)  atomic_uint_fast8_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:214:18: error: expected specifier-qualifier-list before ‘int_fast16_t’
 typedef _Atomic(int_fast16_t)  atomic_int_fast16_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:215:18: error: expected specifier-qualifier-list before ‘uint_fast16_t’
 typedef _Atomic(uint_fast16_t)  atomic_uint_fast16_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:216:18: error: expected specifier-qualifier-list before ‘int_fast32_t’
 typedef _Atomic(int_fast32_t)  atomic_int_fast32_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:217:18: error: expected specifier-qualifier-list before ‘uint_fast32_t’
 typedef _Atomic(uint_fast32_t)  atomic_uint_fast32_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:218:18: error: expected specifier-qualifier-list before ‘int_fast64_t’
 typedef _Atomic(int_fast64_t)  atomic_int_fast64_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:219:18: error: expected specifier-qualifier-list before ‘uint_fast64_t’`
@nashif nashif added the bug The issue is a bug, or the PR is fixing a bug label Jun 1, 2018
@MaureenHelm MaureenHelm added priority: low Low impact/importance bug area: C Library C Standard Library area: IPC Inter-Process Communication labels Jun 1, 2018
@nashif
Copy link
Member

nashif commented Jul 20, 2018

When C library are you using? Which toolchain?
Looks like it works fine with newlib 2.5, not versions before that.

@Jeepgoing
Copy link
Author

this issue only happen when i enabled openamp function. if i disabled openamp function, c lib works good.@nashif

@galak
Copy link
Collaborator

galak commented Dec 6, 2018

I think this might get fixed when we update OpenAMP to the new version. See PR #11355

@Jeepgoing
Copy link
Author

Hi, @galak, I have tested your branch (galak:openamp-v2018.10), and the question still exist, i have add <stdint.h> to <stdatomic.h>, but other errors occur, our product need <math.h>, so we must enable newlib support, hope your relay.

@galak
Copy link
Collaborator

galak commented Feb 1, 2019

Which c-library, how can I reproduce this?

@Jeepgoing
Copy link
Author

@galak newlib through menuconfig

@Jeepgoing
Copy link
Author

@galak
example:openamp lpc54114 board, enable libc through menuconfig.

@galak
Copy link
Collaborator

galak commented Feb 3, 2019

@Jeepgoing what errors are you seeing when you do this with current tree?

@Jeepgoing
Copy link
Author

@galak there are something undefined errors from SDK

@galak
Copy link
Collaborator

galak commented Feb 5, 2019

@galak there are something undefined errors from SDK

can you post the errors you see currently, want to make sure i'm seeing the same thing.

@Jeepgoing
Copy link
Author

@galak my errors as title described, now is chinese new year, i don't have PC on my home, sorry.

@Jeepgoing
Copy link
Author

@galak Hi, thank you for your relay, do you have replicated this issue?

@galak
Copy link
Collaborator

galak commented Feb 19, 2019

@Jeepgoing if you can add a log of the failure you are seeing to the issue that would be great.

@Jeepgoing
Copy link
Author

Jeepgoing commented Feb 20, 2019

@Jeepgoing if you can add a log of the failure you are seeing to the issue that would be great.

/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:204:18: error: expected specifier-qualifier-list before ‘int_least8_t’
 typedef _Atomic(int_least8_t)  atomic_int_least8_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:205:18: error: expected specifier-qualifier-list before ‘uint_least8_t’
 typedef _Atomic(uint_least8_t)  atomic_uint_least8_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:206:18: error: expected specifier-qualifier-list before ‘int_least16_t’
 typedef _Atomic(int_least16_t)  atomic_int_least16_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:207:18: error: expected specifier-qualifier-list before ‘uint_least16_t’
 typedef _Atomic(uint_least16_t)  atomic_uint_least16_t;
                  ^~~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:208:18: error: expected specifier-qualifier-list before ‘int_least32_t’
 typedef _Atomic(int_least32_t)  atomic_int_least32_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:209:18: error: expected specifier-qualifier-list before ‘uint_least32_t’
 typedef _Atomic(uint_least32_t)  atomic_uint_least32_t;
                  ^~~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:210:18: error: expected specifier-qualifier-list before ‘int_least64_t’
 typedef _Atomic(int_least64_t)  atomic_int_least64_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:211:18: error: expected specifier-qualifier-list before ‘uint_least64_t’
 typedef _Atomic(uint_least64_t)  atomic_uint_least64_t;
                  ^~~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:212:18: error: expected specifier-qualifier-list before ‘int_fast8_t’
 typedef _Atomic(int_fast8_t)  atomic_int_fast8_t;
                  ^~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:213:18: error: expected specifier-qualifier-list before ‘uint_fast8_t’
 typedef _Atomic(uint_fast8_t)  atomic_uint_fast8_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:214:18: error: expected specifier-qualifier-list before ‘int_fast16_t’
 typedef _Atomic(int_fast16_t)  atomic_int_fast16_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:215:18: error: expected specifier-qualifier-list before ‘uint_fast16_t’
 typedef _Atomic(uint_fast16_t)  atomic_uint_fast16_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:216:18: error: expected specifier-qualifier-list before ‘int_fast32_t’
 typedef _Atomic(int_fast32_t)  atomic_int_fast32_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:217:18: error: expected specifier-qualifier-list before ‘uint_fast32_t’
 typedef _Atomic(uint_fast32_t)  atomic_uint_fast32_t;
                  ^~~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:218:18: error: expected specifier-qualifier-list before ‘int_fast64_t’
 typedef _Atomic(int_fast64_t)  atomic_int_fast64_t;
                  ^~~~~~~~~~~~
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:219:18: error: expected specifier-qualifier-list before ‘uint_fast64_t’

@galak this is my compile error

@galak
Copy link
Collaborator

galak commented Feb 20, 2019

@Jeepgoing can you put the full build log.

Also have you tried the 0.10.0-rc3 sdk?

@Jeepgoing
Copy link
Author

@Jeepgoing can you put the full build log.

Also have you tried the 0.10.0-rc3 sdk?

full log as below, and i have tried 0.10.0-rc3 sdk, it is the same error.

amine@amine-VirtualBox:~/work/zephyr/zephyrproject/zephyr/samples/subsys/ipc/openamp/lpcxpresso54114$ ninja
[0/1] Re-running CMake...
Zephyr version: 1.14.0
-- Selected BOARD lpcxpresso54114_m4
-- Loading /home/amine/work/zephyr/zephyrproject/zephyr/boards/arm/lpcxpresso54114/lpcxpresso54114_m4.dts as base
-- Overlaying /home/amine/work/zephyr/zephyrproject/zephyr/dts/common/common.dts
lpcxpresso54114_m4.dts_compiled: Warning (simple_bus_reg): /soc/gpio@0: simple-bus unit address format error, expected "4008c000"
lpcxpresso54114_m4.dts_compiled: Warning (simple_bus_reg): /soc/gpio@1: simple-bus unit address format error, expected "4008c000"
Parsing Kconfig tree in /home/amine/work/zephyr/zephyrproject/zephyr/Kconfig
Loading /home/amine/work/zephyr/zephyrproject/zephyr/samples/subsys/ipc/openamp/lpcxpresso54114/zephyr/.config as base
Configuration written to '/home/amine/work/zephyr/zephyrproject/zephyr/samples/subsys/ipc/openamp/lpcxpresso54114/zephyr/.config'
-- Cache files will be written to: /home/amine/.cache/zephyr
-- Host:    Linux/x86_64
-- Target:  Generic/arm
-- Machine: cortexm
-- C_FLAGS :  -Wall -Wextra
-- Build type:  Debug
-- Host:    Linux/x86_64
-- Target:  Generic/arm
-- Machine: cortexm
Including module(s): 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/amine/work/zephyr/zephyrproject/zephyr/samples/subsys/ipc/openamp/lpcxpresso54114
[6/118] Building C object CMakeFiles/app.dir/src/main.c.obj
In file included from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtio.h:11:0,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:18,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/open_amp.h:12,
                 from ../src/main.c:18:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h: In function ‘metal_spinlock_acquire’:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h:47:34: warning: passing argument 1 of ‘atomic_flag_test_and_set’ from incompatible pointer type [-Wincompatible-pointer-types]
  while (atomic_flag_test_and_set(&slock->v)) {
                                  ^
In file included from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/atomic.h:19:0,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/system/zephyr/mutex.h:19,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/mutex.h:22,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg.h:16,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/open_amp.h:11,
                 from ../src/main.c:18:
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:398:1: note: expected ‘volatile atomic_flag * {aka volatile struct <anonymous> *}’ but argument is of type ‘atomic_int * {aka struct <anonymous> *}’
 atomic_flag_test_and_set(volatile atomic_flag *__object)
 ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtio.h:11:0,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:18,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/open_amp.h:12,
                 from ../src/main.c:18:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h: In function ‘metal_spinlock_release’:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h:59:20: warning: passing argument 1 of ‘atomic_flag_clear’ from incompatible pointer type [-Wincompatible-pointer-types]
  atomic_flag_clear(&slock->v);
                    ^
In file included from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/atomic.h:19:0,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/system/zephyr/mutex.h:19,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/mutex.h:22,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg.h:16,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/open_amp.h:11,
                 from ../src/main.c:18:
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:406:1: note: expected ‘volatile atomic_flag * {aka volatile struct <anonymous> *}’ but argument is of type ‘atomic_int * {aka struct <anonymous> *}’
 atomic_flag_clear(volatile atomic_flag *__object)
 ^~~~~~~~~~~~~~~~~
../src/main.c: At top level:
../src/main.c:95:18: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  .get_features = virtio_get_features,
                  ^~~~~~~~~~~~~~~~~~~
../src/main.c:95:18: note: (near initialization for ‘dispatch.get_features’)
../src/main.c:96:18: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
  .set_features = virtio_set_features,
                  ^~~~~~~~~~~~~~~~~~~
../src/main.c:96:18: note: (near initialization for ‘dispatch.set_features’)
../src/main.c: In function ‘ns_bind_cb’:
../src/main.c:133:4: warning: passing argument 6 of ‘rpmsg_create_ept’ from incompatible pointer type [-Wincompatible-pointer-types]
    endpoint_cb,
    ^~~~~~~~~~~
In file included from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/open_amp.h:11:0,
                 from ../src/main.c:18:
/home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg.h:324:5: note: expected ‘rpmsg_ept_cb {aka int (*)(struct rpmsg_endpoint *, void *, unsigned int,  long unsigned int,  void *)}’ but argument is of type ‘int (*)(struct rpmsg_endpoint *, void *, size_t,  u32_t,  void *) {aka int (*)(struct rpmsg_endpoint *, void *, unsigned int,  unsigned int,  void *)}’
 int rpmsg_create_ept(struct rpmsg_endpoint *ept, struct rpmsg_device *rdev,
     ^~~~~~~~~~~~~~~~
../src/main.c: In function ‘app_task’:
../src/main.c:240:42: warning: passing argument 3 of ‘rpmsg_init_vdev’ from incompatible pointer type [-Wincompatible-pointer-types]
  status = rpmsg_init_vdev(&rvdev, &vdev, ns_bind_cb, io, &shpool);
                                          ^~~~~~~~~~
In file included from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/open_amp.h:12:0,
                 from ../src/main.c:18:
/home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:130:5: note: expected ‘rpmsg_ns_bind_cb {aka void (*)(struct rpmsg_device *, const char *, long unsigned int)}’ but argument is of type ‘void (*)(struct rpmsg_device *, const char *, u32_t) {aka void (*)(struct rpmsg_device *, const char *, unsigned int)}’
 int rpmsg_init_vdev(struct rpmsg_virtio_device *rvdev,
     ^~~~~~~~~~~~~~~
[56/118] Building C object zephyr/ext/lib/ipc/open-amp/open-amp/lib/CMakeFiles/open_amp.dir/virtio/virtio.c.obj
In file included from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtio.h:11:0,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/virtio/virtio.c:7:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h: In function ‘metal_spinlock_acquire’:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h:47:34: warning: passing argument 1 of ‘atomic_flag_test_and_set’ from incompatible pointer type [-Wincompatible-pointer-types]
  while (atomic_flag_test_and_set(&slock->v)) {
                                  ^
In file included from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/atomic.h:19:0,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/io.h:21,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtqueue.h:24,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtio.h:10,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/virtio/virtio.c:7:
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:398:1: note: expected ‘volatile atomic_flag * {aka volatile struct <anonymous> *}’ but argument is of type ‘atomic_int * {aka struct <anonymous> *}’
 atomic_flag_test_and_set(volatile atomic_flag *__object)
 ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtio.h:11:0,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/virtio/virtio.c:7:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h: In function ‘metal_spinlock_release’:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h:59:20: warning: passing argument 1 of ‘atomic_flag_clear’ from incompatible pointer type [-Wincompatible-pointer-types]
  atomic_flag_clear(&slock->v);
                    ^
In file included from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/atomic.h:19:0,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/io.h:21,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtqueue.h:24,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtio.h:10,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/virtio/virtio.c:7:
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:406:1: note: expected ‘volatile atomic_flag * {aka volatile struct <anonymous> *}’ but argument is of type ‘atomic_int * {aka struct <anonymous> *}’
 atomic_flag_clear(volatile atomic_flag *__object)
 ^~~~~~~~~~~~~~~~~
[60/118] Building C object zephyr/ext/lib/ipc/open-amp/open-amp/lib/CMakeFiles/open_amp.dir/rpmsg/rpmsg.c.obj
FAILED: zephyr/ext/lib/ipc/open-amp/open-amp/lib/CMakeFiles/open_amp.dir/rpmsg/rpmsg.c.obj 
ccache /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc -DBUILD_VERSION=v1.14.0-rc1-348-gcda3fad5c8 -DCPU_LPC54114J256BD64_cm4 -DKERNEL -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__ZEPHYR__=1 -I../../../../../ext/lib/ipc/open-amp/open-amp/lib/include -I../../../../../kernel/include -I../../../../../arch/arm/include -I../../../../../include -I../../../../../include/drivers -Izephyr/include/generated -I../../../../../soc/arm/nxp_lpc/lpc54xxx -I/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include -I../../../../../ext/hal/cmsis/Include -Izephyr/ext/hal/libmetal/libmetal/lib/include -I../../../../../ext/hal/nxp/mcux/devices/LPC54114 -I../../../../../ext/hal/nxp/mcux/drivers/lpc/. -isystem /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/lib/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/include -isystem /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/lib/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/include-fixed -Wall -Wextra -g   -Os -g -Wall -Wformat -Wformat-security -Wno-format-zero-length -imacros /home/amine/work/zephyr/zephyrproject/zephyr/samples/subsys/ipc/openamp/lpcxpresso54114/zephyr/include/generated/autoconf.h -ffreestanding -Wno-main -fno-common --sysroot /opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr -mthumb -mcpu=cortex-m4 -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -Wno-pointer-sign -Wno-unused-but-set-variable -fno-reorder-functions -fno-defer-pop -Werror=implicit-int -Wpointer-arith -ffunction-sections -fdata-sections -mabi=aapcs -march=armv7e-m -std=c99 -MD -MT zephyr/ext/lib/ipc/open-amp/open-amp/lib/CMakeFiles/open_amp.dir/rpmsg/rpmsg.c.obj -MF zephyr/ext/lib/ipc/open-amp/open-amp/lib/CMakeFiles/open_amp.dir/rpmsg/rpmsg.c.obj.d -o zephyr/ext/lib/ipc/open-amp/open-amp/lib/CMakeFiles/open_amp.dir/rpmsg/rpmsg.c.obj   -c /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg.c
In file included from /opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:33:0,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/atomic.h:19,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/system/zephyr/mutex.h:19,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/mutex.h:22,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg.h:16,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg.c:10:
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:204:17: error: expected specifier-qualifier-list before ‘int_least8_t’
 typedef _Atomic(int_least8_t)  atomic_int_least8_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:205:17: error: expected specifier-qualifier-list before ‘uint_least8_t’
 typedef _Atomic(uint_least8_t)  atomic_uint_least8_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:206:17: error: expected specifier-qualifier-list before ‘int_least16_t’
 typedef _Atomic(int_least16_t)  atomic_int_least16_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:207:17: error: expected specifier-qualifier-list before ‘uint_least16_t’
 typedef _Atomic(uint_least16_t)  atomic_uint_least16_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:208:17: error: expected specifier-qualifier-list before ‘int_least32_t’
 typedef _Atomic(int_least32_t)  atomic_int_least32_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:209:17: error: expected specifier-qualifier-list before ‘uint_least32_t’
 typedef _Atomic(uint_least32_t)  atomic_uint_least32_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:210:17: error: expected specifier-qualifier-list before ‘int_least64_t’
 typedef _Atomic(int_least64_t)  atomic_int_least64_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:211:17: error: expected specifier-qualifier-list before ‘uint_least64_t’
 typedef _Atomic(uint_least64_t)  atomic_uint_least64_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:212:17: error: expected specifier-qualifier-list before ‘int_fast8_t’
 typedef _Atomic(int_fast8_t)  atomic_int_fast8_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:213:17: error: expected specifier-qualifier-list before ‘uint_fast8_t’
 typedef _Atomic(uint_fast8_t)  atomic_uint_fast8_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:214:17: error: expected specifier-qualifier-list before ‘int_fast16_t’
 typedef _Atomic(int_fast16_t)  atomic_int_fast16_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:215:17: error: expected specifier-qualifier-list before ‘uint_fast16_t’
 typedef _Atomic(uint_fast16_t)  atomic_uint_fast16_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:216:17: error: expected specifier-qualifier-list before ‘int_fast32_t’
 typedef _Atomic(int_fast32_t)  atomic_int_fast32_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:217:17: error: expected specifier-qualifier-list before ‘uint_fast32_t’
 typedef _Atomic(uint_fast32_t)  atomic_uint_fast32_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:218:17: error: expected specifier-qualifier-list before ‘int_fast64_t’
 typedef _Atomic(int_fast64_t)  atomic_int_fast64_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:219:17: error: expected specifier-qualifier-list before ‘uint_fast64_t’
 typedef _Atomic(uint_fast64_t)  atomic_uint_fast64_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:220:17: error: expected specifier-qualifier-list before ‘intptr_t’
 typedef _Atomic(intptr_t)  atomic_intptr_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:221:17: error: expected specifier-qualifier-list before ‘uintptr_t’
 typedef _Atomic(uintptr_t)  atomic_uintptr_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:224:17: error: expected specifier-qualifier-list before ‘intmax_t’
 typedef _Atomic(intmax_t)  atomic_intmax_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:225:17: error: expected specifier-qualifier-list before ‘uintmax_t’
 typedef _Atomic(uintmax_t)  atomic_uintmax_t;
                 ^
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/sys/cdefs.h:303:30: note: in definition of macro ‘_Atomic’
 #define _Atomic(T)  struct { T volatile __val; }
                              ^
[61/118] Building C object zephyr/ext/lib/ipc/open-amp/open-amp/lib/CMakeFiles/open_amp.dir/rpmsg/rpmsg_virtio.c.obj
In file included from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtio.h:11:0,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:18,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg_virtio.c:14:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h: In function ‘metal_spinlock_acquire’:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h:47:34: warning: passing argument 1 of ‘atomic_flag_test_and_set’ from incompatible pointer type [-Wincompatible-pointer-types]
  while (atomic_flag_test_and_set(&slock->v)) {
                                  ^
In file included from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/atomic.h:19:0,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/io.h:21,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:15,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg_virtio.c:14:
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:398:1: note: expected ‘volatile atomic_flag * {aka volatile struct <anonymous> *}’ but argument is of type ‘atomic_int * {aka struct <anonymous> *}’
 atomic_flag_test_and_set(volatile atomic_flag *__object)
 ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/virtio.h:11:0,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:18,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg_virtio.c:14:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h: In function ‘metal_spinlock_release’:
zephyr/ext/hal/libmetal/libmetal/lib/include/metal/spinlock.h:59:20: warning: passing argument 1 of ‘atomic_flag_clear’ from incompatible pointer type [-Wincompatible-pointer-types]
  atomic_flag_clear(&slock->v);
                    ^
In file included from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/atomic.h:19:0,
                 from zephyr/ext/hal/libmetal/libmetal/lib/include/metal/io.h:21,
                 from ../../../../../ext/lib/ipc/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:15,
                 from /home/amine/work/zephyr/zephyrproject/zephyr/ext/lib/ipc/open-amp/open-amp/lib/rpmsg/rpmsg_virtio.c:14:
/opt/zephyr-sdk/sysroots/armv5-zephyr-eabi/usr/include/stdatomic.h:406:1: note: expected ‘volatile atomic_flag * {aka volatile struct <anonymous> *}’ but argument is of type ‘atomic_int * {aka struct <anonymous> *}’
 atomic_flag_clear(volatile atomic_flag *__object)
 ^~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
amine@amine-VirtualBox:~/work/zephyr/zephyrproject/zephyr/samples/subsys/ipc/openamp/lpcxpresso54114$

@wjliang
Copy link
Collaborator

wjliang commented Mar 1, 2019

Please see libmetal patches: OpenAMP/libmetal#85

@galak
Copy link
Collaborator

galak commented Mar 8, 2019

@Jeepgoing should hopefully now be fixed with PR #14203.

@Jeepgoing
Copy link
Author

@galak , ok, it's work, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: C Library C Standard Library area: IPC Inter-Process Communication bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants