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

Compile with musl libc fails: error: 'mode_t' has not been declared #2072

Closed
pseiderer opened this issue Nov 1, 2023 · 0 comments · Fixed by #2073
Closed

Compile with musl libc fails: error: 'mode_t' has not been declared #2072

pseiderer opened this issue Nov 1, 2023 · 0 comments · Fixed by #2073
Assignees
Labels
bug Something isn't working

Comments

@pseiderer
Copy link
Contributor

Required information

Operating system:
openSUSE Tumbleweed/Buildroot

Compiler version:
GCC 12.3.0

Eclipse iceoryx version:
v2.0.3 and git master branch

Observed result or behaviour:
Compile fails (using buildroot with musl libc selected) with the following error message:

  In file included from .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:17:
  .../build/iceoryx-custom/iceoryx_platform/linux/include/iceoryx_platform/mqueue.hpp:23:49: error: ‘mode_t’ has not been declared
     23 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr);
        |                                                 ^~~~~~
  .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:26:49: error: ‘mode_t’ has not been declared
     26 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr)
        |                                                 ^~~~~~

Expected result or behaviour:
Compile without failure...

Conditions where it occurred / Performed steps:
Crosscompile using Buildroot and musl libc selected in the configuration

pseiderer added a commit to pseiderer/iceoryx that referenced this issue Nov 1, 2023
… (fixes musl compile)

As stated in the mq_open man page ([1]) the mqueue.h include needs
additional sys/stat.h include for mode_t definition.

Fixes musl compile:

  In file included from .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:17:
  .../build/iceoryx-custom/iceoryx_platform/linux/include/iceoryx_platform/mqueue.hpp:23:49: error: ‘mode_t’ has not been declared
     23 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr);
        |                                                 ^~~~~~
  .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:26:49: error: ‘mode_t’ has not been declared
     26 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr)
        |                                                 ^~~~~~

[1] https://man7.org/linux/man-pages/man3/mq_open.3.html

Signed-off-by: Peter Seiderer <[email protected]>
pseiderer added a commit to pseiderer/iceoryx that referenced this issue Nov 1, 2023
… (fixes musl compile)

As stated in the mq_open man page ([1]) the mqueue.h include needs
additional sys/stat.h include for mode_t definition.

Fixes musl compile:

  In file included from .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:17:
  .../build/iceoryx-custom/iceoryx_platform/linux/include/iceoryx_platform/mqueue.hpp:23:49: error: ‘mode_t’ has not been declared
     23 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr);
        |                                                 ^~~~~~
  .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:26:49: error: ‘mode_t’ has not been declared
     26 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr)
        |                                                 ^~~~~~

[1] https://man7.org/linux/man-pages/man3/mq_open.3.html

Signed-off-by: Peter Seiderer <[email protected]>
@elBoberido elBoberido added the bug Something isn't working label Nov 1, 2023
pseiderer added a commit to pseiderer/iceoryx that referenced this issue Nov 1, 2023
… (fixes musl compile)

As stated in the mq_open man page ([1]) the mqueue.h include needs
additional sys/stat.h include for mode_t definition.

Fixes musl compile:

  In file included from .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:17:
  .../build/iceoryx-custom/iceoryx_platform/linux/include/iceoryx_platform/mqueue.hpp:23:49: error: ‘mode_t’ has not been declared
     23 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr);
        |                                                 ^~~~~~
  .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:26:49: error: ‘mode_t’ has not been declared
     26 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr)
        |                                                 ^~~~~~

[1] https://man7.org/linux/man-pages/man3/mq_open.3.html

Signed-off-by: Peter Seiderer <[email protected]>
pseiderer added a commit to pseiderer/iceoryx that referenced this issue Nov 5, 2023
… (fixes musl compile)

As stated in the mq_open man page ([1]) the mqueue.h include needs
additional sys/stat.h include for mode_t definition.

Fixes musl compile:

  In file included from .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:17:
  .../build/iceoryx-custom/iceoryx_platform/linux/include/iceoryx_platform/mqueue.hpp:23:49: error: ‘mode_t’ has not been declared
     23 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr);
        |                                                 ^~~~~~
  .../build/iceoryx-custom/iceoryx_platform/linux/source/mqueue.cpp:26:49: error: ‘mode_t’ has not been declared
     26 | mqd_t iox_mq_open4(const char* name, int oflag, mode_t mode, struct mq_attr* attr)
        |                                                 ^~~~~~

[1] https://man7.org/linux/man-pages/man3/mq_open.3.html

Signed-off-by: Peter Seiderer <[email protected]>
FerdinandSpitzschnueffler added a commit that referenced this issue Nov 6, 2023
…mpile-001

iox-#2072 Include mqueue.h needs sys/stat.h for mode_t (fixes musl compile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants