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

Cpp compatibility #7

Closed

Conversation

sergeyblagodarnyy
Copy link

There were simple drawback which didn't allow OpenAMP labrary code to be used in C++ code.

@arnopo
Copy link

arnopo commented Aug 9, 2021

Hello @sergeyblagodarnyy,
Could you detail how to reproduce the issue ?
As there are several users of openAMP libs in c++, and as this mechanism is used in several libmetal includes file, we need to have a deeper understanding of the issue.
Thanks in advance

@sergeyblagodarnyy
Copy link
Author

sergeyblagodarnyy commented Nov 16, 2021

Hello @sergeyblagodarnyy, Could you detail how to reproduce the issue ? As there are several users of openAMP libs in c++, and as this mechanism is used in several libmetal includes file, we need to have a deeper understanding of the issue. Thanks in advance

Hello @arnopo ,
Sorry for the late reply.

I created a separate repository special for testing this issue. The problem occurs when you include the openamp / open_amp.h header file. In my case, if I work with STM32CubeMP1 version 1.4.0 or 1.5.0, I get the following errors:
/home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/gcc/arm-none-eabi/include/c++/10.2.1/type_traits:142:3: error: template with C linkage 142 | template<typename _B1, typename _B2, typename _B3, typename... _Bn> | ^~~~~~~~ In file included from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/STM32CubeMP1/Middlewares/Third_Party/OpenAMP/open-amp/lib/include/openamp/rpmsg.h:16, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/STM32CubeMP1/Middlewares/Third_Party/OpenAMP/open-amp/lib/include/openamp/open_amp.h:11, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/empty_main.cpp:1: /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/STM32CubeMP1/Middlewares/Third_Party/OpenAMP/libmetal/lib/include/metal/mutex.h:16:1: note: 'extern "C"' linkage started here 16 | extern "C" { | ^~~~~~~~~~ In file included from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/gcc/arm-none-eabi/include/c++/10.2.1/bits/move.h:57, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/gcc/arm-none-eabi/include/c++/10.2.1/bits/atomic_base.h:38, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/gcc/arm-none-eabi/include/c++/10.2.1/atomic:41, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/STM32CubeMP1/Middlewares/Third_Party/OpenAMP/libmetal/lib/include/metal/atomic.h:26, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/STM32CubeMP1/Middlewares/Third_Party/OpenAMP/libmetal/lib/include/metal/system/generic/mutex.h:19, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/STM32CubeMP1/Middlewares/Third_Party/OpenAMP/libmetal/lib/include/metal/mutex.h:23, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/STM32CubeMP1/Middlewares/Third_Party/OpenAMP/open-amp/lib/include/openamp/rpmsg.h:16, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/arm-tools/STM32CubeMP1/Middlewares/Third_Party/OpenAMP/open-amp/lib/include/openamp/open_amp.h:11, from /home/sergey/projects/developUTC/sandbox/rpmsg_cpp_compatibility/empty_main.cpp:1:

The proposed fixes resolve this issue. Best regards!

@sergeyblagodarnyy
Copy link
Author

I wrote the README to show how to build the project. It uses:

  • gcc-arm-none-eabi-10-2020-q4-major toolchain
  • STM32CubeMP1 library
  • stm32-cmake project to simplify cmake work with the STM32CubeMP1
    If you have some troubles with building the project, let me know, please.

@arnopo
Copy link

arnopo commented Nov 16, 2021

I can not find the gcc-arm-none-eabi repository on Faramax github
Is it private?

@sergeyblagodarnyy
Copy link
Author

I can not find the gcc-arm-none-eabi repository on Faramax github Is it private?

Yes it was by mistake. Sorry. I've opened it now.

@sergeyblagodarnyy
Copy link
Author

If you have any trouble with this repository again, please, download gcc-arm-none-eabi-10-2020-q4-major to the arm-tools/gcc directory. It is a usual toolchain. Nothing specific.

@arnopo
Copy link

arnopo commented Nov 17, 2021

the 7z file seems corrupted.
I got the gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux toolchain from arm site but I'm not able to compile due to deprecated option mcpu and mabi.
I try to fix but this lead to some other error.
c++: error: nosys.specs: No such file or directory
Could you fix the gcc-arm-none-eabi-10-2020-q4-major repo?

@sergeyblagodarnyy
Copy link
Author

the 7z file seems corrupted. I got the gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux toolchain from arm site but I'm not able to compile due to deprecated option mcpu and mabi. I try to fix but this lead to some other error. c++: error: nosys.specs: No such file or directory Could you fix the gcc-arm-none-eabi-10-2020-q4-major repo?

That's weird. I've just now repeated the build steps. Everything is ok. The archive is normal.
image

Could you show me the error message?

I didn't mention the need to execute git submodule init before git submodule update.

@sergeyblagodarnyy
Copy link
Author

the 7z file seems corrupted. I got the gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux toolchain from arm site but I'm not able to compile due to deprecated option mcpu and mabi. I try to fix but this lead to some other error. c++: error: nosys.specs: No such file or directory Could you fix the gcc-arm-none-eabi-10-2020-q4-major repo?

And you have to have installed git-lfs
git lfs install

@arnopo
Copy link

arnopo commented Nov 17, 2021

The git-lfs was missing. Now i'm able to reproduce the issue.

  • The issue in Middlewares/Third_Party/OpenAMP/open-amp/lib/include/openamp/virtqueue.h is fixed in 1.5
  • I have entered an internal ticket to fix include issue.

Thanks!

ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this pull request Dec 3, 2021
See STMicroelectronics/STM32CubeMP1#7
The header files including must be outside of the extern "C" { statement.
To be able to be included from C++ code
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this pull request Dec 3, 2021
See STMicroelectronics/STM32CubeMP1#7
The header files including must be outside of the extern "C" { statement.
To be able to be included from C++ code
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this pull request Dec 3, 2021
See STMicroelectronics/STM32CubeMP1#7
The header files including must be outside of the extern "C" { statement.
To be able to be included from C++ code
ABOSTM added a commit to ABOSTM/Arduino_Core_STM32 that referenced this pull request Dec 3, 2021
See STMicroelectronics/STM32CubeMP1#7
The header files including must be outside of the extern "C" { statement.
To be able to be included from C++ code
@BernardPuel
Copy link
Contributor

delivered in v1.6.0.

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

Successfully merging this pull request may close these issues.

3 participants