Cross-compiling for ARM

260 views
Skip to first unread message

ott...@gmail.com

unread,
Dec 15, 2017, 7:39:38 AM12/15/17
to Pothos Users
Hello,

i'm trying to cross compile PhotosCore for Zynq ARM. Simple toollchain config like following didn't help with the error, that "... arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory"

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_SYSROOT /opt/pothos/zynq/rootfs)
set(CMAKE_STAGING_PREFIX /opt/pothos/zynq/stage)

set(tools /opt/Xilinx/SDK/2017.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi)
set(CMAKE_C_COMPILER ${tools}/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-linux-gnueabihf-g++)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

Do you have a description how to cross compile the PothosCore for ARM?

best regards

Josh Blum

unread,
Dec 18, 2017, 5:16:40 PM12/18/17
to pothos...@googlegroups.com
I can tell you that as of now PothosCore will not cross compile simply
because its compiles it own tool that it uses to parse the block
description. The cmake solution is to import the executable from a
native build, but nobody had asked about cross compiling so I never
added it :-)

But besides PothosCore itself, you would need several dependencies to
also be cross compiled. So my recommendation (and how I currently
customize rootfs for arm) is to use qemu-arm-static and chroot. So you
just build with the regular build process in a chroot on your x86 machine.

[1]
https://unix.stackexchange.com/questions/41889/how-can-i-chroot-into-a-filesystem-with-a-different-architechture

-josh

ott...@gmail.com

unread,
Dec 19, 2017, 1:44:53 PM12/19/17
to Pothos Users
You are right with PothosUtil for the DOC generation.

I got the cross-compile tool chain running for Zynq.
1. One need to compile missed libs like spuce and hlohmann from source and put the libs into the  /usr/lib of the target root fs.
2. change POTHOS_UTIL variable in the cmake config file to show to the local PothosUtil of the host machine
3. Audio blocks requires portaudio and jack2 libs. As far as i don't need the audio devices, audio blocks were just removed from the cmake list.
4. the very first error appeared , because libc was not in the root fs of the target.

Now PothosUtil works on Zynq.
Reply all
Reply to author
Forward
0 new messages