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

compiling native_posix64 with unistd.h & net/net_ip.h fail #19164

Closed
ehudmarvell opened this issue Sep 15, 2019 · 2 comments
Closed

compiling native_posix64 with unistd.h & net/net_ip.h fail #19164

ehudmarvell opened this issue Sep 15, 2019 · 2 comments
Assignees
Labels
area: native port Host native arch port (native_sim) area: Networking area: POSIX POSIX API Library bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@ehudmarvell
Copy link
Contributor

ehudmarvell commented Sep 15, 2019

posix64 comilation fail on:

/usr/include/unistd.h:277:21: error: conflicting types for ‘socklen_t’
typedef __socklen_t socklen_t;
^~~~~~~~~
In file included from ../src/main.c:9:0:
/home/ehudn/work/new_zephyr/zephyr/include/net/net_ip.h:154:16: note: previous declaration of ‘socklen_t’ was here
typedef size_t socklen_t;
^~~~~~~~~

To Reproduce
1.
add to helloworld app the following lines

#include <net/net_ip.h>
#include <unistd.h>

  1. cd samples/hello_world/
  2. mkdir build
  3. cd build
  4. cmake -GNinja -DBOARD=native_posix64 ..
  5. use the attaching config
    config.txt
  6. ninja
  7. See error

Expected behavior
compilation pass

Environment:

  • OS: LINUX
  • Toolchain Zephyr SDK
  • Commit SHA: a4f4f6d
@ehudmarvell ehudmarvell added the bug The issue is a bug, or the PR is fixing a bug label Sep 15, 2019
@aescolar aescolar added the area: native port Host native arch port (native_sim) label Sep 16, 2019
@ioannisg ioannisg added the priority: medium Medium impact/importance bug label Sep 23, 2019
@pfalcon pfalcon changed the title compiling posix 64 with unistd.h & net/net_ip.h fail compiling native_posix64 with unistd.h & net/net_ip.h fail Oct 23, 2019
@pfalcon
Copy link
Contributor

pfalcon commented Oct 23, 2019

native_posix* targets: a) leak host headers into the build; b) not compatible with Zephyr POSIX subsystem (because there's no proper separation between host vs Zephyr POSIX layers). This is known problem, see e.g. #13054

Unassigning from myself and assigning to @aescolar. I'd also suggest to lower priority of this (because this is effectively a known limitation of native_posix* targets).

@pfalcon pfalcon assigned aescolar and unassigned pfalcon Oct 23, 2019
@aescolar
Copy link
Member

@ehudmarvell This is a not a bug as such, as much as something that was willingly chosen to stop supporting :( . You can see some history in #13054. You can also see #13540 where the POSIX API shim was disabled in native_posix targets.
I will be closing this ticket as you are trying to do something which is just not supported. If you would like this to be supported you could either create a "feature request", or chip-in in #13540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: native port Host native arch port (native_sim) area: Networking area: POSIX POSIX API Library bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants