Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Petalinux to build custom apps that use Xen libraries
#11
(10-13-2017, 12:05 PM)Nathan.Studer Wrote:
(10-11-2017, 09:38 PM)brettstahlman Wrote: I attempted to follow the instructions in section 5.3, but after running for a long time, the buildroot make failed at 'target-finalize'. I've pasted the output (beginning with the first error) below... I can re-run and capture all output if it would be helpful. Note that rootfs.tar was not built.

Thanks,
Brett S.

Code:
.
.
>>>   Finalizing target directory
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/luarocks
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/perl5/5.20.1/pod
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/perl5/5.20.1/aarch64-linux/CORE
find /home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/perl5/ -name 'extralibs.ld' -print0 | xargs -0 rm -f
find /home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/perl5/ -name '*.bs' -print0 | xargs -0 rm -f
find /home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/perl5/ -name '.packlist' -print0 | xargs -0 rm -f
find /home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/python3.4 -name '*.py' -print0 | xargs -0 rm -f
grep -q '^hvc0$' /home/bstahlman/XZD_20161231/buildroot/output/target/etc/securetty || echo 'hvc0' >> /home/bstahlman/XZD_20161231/buildroot/output/target/etc/securetty
mkdir -p /home/bstahlman/XZD_20161231/buildroot/output/target/etc
echo "xilinx-buildroot" > /home/bstahlman/XZD_20161231/buildroot/output/target/etc/hostname
/bin/sed -i -e '$a \127.0.1.1\txilinx-buildroot' -e '/^127.0.1.1/d' /home/bstahlman/XZD_20161231/buildroot/output/target/etc/hosts
mkdir -p /home/bstahlman/XZD_20161231/buildroot/output/target/etc
echo "Welcome to Buildroot" > /home/bstahlman/XZD_20161231/buildroot/output/target/etc/issue
mkdir -p /home/bstahlman/XZD_20161231/buildroot/output/target/etc/network/
( echo "# interface file auto-generated by buildroot"; echo ; echo "auto lo"; echo "iface lo inet loopback"; ) > /home/bstahlman/XZD_20161231/buildroot/output/target/etc/network/interfaces
[ -n "root" ] && TARGET_GENERIC_ROOT_PASSWD_HASH=$(/home/bstahlman/XZD_20161231/buildroot/output/host/usr/bin/mkpasswd -m "md5" "root"); /bin/sed -i -e "s,^root:[^:]*:,root:$TARGET_GENERIC_ROOT_PASSWD_HASH:," /home/bstahlman/XZD_20161231/buildroot/output/target/etc/shadow
ln -sf /bin/bash /home/bstahlman/XZD_20161231/buildroot/output/target/bin/sh
/bin/sed -i -e '/# GENERIC_SERIAL$/s~^.*#~hvc0::respawn:/sbin/getty -L  hvc0 115200 vt100 #~' /home/bstahlman/XZD_20161231/buildroot/output/target/etc/inittab
/bin/sed -i -e '/^#.*-o remount,rw \/$/s~^#\+~~' /home/bstahlman/XZD_20161231/buildroot/output/target/etc/inittab
rm -f /home/bstahlman/XZD_20161231/buildroot/output/build/locales.nopurge
for i in C en_US locale-archive; do echo $i >> /home/bstahlman/XZD_20161231/buildroot/output/build/locales.nopurge; done
for dir in /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/locale /home/bstahlman/XZD_20161231/buildroot/output/target/usr/man /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/man; do for lang in $(cd $dir; ls .|grep -v man); do grep -qx $lang /home/bstahlman/XZD_20161231/buildroot/output/build/locales.nopurge || rm -rf $dir/$lang; done; done
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/include /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/aclocal \
/home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/pkgconfig /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/pkgconfig \
/home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib/cmake /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/cmake
find /home/bstahlman/XZD_20161231/buildroot/output/target/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f
find /home/bstahlman/XZD_20161231/buildroot/output/target/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
find /home/bstahlman/XZD_20161231/buildroot/output/target/usr/lib \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/gdb
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/man /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/man
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/info /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/info
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/doc /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/doc
rm -rf /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share/gtk-doc
rmdir /home/bstahlman/XZD_20161231/buildroot/output/target/usr/share 2>/dev/null
Makefile:566: recipe for target 'target-finalize' failed
make: [target-finalize] Error 1 (ignored)
find /home/bstahlman/XZD_20161231/buildroot/output/target -type f \( -perm /111 -o -name '*.so*' \) -not \( -name 'libpthread*.so*' -o -name '*.ko' \) -print | xargs /home/bstahlman/XZD_20161231/buildroot/output/host/usr/bin/aarch64-buildroot-linux-gnu-strip --remove-section=.comment --remove-section=.note 2>/dev/null || true
if test -d /home/bstahlman/XZD_20161231/buildroot/output/target/lib/modules; then \
find /home/bstahlman/XZD_20161231/buildroot/output/target/lib/modules -type f -name '*.ko' | \
xargs -r /home/bstahlman/XZD_20161231/buildroot/output/host/usr/bin/aarch64-buildroot-linux-gnu-strip --remove-section=.comment --remove-section=.note --strip-unneeded; fi
find /home/bstahlman/XZD_20161231/buildroot/output/target/lib -type f -name 'libpthread*.so*' | \
xargs -r /home/bstahlman/XZD_20161231/buildroot/output/host/usr/bin/aarch64-buildroot-linux-gnu-strip --remove-section=.comment --remove-section=.note --strip-debug
mkdir -p /home/bstahlman/XZD_20161231/buildroot/output/target/etc
# Mandatory configuration file and auxilliary cache directory
# for recent versions of ldconfig
touch /home/bstahlman/XZD_20161231/buildroot/output/target/etc/ld.so.conf
mkdir -p /home/bstahlman/XZD_20161231/buildroot/output/target/var/cache/ldconfig
if [ -x "/home/bstahlman/XZD_20161231/buildroot/output/host/usr/bin/aarch64-buildroot-linux-gnu-ldconfig" ]; \
then \
/home/bstahlman/XZD_20161231/buildroot/output/host/usr/bin/aarch64-buildroot-linux-gnu-ldconfig -r /home/bstahlman/XZD_20161231/buildroot/output/target; \
else \
/sbin/ldconfig -r /home/bstahlman/XZD_20161231/buildroot/output/target; \
fi
( \
echo "NAME=Buildroot"; \
echo "VERSION=2015.02-rc1-g95eb37e"; \
echo "ID=buildroot"; \
echo "VERSION_ID=2015.02-rc1"; \
echo "PRETTY_NAME=\"Buildroot 2015.02-rc1\"" \
) >  /home/bstahlman/XZD_20161231/buildroot/output/target/etc/os-release
>>>   Copying overlay /home/bstahlman/XZD_20161231/buildroot/board/xilinx/zynq-ultra-mpsoc/dom0-overlay
rsync: change_dir "/home/bstahlman/XZD_20161231/buildroot/board/xilinx/zynq-ultra-mpsoc/dom0-overlay" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.1]
Makefile:566: recipe for target 'target-finalize' failed
make: *** [target-finalize] Error 23

