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

Supported compilers, architectures, language versions #494

Open
rettichschnidi opened this issue Nov 6, 2020 · 8 comments
Open

Supported compilers, architectures, language versions #494

rettichschnidi opened this issue Nov 6, 2020 · 8 comments

Comments

@rettichschnidi
Copy link
Contributor

rettichschnidi commented Nov 6, 2020

I could not find any documentation regarding targeted (supported) compilers/architectures/languages/etc. Did I miss something?

If not, my needs/proposal would be:

  • Compilers:
    • Latest version of GCC
    • Latest version of Clang
  • Architectures:
    • x86_64 on Linux
    • MIPSel 32 bit on Linux
    • ARMv5/armel 32 bit on Linux
  • Language versions:
    • C99/C11: Fully supported
    • C90: Only for what might become a 1.x maintenance branch (❓ Future of 1.0 version ❓ #487). No longer supported in master, relieving the project from its restrictions.
    • C++: While Wakaama contains no C++ code, it must be usable from a C++ project.
@sbertin-telular
Copy link
Contributor

My primary use is on a non-Linux system using the IAR compiler. It isn't practical to add my environment as supported, but I would not like to see any gcc/clang extensions used or Linux assumed outside of the examples. I would like for this to continue to be usable on constrained devices where running Linux isn't possible or practical.

@tuve
Copy link
Contributor

tuve commented Nov 6, 2020

My primary use is also on a non Linux system. On the embedded devices i think we run it with free rtos or bara bone on the mcu and then we also run it as a server as a library on iOS. I think there is also some (non linux) desktop use for testing as well.

@rettichschnidi
Copy link
Contributor Author

My primary use is on a non-Linux system using the IAR compiler.

Which architecture? ARM? Something with less than 32 bits?

It isn't practical to add my environment as supported, but I would not like to see any gcc/clang extensions used or Linux assumed outside of the examples.

Regarding the extensions: How about adding a build configuration to CI which builds the "library" parts using -Wpedantic and "-Werror"?
Regarding non-Linux targets: Do you need Wakaama, client and/or server, to work with freestanding C implementations? Or is there some kind of OS?

@sbertin-telular
Copy link
Contributor

I'm currently using an Arm Cortex-M3 based system, so 32-bit.

A CI build of the library parts with -Wpedantic and -Werror would probably be helpful.

I'm currently using an RTOS, but would like to see it continue to be possible to use it without an OS. As an example, adding mutexes (provided by the implementer) for thread safety would be OK, but requiring multiple threads would not. The mutex functions could then do nothing in a no-OS environment.

@sbernard31 sbernard31 pinned this issue Apr 1, 2021
@rettichschnidi
Copy link
Contributor Author

PR #575 will ensure Wakaama can be built with C99 (and C11) as well as keeping GNU specific compiler extensions out of the code base.

rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
Ubuntu 20.04 supports neither mipsel and armel, therefore trying to use
images based on Debian, which does.

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 5, 2021
Most of this is a workaround for the fact that...
- Ubuntu 20.04 does not support ARMv6
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Support for more architectures can be added once this is resolved:
balena-io-library/resin-rpi-raspbian#104

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 5, 2021
Most of this is a workaround for the fact that...
- Ubuntu 20.04 does not support ARMv6
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Support for more architectures can be added once this is resolved:
balena-io-library/resin-rpi-raspbian#104

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 5, 2021
Most of this is a workaround for the fact that...
- Ubuntu 20.04 does not support ARMv6
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Support for more architectures can be added once this is resolved:
balena-io-library/resin-rpi-raspbian#104

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
Most of this is a workaround for the fact that...
- Ubuntu 20.04 does not support many architectures
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 6, 2021
Most of this is a workaround for the fact that...
- Ubuntu 20.04 does not support many architectures
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
This is more complex than it should be because...
- Ubuntu 20.04 does not support many architectures, Debian does (e.g.
  ARMv5, MIPSel)
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 6, 2021
This also fixes the CMake build on big endian architectures.

This is more complex than it should be because...
- Ubuntu 20.04 does not support many architectures, Debian does (e.g.
  ARMv5, MIPSel)
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 6, 2021
This also fixes the CMake build on big endian architectures.

This is more complex than it should be because...
- Ubuntu 20.04 does not support many architectures, Debian does (e.g.
  ARMv5, MIPSel)
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 7, 2021
This also fixes the CMake build on big endian architectures.

This is more complex than it should be because...
- Ubuntu 20.04 does not support many architectures, Debian does (e.g.
  ARMv5, MIPSel)
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 7, 2021
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 7, 2021
This also fixes the CMake build on big endian architectures.

This is more complex than it should be because...
- Ubuntu 20.04 does not support many architectures, Debian does (e.g.
  ARMv5, MIPSel)
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 7, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 7, 2021
This also fixes the CMake build on big endian architectures and the unit
tests on aarch64, s390x, ppc64le.

This is more complex than it should be because...
- Ubuntu 20.04 does not support many architectures, Debian does (e.g.
  ARMv5, MIPSel)
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 7, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 7, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 7, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 8, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 8, 2021
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 9, 2021
This also fixes the CMake build on big endian architectures and the unit
tests on aarch64, s390x, ppc64le.

This is more complex than it should be because...
- Ubuntu 20.04 does not support many architectures, Debian does (e.g.
  ARMv5, MIPSel)
- CMake versions before 3.19 are affected by
  https://gitlab.kitware.com/cmake/cmake/-/issues/20568

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 9, 2021
A buffer filled with a float string followed by non-numeric data is a
valid input.

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to rettichschnidi/wakaama that referenced this issue Apr 9, 2021
Leveraging the C99 implementation strtod() simplifies and corrects the
code, at the cost of one additional memory allocation.

Some additional tests have been added to cover the corner cases. However,
as we can not (yet) instrument lwm2m_malloc(), memory exhaustion is not
tested.

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 9, 2021
Leveraging the C99 implementation strtod() simplifies and corrects the
code, at the cost of one additional memory allocation.

Some additional tests have been added to cover the corner cases. However,
as we can not (yet) instrument lwm2m_malloc(), memory exhaustion is not
tested.

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 9, 2021
Leveraging the C99 implementation strtod() simplifies and corrects the
code, at the cost of one additional memory allocation.

Some additional tests have been added to cover the corner cases. However,
as we can not (yet) instrument lwm2m_malloc(), memory exhaustion is not
tested.

Signed-off-by: Reto Schneider <[email protected]>
rettichschnidi added a commit to husqvarnagroup/wakaama that referenced this issue Apr 9, 2021
Leveraging the C99 implementation strtod() simplifies and corrects the
code, at the cost of one additional memory allocation.

Some additional tests have been added to cover the corner cases. However,
as we can not (yet) instrument lwm2m_malloc(), memory exhaustion is not
tested.

Signed-off-by: Reto Schneider <[email protected]>
@tuve
Copy link
Contributor

tuve commented Apr 12, 2021

@rettichschnidi @sbernard31 can we close this?

@rettichschnidi
Copy link
Contributor Author

From the points I wanted to address, just "C99/C11: Fully supported" and "x86_64 on Linux" have been fully implemented. Everything else is still open and/or implemented partially. Also, I'd like to have some kind of documentation about the decisions taken - having #586 would help with this.

@mlasch
Copy link
Contributor

mlasch commented Jun 29, 2023

What should be the baseline platform we can safely rely on in Wakaama? I would assume we can use standard C functions (C99), but malloc and free are already wrapped in platform.c. memcpy in contrast is not wrapped.

I understand that we don't want to rely on Unix-like operating systems, but what about POSIX?

In #709 I want to use functions from benntoh and htobenn which clearly fall into the Unix-like category. I agree it might make sense here to have a more portable solution.

Finally, if we want to support RTOS/freestanding C implementations we should include a representative example in the build pipeline to guarantee support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants