I started playing with Petalinux on my KC705 board before the holidays
and successfully get Petalinux to boot. Now I am trying to cross compile
EPICS base to run it on the Microblaze but I am running into some
compile problems which are making me think I am doing something wrong.
Any advice or suggestion from your experience would be greatly
appreciated.
The existing linux-microblaze target configuration was created many years ago for some systems here at APS that are built using gcc-4.1.2 and followed the standard naming patterns for GCC installations. I haven’t tried building EPICS 7
for that target recently but I don’t think there have been any changes to EPICS which would have broken our setup. This is a 3-deep tree of the prefix directory that GNU_DIR points to in our installation:
microblazeel-unknown-linux-gnu/
├── bin
├── include
│ └── c++
│ └── 4.1.2
├── lib
│ └── gcc
│ └── microblazeel-unknown-linux-gnu
├── libexec
│ └── gcc
│ └── microblazeel-unknown-linux-gnu
├── microblazeel-unknown-linux-gnu
│ ├── bin
│ ├── debug-root
│ ├── lib -> .//sys-root/lib
│ └── sys-root
│ ├── etc
│ ├── lib
│ └── usr
└── share
19 directories
The top-level bin directory contains all the build tools such as microblazeel-unknown-linux-gnu-gcc, the bin directory under the inner target directory just has a subset of the shorter-named tools “ar as c++ g++ gcc ld nm objdump ranlib
strip”.
More recent Xilinx SDK tool-sets that we have installed have a slightly different internal layout but still work with EPICS when GNU_DIR is pointed at the equivalent prefix directory, e.g.:
aarch64-linux/
├── aarch64-linux-gnu
│ ├── bin
│ ├── include
│ ├── lib
│ ├── lib64
│ └── libc
├── bin
├── include
│ └── gdb
├── lib
│ ├── gcc
│ └── ldscripts
├── lib64
├── libexec
│ └── gcc
└── share
├── dejagnu
├── doc
├── gcc-7.3.1
├── gdb
├── info
├── locale
└── man
23 directories
As before, the top-level bin directory contains all the build tools with long names such as aarch64-linux-gnu-gcc while the inner bin directory has a smaller subset such as ar and as, but interestingly that now excludes gcc and g++. The
GNU_TARGET setting there is aarch64-linux-gnu.
I have the 2024.1 version of Petalinux along with the rest of the Xilinx
(AMD) tools installed on a Ubuntu 22.04.5 LTS. I used the provided BSP
which boots successfully and from it I generated the SDK which contains
the sysroots. Sysroots contains 2 folders:
"microblazeel-v11.0-bs-cmp-re-mh-div-fb-xilinx-linux" and
"x86_64-petalinux-linux". The "x86_64-petalinux-linux" folder contains
the compilers.
I don’t know what your “I generated the SDK which contains the sysroots” step refers to, we normally just install the Xilinx SDK which provides everything, but I could believe that newer GCC versions might need some extra steps.
I edited the CONFIG_SITE in /configure
-> CROSS_COMPILER_TARGET_ARCHS=linux-microblaze
I edited the CONFIG_SITE.Common.linux-microblaze file in /configure/os
-> GNU_DIR =
/home/donny/Xilinx/KC705_Petalinux/images/linux/sdk/sysroots
-> GNU_TARGET=microblazeel-v11.0-bs-cmp-re-mh-div-fb-xilinx-linux
That looks like the wrong GNU_TARGET setting to me, it should be just the compiler prefix, i.e.
GNU_TARGET=microblazeel-xilinx-linux
It looks like your SDK layout is different to the standard cross-compiler layout that we used to get. If that’s the case, you may have more work to get EPICS to cross-build. The EPICS file configure/CONFIG.CrossCommon
was written for the standard layout that cross-gcc builds used to install, but your paths below look different, e.g. your <gnu-target>-gcc is installed into a <gnu-target> subdirectory of the bin directory. That’s similar to where EPICS installs binaries that
it builds, but we don’t expect that of GCC installations.
Is there some other way you can generate/install the SDK with a more standard layout?
Please continue this conversation on tech-talk, others here have experience with this topic and might have ideas or suggestions.
- Andrew
When I try to compile the linux-x86_64 compiles without a problem
finding the compilers. But when compiling linux-microblaze it does not
find the compilers because there are not in the
"microblazeel-v11.0-bs-cmp-re-mh-div-fb-xilinx-linux" folder. If i
manually add the locations of the compilers in the
CONFIG_SITE.Common.linux-microblaze file:
CC =
/home/donny/Xilinx/KC705_Petalinux/images/linux/sdk/sysroots/x86_64-petalinux-linux/usr/bin/microblazeel-xilinx-linux/microblazeel-xilinx-linux-gcc
CCC =
/home/donny/Xilinx/KC705_Petalinux/images/linux/sdk/sysroots/x86_64-petalinux-linux/usr/bin/microblazeel-xilinx-linux/microblazeel-xilinx-linux-g++
LD =
home/donny/Xilinx/KC705_Petalinux/images/linux/sdk/sysroots/x86_64-petalinux-linux/usr/bin/microblazeel-xilinx-linux/microblazeel-xilinx-linux-ld
AR =
home/donny/Xilinx/KC705_Petalinux/images/linux/sdk/sysroots/x86_64-petalinux-linux/usr/bin/microblazeel-xilinx-linux/microblazeel-xilinx-linux-ar
When i try to make using this configurations i get the following error:
/home/donny/Xilinx/KC705_Petalinux/images/linux/sdk/sysroots/x86_64-petalinux-linux/usr/lib/microblazeel-xilinx-linux/gcc/microblazeel-xilinx-linux/12.2.0/include-fixed/limits.h:203:75:
error: no include path in which to search for limits.h
I think this is because it is using the wrong include folder, it should
be using the one from the microblazeel directory. If i edit
GNU_TARGET_INCLUDE_DIR and GNU_TARGET_LIB_DIR it compiles further but
then cannot find sub directories that are required. This makes me think
that this is not the proper way resolve this problem.
I hope someone has some experience with this as any advice would be very
welcome, I cannot think of anything else to try.
Regards,
--
Donny Domagoj Cosic