Oops.  It looks like the user manual isn't pointing to a version tag, so it's building the development branch which was updated to 2016.4.  Please
check out the 20161231 release branch, and try the build from there.  Some of your other issues probably stem from this mismatch as well.

Code:
git fetch origin
git checkout 20161231



(10-11-2017, 09:38 PM)brettstahlman Wrote: Got another error: this time on step 6 (Building the Xen tools). But I'm wondering whether what I've already done (through Step 5) gives me all I need to build applications. All of the make vars in your sample Makefile (CC, XENPATH, SYSROOT, LDPATH) reference valid files/directories, so perhaps it's not necessary to complete the remaining steps, especially given that this particular buildroot instance is being used only to build my Xen-linking application?

Thanks,
Brett S.

This step builds the libraries used by the tools, which are the libraries you are trying to link against, so you will not be able to build your application if this step doesn't work.  As long as you're using the XZD rootfs, you shouldn't need to follow any of the remaining steps though.

     Nate

I see two branches similar to the one suggested: XZD_20161231 and XZD_20161231_ramfs (more recent): no bare "20161231". Which of the XZD_* ones would be best?
Thanks,
Brett S.
Reply
#12
Nathan,
The crux of the problem appears to be that the shared objects in...
$RELEASE_DIR/XenZynqDist/components/apps/xen/xen-src/tools/libs/*
...are x86-64, and these are the libraries being linked against by the aarch64 cross-compiler in step 6. I'm assuming that the format of these shared objects is determined by the petalinux-create/config/build sequence described in section 5.2. It occurs to me that perhaps failure to remove shared objects built by petalinux-build in section 5.2 (before attempting the steps in section 5.3) is what's confusing the build? I.e., perhaps the "xen-src/tools" build is attempting to link against shared objects that are "up-to-date", albeit of the wrong format... Perhaps I need to do a `make clean` somewhere under xen/xen-src, or use one of the petalinux-build options to perform a clean?

Thanks,
Brett S.

(10-13-2017, 04:26 PM)brettstahlman Wrote: Nathan,
The crux of the problem appears to be that the shared objects in...
$RELEASE_DIR/XenZynqDist/components/apps/xen/xen-src/tools/libs/*
...are x86-64, and these are the libraries being linked against by the aarch64 cross-compiler in step 6. I'm assuming that the format of these shared objects is determined by the petalinux-create/config/build sequence described in section 5.2. It occurs to me that perhaps failure to remove shared objects built by petalinux-build in section 5.2 (before attempting the steps in section 5.3) is what's confusing the build? I.e., perhaps the "xen-src/tools" build is attempting to link against shared objects that are "up-to-date", albeit of the wrong format... Perhaps I need to do a `make clean` somewhere under xen/xen-src, or use one of the petalinux-build options to perform a clean?

Thanks,
Brett S.

Yep. That appears to have been the problem. The following sequence in xen/xen-src permitted successful completion of step 6:

Code:
make clean
make dist
make dist-tools CROSS_COMPILE=aarch64-buildroot-linux-gnu- XEN_TARGET_ARCH=arm64 CONFIG_EARLY_PRINTK=ronaldo


I was then able to build a small test app similar to a653_sched, so I'm thinking I shouldn't need to proceed past step 6 (of section 5.3) to be able to build apps that use Xen libraries and run in Dom0. Also, I'm assuming that the rootfs constructed for Dom0 will place the dynamic libraries where they can be found by the dynamic linker. Correct?

Thanks,
Brett S.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)