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

Native CAN device does not build when VFS is used #8922

Closed
vincent-d opened this issue Apr 11, 2018 · 3 comments · Fixed by #8940
Closed

Native CAN device does not build when VFS is used #8922

vincent-d opened this issue Apr 11, 2018 · 3 comments · Fixed by #8940
Assignees
Labels
Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@vincent-d
Copy link
Member

Description

Cannot build candev_linux when vfs is used.
Bisecting returned 93a521c as the culprit (introduced in #8652)

Steps to reproduce the issue

cd tests/conn_can
USEMODULE=vfs make BOARD=native

Expected results

Build OK

Actual results

/home/vincent/Devel/git/RIOT/cpu/native/can/candev_linux.c: In function ‘_init’:
/home/vincent/Devel/git/RIOT/cpu/native/can/candev_linux.c:165:29: error: ‘PF_CAN’ undeclared (first use in this function); did you mean ‘AF_MAX’?
     dev->sock = real_socket(PF_CAN, SOCK_RAW, CAN_RAW);
                             ^~~~~~
                             AF_MAX
/home/vincent/Devel/git/RIOT/cpu/native/can/candev_linux.c:165:29: note: each undeclared identifier is reported only once for each function it appears in
/home/vincent/Devel/git/RIOT/cpu/native/can/candev_linux.c:198:23: error: ‘AF_CAN’ undeclared (first use in this function); did you mean ‘PF_CAN’?
     addr.can_family = AF_CAN;
                       ^~~~~~
                       PF_CAN

Versions

Installed compiler toolchains 
-----------------------------
           native gcc: gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0
    arm-none-eabi-gcc: arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
              avr-gcc: missing
     mips-mti-elf-gcc: missing
           msp430-gcc: msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)
                clang: clang version 4.0.1-6 (tags/RELEASE_401/final)
@vincent-d vincent-d added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Apr 11, 2018
@cladmi
Copy link
Contributor

cladmi commented Apr 11, 2018

Indeed, our posix headers do not define the PF_ macros.

I will verify if defining them would be safe with a handwritten value or if #8652 should be reverted.

@cladmi
Copy link
Contributor

cladmi commented Apr 12, 2018

I missed one thing with posix in the given PR, what is defined in the standard is only symbols not the values.

So even right now, if we look at the values of AF_INET6, they are not compatible:

  • RIOT: 4
  • Linux: 10
  • MAC: 30

So using our posix headers in interaction with Linux is problematic. So I will revert the PR.

@cladmi
Copy link
Contributor

cladmi commented Apr 12, 2018

With the reverted, the compilation works:

USEMODULE=vfs make -C tests/conn_can BOARD=native

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants