-
Notifications
You must be signed in to change notification settings - Fork 294
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
OpenAMP library v2023.10 build failure #532
Comments
This issue has been marked as a stale issue because it has been open (more than) 45 days with no activity. |
For Now, Clients are expected to pass XLNX_PLATFORM definition during compile command with -D option. For AMD-Xilinx petalinux builds, it will be passed via Yocto recipe. However, this should be fixed in libmetal in a way where XLNX_PLATFORM flag should not be required. |
@edmooring could you please post steps to reproduce this error ? |
@tnmysh The process is a bit complicated. @bentheredonethat showed me how to do it 4+ years ago.
I have attached the toolchain files and and CMake commands I use. |
Hi @edmooring can you pass the definition in your toolchain file so that it is present in the CMake cache? Or as Tanmay suggested pass the command in the cmake configure step. in the future one scalable approach we can take is to instead add cmake logic to set/get a property based on the machine since a property can be used at multiple scopes. |
Adding it to the toolchain file is a usable workaround for now. I don't like introducing additional coupling between the liberal and open-amp library builds. It requires additional documentation and sets a bad precedent. |
@edmooring how about if we have these toolchain files in respective upstream repositories ? Then in README, we can provide steps how to get necessary library from Xilinx's BSP and then people can build libmetal and openamp libs only using cmake and any toolchain they want. |
can we also instead move it into a CFLAG? that way @tnmysh it can be done on the command line or in toolchain file we already do this to denote the processor for example (-DARMR5) |
This issue has been marked as a stale issue because it has been open (more than) 45 days with no activity. |
cd /OpenAMP-Project/gh3/open-amp/build_r5/lib && /opt/arm/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc -I/OpenAMP-Project/gh3/libmetal/build_r5/lib/include -I/OpenAMP-Project/gh3/open-amp/lib/include -I/OpenAMP-Project/gh3/open-amp/build_r5/include/generated/openamp -mfloat-abi=hard -mcpu=cortex-r5 -Os -mfpu=vfpv3-d16 -DUNDEFINE_FILE_OPS -Wall -Wextra -Wcast-align -I/OpenAMP-Project/gh3/open-amp/../libmetal/usr/local/include -I/home/mooring/build-oa/psu_cortexr5_0/include -Wall -Wextra -MD -MT lib/CMakeFiles/open_amp-static.dir/virtio/virtio.c.obj -MF CMakeFiles/open_amp-static.dir/virtio/virtio.c.obj.d -o CMakeFiles/open_amp-static.dir/virtio/virtio.c.obj -c /OpenAMP-Project/gh3/open-amp/lib/virtio/virtio.c
In file included from /OpenAMP-Project/gh3/libmetal/build_r5/lib/include/metal/sys.h:85,
from /OpenAMP-Project/gh3/libmetal/build_r5/lib/include/metal/io.h:22,
from /OpenAMP-Project/gh3/open-amp/lib/include/openamp/virtqueue.h:22,
from /OpenAMP-Project/gh3/open-amp/lib/include/openamp/virtio.h:10,
from /OpenAMP-Project/gh3/open-amp/lib/virtio/virtio.c:7:
/OpenAMP-Project/gh3/libmetal/build_r5/lib/include/metal/system/generic/sys.h:29:10: fatal error: ./zynqmp_r5/sys.h: No such file or directory
29 | #include "./zynqmp_r5/sys.h"
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [lib/CMakeFiles/open_amp-static.dir/build.make:90: lib/CMakeFiles/open_amp-static.dir/virtio/virtio.c.obj] Error 1
make[2]: Leaving directory '/OpenAMP-Project/gh3/open-amp/build_r5'
make[1]: *** [CMakeFiles/Makefile2:187: lib/CMakeFiles/open_amp-static.dir/all] Error 2
make[1]: Leaving directory '/OpenAMP-Project/gh3/open-amp/build_r5'
The relevant code is:
'''
#ifdef XLNX_PLATFORM
#include <metal/system/generic/xlnx/sys.h>
#else
#include "./@PROJECT_MACHINE@/sys.h"
#endif
'''
The problem is that XLNX_PLATFORM is defined as a compiler option in libmetal. There is no mechanism to pass this definition along to clients of the libmetal library such as open-amp. Therefore XLNX_PLATFORM is always undefined when building the open-amp library. It appears this only affects Xilinx platforms that are built using an external toolchain.
The text was updated successfully, but these errors were encountered: