PYNQ 2.5 ct-ng build error

when building PYNQ 2.5 on a Ubuntu 18.04 virtual machine then the build process stops at the ct-ng build step with following error
[INFO] building environment variables
[ERROR] collect2: error: ld returned 1 exit status

The board for which I’m building PYNQ 2.5 is a ZEDBOARD with ZYNQ 2020 and a dual 32 bit ARM core. I’m able to build a working image file for this platform using a prebuilt ARM image but when using it I get a lot of ext4 error messages. And these errors return, also if I remove them with the e2fsck utility. Therefore I want to do a clean build. But I’m stuck at this stage. The detailed build log of the ct-ng flow is included below.
After the virtual machine setup the crosstool-ng scripts are available at /opt/crosstool-ng
I saw that the source code is available in PYNQ/sdbuild/scripts/tools/crosstool-ng-1.24.0
Doeing a make install installs the crosstoo-ng tools in /usr/local/bin
With both crosstool versions I run into the same problem.

What can I do to avoid this error??
Thanks for the support!

Detailed log of ct-ng tool - see lines with [ERROR]
[DEBUG] Testing ‘! ( -n )’
[INFO ] Performing some trivial sanity checks
… left away intitial checks to stay within topic line limits

[DEBUG] Missing: ‘arm-linux-gnueabihf-gnatmake’ or ‘arm-linux-gnueabihf-gnatmake’ or ‘gnatmake’ : not required.
[DEBUG] ‘arm-host_unknown-linux-gnueabihf-ld’ → ‘/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-ld’
[DEBUG] ==> Executing: ‘chmod’ ‘700’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/bin/arm-host_unknown-linux-gnueabihf-ld’
[DEBUG] ==> Return status 0
[DEBUG] ‘arm-host_unknown-linux-gnueabihf-nm’ → ‘/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-nm’
[DEBUG] ==> Executing: ‘chmod’ ‘700’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/bin/arm-host_unknown-linux-gnueabihf-nm’
[DEBUG] ==> Return status 0
[DEBUG] ‘arm-host_unknown-linux-gnueabihf-objcopy’ → ‘/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-objcopy’
[DEBUG] ==> Executing: ‘chmod’ ‘700’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/bin/arm-host_unknown-linux-gnueabihf-objcopy’
[DEBUG] ==> Return status 0
[DEBUG] ‘arm-host_unknown-linux-gnueabihf-objdump’ → ‘/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-objdump’
[DEBUG] ==> Executing: ‘chmod’ ‘700’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/bin/arm-host_unknown-linux-gnueabihf-objdump’
[DEBUG] ==> Return status 0
[DEBUG] ‘arm-host_unknown-linux-gnueabihf-ranlib’ → ‘/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-ranlib’
[DEBUG] ==> Executing: ‘chmod’ ‘700’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/bin/arm-host_unknown-linux-gnueabihf-ranlib’
[DEBUG] ==> Return status 0
[DEBUG] ‘arm-host_unknown-linux-gnueabihf-strip’ → ‘/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-strip’
[DEBUG] ==> Executing: ‘chmod’ ‘700’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/bin/arm-host_unknown-linux-gnueabihf-strip’
[DEBUG] ==> Return status 0
[DEBUG] Missing: ‘arm-linux-gnueabihf-windres’ or ‘arm-linux-gnueabihf-windres’ or ‘windres’ : not required.
[DEBUG] ‘makeinfo’ → ‘/usr/bin/makeinfo’
[DEBUG] ==> Executing: ‘chmod’ ‘700’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/bin/makeinfo’
[DEBUG] ==> Return status 0
[DEBUG] CFLAGS for build compiler: '-O2 -g -I/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/include ’
[DEBUG] LDFLAGS for build compiler: '-L/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/lib ’
[DEBUG] CFLAGS for host compiler: ‘-O2 -g -pipe -I/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/complibs-host/include --sysroot=/home/xilinx/PYNQ/sdbuild/build/gcc-mb/sysroot.arm’
[DEBUG] LDFLAGS for host compiler: ‘-L/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/complibs-host/lib --sysroot=/home/xilinx/PYNQ/sdbuild/build/gcc-mb/sysroot.arm’
[DEBUG] =================================================================
[DEBUG] Checking that we can run gcc -v
[DEBUG] ==> Executing: ‘arm-host_unknown-linux-gnueabihf-gcc’ ‘-v’
[DEBUG] Using built-in specs.
[DEBUG] COLLECT_GCC=/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
[DEBUG] COLLECT_LTO_WRAPPER=/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/…/libexec/gcc/arm-linux-gnueabihf/8.2.0/lto-wrapper
[DEBUG] Target: arm-linux-gnueabihf
[DEBUG] Configured with: /proj/esdt_sdk/gnu_abe/ABE/builds/lin/arm/arm-linux/snapshots/gcc-8.2.0/configure SHELL=/bin/sh --with-bugurl=://bugs.linaro.org --with-mpc=/proj/esdt_sdk/gnu_abe/ABE/builds/lin/arm/arm-linux/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/proj/esdt_sdk/gnu_abe/ABE/builds/lin/arm/arm-linux/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/proj/esdt_sdk/gnu_abe/ABE/builds/lin/arm/arm-linux/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --enable-gnu-indirect-function --disable-multilib --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=arm --disable-multilib --enable-multiarch CFLAGS=-O2 CXXFLAGS=-O2 --disable-silent-rules --enable-libquadmath --enable-libg2c --enable-symvers=gnu --enable-libstdcxx-pch --disable-libssp --disable-libmudflap --enable-checking=release --enable-cheaders=c_global --enable-poison-system-directories --enable-clocale=generic --enable-shared --enable-threads=posix --disable-multilib --enable-c99 --without-local-prefix --enable-lto --disable-bootstrap --with-linker-hash-style=gnu --with-ppl=no --with-cloog=no --without-isl --enable-nls --enable-__cxa_atexit --with-build-sysroot=/proj/esdt_sdk/gnu_abe/ABE/builds/lin/arm/arm-linux/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-plugins --enable-linker-build-id --enable-long-long --enable-shared --with-sysroot=/proj/esdt_sdk/gnu_abe/ABE/builds/lin/arm/arm-linux/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-languages=c,c++,lto --enable-checking=yes --disable-bootstrap --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/proj/esdt_sdk/gnu_abe/ABE/builds/lin/arm/arm-linux/builds/destdir/x86_64-unknown-linux-gnu
[DEBUG] Thread model: posix
[DEBUG] gcc version 8.2.0 (GCC)
[DEBUG] ==> Return status 0
[DEBUG] Checking that we can run gcc -v: done in 0.01s (at 00:02)
[DEBUG] =================================================================
[DEBUG] Checking that gcc can compile a trivial program
[DEBUG] ==> Executing: ‘arm-host_unknown-linux-gnueabihf-gcc’ ‘-O2’ ‘-g’ ‘-pipe’ ‘-I/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/complibs-host/include’ ‘–sysroot=/home/xilinx/PYNQ/sdbuild/build/gcc-mb/sysroot.arm’ ‘-L/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/buildtools/complibs-host/lib’ ‘–sysroot=/home/xilinx/PYNQ/sdbuild/build/gcc-mb/sysroot.arm’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/build/test.c’ ‘-o’ ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb/.build/HOST-arm-linux-gnueabihf/microblazeel-xilinx-elf/build/.gccout’
[DEBUG] /home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/…/lib/gcc/arm-linux-gnueabihf/8.2.0/…/…/…/…/arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
[DEBUG] /home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/…/lib/gcc/arm-linux-gnueabihf/8.2.0/…/…/…/…/arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
[ERROR] collect2: error: ld returned 1 exit status
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step ‘Checking that gcc can compile a trivial program’
[ERROR] >> called in step ‘(top-level)’
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@376]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@611]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: ‘build.log’
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >> //crosstool-ng.github.io/docs/known-issues/
[ERROR] >>
[ERROR] >> NOTE: Your configuration includes features marked EXPERIMENTAL.
[ERROR] >> Before submitting a bug report, try to reproduce it without enabling
[ERROR] >> any experimental features. Otherwise, you’ll need to debug it
[ERROR] >> and present an explanation why it is a bug in crosstool-NG - or
[ERROR] >> preferably, a fix.
[ERROR] >>
[ERROR] >> NOTE: You configuration uses non-default patch sets. Please
[ERROR] >> select ‘bundled’ as the set of patches applied and attempt
[ERROR] >> to reproduce this issue. Issues reported with other patch
[ERROR] >> set selections (none, local, bundled+local) are going to be
[ERROR] >> closed without explanation.
[ERROR] >>
[ERROR] >> If you feel this is a bug in crosstool-NG, report it at:
[ERROR] >> ://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR] >>
[ERROR] >> Make sure your report includes all the information pertinent to this issue.
[ERROR] >> Read the bug reporting guidelines here:
[ERROR] >> //crosstool-ng.github.io/support/
[ERROR]
[ERROR] (elapsed: 0:00.81)

My best guess is that the sysroot isn’t being set up correctly. Did you have any trouble with creating the multistrap part of the build? I would suggest deleting:

  • build/bionic.arm.stage1.img
  • build/gcc-mb

Restarting the VM and trying again. It would be helpful if you could capture the entire Makefile log of the first make command you run so we can work out what’s going wrong.

Peter

Thanks for the feedback Peter!!
here the first part of the log, after restaring virtual machine and removing build/bionic.arm.stage1.img and build/gcc-mb

[For multistrap I had to do a minor patch, specifically adding keyring=ubuntu-keyring
to …/arm/multistrap.config ]
This part looks fairly normal to me … except that I get a few warnings such as - see below
are these warnings harmless, or do these warning show that config is not OK
Ill post the remainder of the makefile log later on
=> also removed some http words in the output since only 2 http links are supported in the reply

Setting up python2.7-minimal (2.7.15~rc1-1) …
update-binfmts: warning: unable to open /proc/filesystems: No such file or directory
update-binfmts: warning: Couldn’t load the binfmt_misc module.

/bin/grep: /proc/1/environ: No such file or directory
/sbin/MAKEDEV: warning: can’t read /proc/devices
/sbin/MAKEDEV: warning: can’t read /proc/devices
/sbin/MAKEDEV: warning: can’t read /proc/devices
/sbin/MAKEDEV: warning: can’t read /proc/devices
/sbin/MAKEDEV: warning: can’t read /proc/devices

→ Processing conffiles for wireless-tools
I: Extracting wpasupplicant_2%3a2.6-15ubuntu2_armhf.deb…
→ Processing conffiles for wpasupplicant
I: Extracting x11-apps_7.7+6ubuntu1_armhf.deb…
Warning: unrecognised value ‘no’ for Multi-Arch field in x11-apps_7.7+6ubuntu1_armhf.deb. (Expecting ‘same’, ‘foreign’ or ‘allowed’.)
→ Processing conffiles for x11-apps
I: Extracting x11-common_1%3a7.7+19ubuntu7_all.deb…
→ Processing conffiles for x11-common
I: Extracting x11-session-utils_7.7+2build1_armhf.deb…
Warning: unrecognised value ‘no’ for Multi-Arch field in x11-session-utils_7.7+2build1_armhf.deb. (Expecting ‘same’, ‘foreign’ or ‘allowed’.)
→ Processing conffiles for x11-session-utils
I: Extracting x11-utils_7.7+3build1_armhf.deb…
→ Processing conffiles for x11-utils
I: Extracting x11-xkb-utils_7.7+3_armhf.deb…
Warning: unrecognised value ‘no’ for Multi-Arch field in x11-xkb-utils_7.7+3_armhf.deb. (Expecting ‘same’, ‘foreign’ or ‘allowed’.)

========================================================

make BOARDS=ZED >& make.log
output summary

opt/qemu/bin/qemu-arm-static -version | fgrep 4.0.0
qemu-arm version 4.0.0
vivado -version | fgrep 2019.1
Vivado v2019.1 (64-bit)
echo “vivado passed”
vivado passed
xsdk -version | fgrep 2019.1
****** SDK v2019.1 (64-bit)
echo “xsdk passed”
xsdk passed
#which petalinux-config | fgrep 2019.1
echo “petalinux-config passed”
petalinux-config passed
which arm-linux-gnueabihf-gcc
/home/xilinx/xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
which microblaze-xilinx-elf-gcc
/home/xilinx/petalinux/tools/xsct/gnu/microblaze/lin/bin/microblaze-xilinx-elf-gcc
which ct-ng
/usr/local/bin/ct-ng
which python | fgrep /usr/bin/python
/usr/bin/python
sudo -n mount > /dev/null
bash /home/xilinx/PYNQ/sdbuild/scripts/check_env.sh
bash /home/xilinx/PYNQ/sdbuild/scripts/check_mounts.sh
echo “ALL CHECKS DONE”
ALL CHECKS DONE
rm -f /home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img
/home/xilinx/PYNQ/sdbuild/scripts/create_mount_img.sh /home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img /home/xilinx/PYNQ/sdbuild/build/bionic.arm

  • image_file=/home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img
  • image_dir=/home/xilinx/PYNQ/sdbuild/build/bionic.arm
    ++ dirname /home/xilinx/PYNQ/sdbuild/scripts/create_mount_img.sh
  • script_dir=/home/xilinx/PYNQ/sdbuild/scripts
  • truncate --size 7G /home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img
  • /home/xilinx/PYNQ/sdbuild/scripts/create_partitions.sh /home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x04b27357.

Command (m for help): Created a new DOS disklabel with disk identifier 0xc6004df9.

Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-14680063, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-14680063, default 14680063):
Created a new partition 1 of type ‘Linux’ and of size 100 MiB.

Command (m for help): Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (206848-14680063, default 206848): Last sector, +sectors or +size{K,M,G,T,P} (206848-14680063, default 14680063):
Created a new partition 2 of type ‘Linux’ and of size 6,9 GiB.

Command (m for help): Partition number (1,2, default 2):
The bootable flag on partition 1 is enabled now.

Command (m for help): Partition number (1,2, default 2): Hex code (type L to list all codes):
Changed type of partition ‘Linux’ to ‘W95 FAT32 (LBA)’.

Command (m for help): Disk /home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img: 7 GiB, 7516192768 bytes, 14680064 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc6004df9

Device Boot Start End Sectors Size Id Type
/home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img1 * 2048 206847 204800 100M c W95 FAT32 (LBA)
/home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img2 206848 14680063 14473216 6,9G 83 Linux

Command (m for help): The partition table has been altered.
Syncing disks.

  • mount_points=($(sudo kpartx -av $image_file | cut -d ’ ’ -f 3))
    ++ sudo kpartx -av /home/xilinx/PYNQ/sdbuild/build/bionic.arm.stage1.img
    ++ cut -d ’ ’ -f 3
  • echo loop18p1
    loop18p1
  • echo loop18p2
    loop18p2
  • root_part=/dev/mapper/loop18p2
  • boot_part=/dev/mapper/loop18p1
  • sleep 5
  • sudo chroot / mkfs -t fat /dev/mapper/loop18p1
    mkfs.fat 4.1 (2017-01-24)
  • sudo chroot / mkfs -t ext4 /dev/mapper/loop18p2
    mke2fs 1.44.1 (24-Mar-2018)
    Discarding device blocks: 4096/1809152 done
    Creating filesystem with 1809152 4k blocks and 452480 inodes
    Filesystem UUID: 3e1d3efb-8eb2-4e24-8817-0dc37a254a43
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: 0/56 done
Writing inode tables: 0/56 done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: 0/56 done

  • mkdir -p /home/xilinx/PYNQ/sdbuild/build/bionic.arm
  • sudo mount /dev/mapper/loop18p2 /home/xilinx/PYNQ/sdbuild/build/bionic.arm
  • sleep 5
  • sudo chroot / mkdir /home/xilinx/PYNQ/sdbuild/build/bionic.arm/boot
  • sudo mount /dev/mapper/loop18p1 /home/xilinx/PYNQ/sdbuild/build/bionic.arm/boot
  • sudo chroot / chmod a+w /home/xilinx/PYNQ/sdbuild/build/bionic.arm
    QEMU_EXE=/opt/qemu/bin/qemu-arm-static PYNQ_BOARD=Unknown ARCH=arm /home/xilinx/PYNQ/sdbuild/scripts/create_rootfs.sh /home/xilinx/PYNQ/sdbuild/build/bionic.arm /home/xilinx/PYNQ/sdbuild/ubuntu/bionic/arm
  • set -e
  • target=/home/xilinx/PYNQ/sdbuild/build/bionic.arm
  • SRCDIR=/home/xilinx/PYNQ/sdbuild/ubuntu/bionic/arm
  • fss=‘proc dev’
  • echo /opt/qemu/bin/qemu-arm-static
    /opt/qemu/bin/qemu-arm-static
  • multistrap_conf=/home/xilinx/PYNQ/sdbuild/ubuntu/bionic/arm/multistrap.config
  • ‘[’ -n ‘’ ‘]’
  • sudo -E multistrap -f /home/xilinx/PYNQ/sdbuild/ubuntu/bionic/arm/multistrap.config -d /home/xilinx/PYNQ/sdbuild/build/bionic.arm
    multistrap 2.2.9 using /home/xilinx/PYNQ/sdbuild/ubuntu/bionic/arm/multistrap.config
    multistrap 2.2.9 using /home/xilinx/PYNQ/sdbuild/ubuntu/bionic/arm/multistrap.config
    Using foreign architecture: armhf
    multistrap building armhf multistrap on ‘amd64’
    I: Setting /home/xilinx/PYNQ/sdbuild/build/bionic.arm/lib64 → /home/xilinx/PYNQ/sdbuild/build/bionic.arm/lib symbolic link.
    I: Downloading ubuntu-keyring
    Get:1 ://be.archive.ubuntu.com/ubuntu bionic-updates/main amd64 ubuntu-keyring all 2018.09.18.1~18.04.0 [22,4 kB]
    Fetched 22,4 kB in 0s (49,3 kB/s)
    W: Download is performed unsandboxed as root as file ‘/home/xilinx/PYNQ/sdbuild/ubuntu-keyring_2018.09.18.1~18.04.0_all.deb’ couldn’t be accessed by user ‘_apt’. - pkgAcquire::Run (13: Permission denied)
    Getting package lists: APT_CONFIG=/tmp/multistrap.Kd95js apt-get -o Apt::Architecture=armhf -o Dir::Etc::TrustedParts=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/etc/apt/trusted.gpg.d -o Dir::Etc::Trusted=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/etc/apt/trusted.gpg -o Apt::Get::Download-Only=true -o Dir=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/ -o Dir::Etc=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/etc/apt/ -o Dir::Etc::Parts=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/etc/apt/apt.conf.d/ -o Dir::Etc::PreferencesParts=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/etc/apt/preferences.d/ -o APT::Default-Release=‘*’ -o Dir::State=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/var/lib/apt/ -o Dir::State::Status=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/var/lib/dpkg/status -o Dir::Cache=/home/xilinx/PYNQ/sdbuild/build/bionic.arm/var/cache/apt/ update
    Get:1 p://ports.ubuntu.com/ubuntu-ports bionic InRelease [242 kB]
    Get:2 ttp://ports.ubuntu.com/ubuntu-ports bionic/main Sources [829 kB]
    Get:3 ttp://ports.ubuntu.com/ubuntu-ports bionic/universe Sources [9.051 kB]
    Get:4 ttp://ports.ubuntu.com/ubuntu-ports bionic/universe armhf Packages [8.269 kB]
    Get:5 ttp://ports.ubuntu.com/ubuntu-ports bionic/universe Translation-en [4.941 kB]
    Get:6 ttp://ports.ubuntu.com/ubuntu-ports bionic/main armhf Packages [968 kB]
    Get:7 ttp://ports.ubuntu.com/ubuntu-ports bionic/main Translation-en [516 kB]
    Fetched 24,8 MB in 8s (3.195 kB/s)
    Reading package lists…
    I: Calculating required packages.
    I: Adding ‘Priority: important’: adduser apt apt-utils busybox-initramfs bzip2 ca-certificates console-setup console-setup-linux cpio cron dbus debconf-i18n distro-info-data dmsetup eject file gir1.2-glib-2.0 gpgv init initramfs-tools initramfs-tools-bin initramfs-tools-core iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kbd keyboard-configuration klibc-utils kmod less libapparmor1 libapt-inst2.0 libapt-pkg5.0 libargon2-0 libatm1 libbsd0 libcap2 libcap2-bin libcryptsetup12 libdbus-1-3 libdevmapper1.02.1 libdns-export1100 libelf1 libestr0 libexpat1 libfastjson4 libffi6 libfribidi0 libgirepository-1.0-1 libglib2.0-0 libglib2.0-data libgmp10 libgnutls30 libhogweed4 libicu60 libidn11 libidn2-0 libip4tc0 libisc-export169 libjson-c3 libklibc libkmod2 liblocale-gettext-perl libmagic-mgc libmagic1 libmnl0 libmpdec2 libnettle6 libnewt0.52 libnss-systemd libp11-kit0 libpam-cap libpam-systemd libpopt0 libpython3-stdlib libpython3.6-minimal libpython3.6-stdlib libreadline7 libseccomp2 libslang2 libsqlite3-0 libssl1.1 libstdc++6 libtasn1-6 libtext-charwidth-pe

    Reading package lists…
    Building dependency tree…
    The following additional packages will be installed:
    adwaita-icon-theme apport apport-symptoms at-spi2-core autopoint
    avahi-daemon bind9-host binutils-arm-linux-gnueabihf binutils-common
    bluez-obexd cpp-7 crda dconf-gsettings-backend dconf-service dh-autoreconf
    dh-strip-nondeterminism dirmngr docutils-common e2fsprogs-l10n

    0 upgraded, 1512 newly installed, 0 to remove and 0 not upgraded.
    Need to get 674 MB of archives.
    After this operation, 2.689 MB of additional disk space will be used.
    Get:1ttp://ports.ubuntu.com/ubuntu-ports bionic/main armhf gcc-8-base armhf 8-20180414-1ubuntu2 [18,2 kB]
    Get:2 ttp://ports.ubuntu.com/ubuntu-ports bionic/main armhf libc6 armhf 2.27-3ubuntu1 [2.207 kB]
    Get:3 ttp://ports.ubuntu.com/ubuntu-ports bionic/main armhf libgcc1 armhf 1:8-20180414-1ubuntu2 [37,1 kB]

Thanks for your advice Peter, redoing the build after reboot and removal of
build/bionic.arm.stage1.img
build/gcc-mb
Looks to solve the problem. The ct-ng sanity checks now pass, and I see that build makes progress.

Kind regards, HCAP

  • ct-ng build
    gmake[1]: Entering directory ‘/home/xilinx/PYNQ/sdbuild/build/gcc-mb’
    [INFO ] Performing some trivial sanity checks
    [WARN ] Number of open files 1024 may not be sufficient to build the toolchain; increasing to 2048
    [INFO ] Build started 20200513.224912
    [INFO ] Building environment variables
    [INFO ] =================================================================
    [INFO ] Retrieving needed toolchain components’ tarballs
    [INFO ] Retrieving needed toolchain components’ tarballs: done in 199.46s (at 03:22)
    [INFO ] =================================================================
    [INFO ] Extracting and patching toolchain components
    [INFO ] Extracting and patching toolchain components: done in 21.37s (at 03:44)
    [INFO ] =================================================================
    [INFO ] Installing automake for build
    [INFO ] Installing automake for build: done in 8.83s (at 03:53)
    [INFO ] =================================================================
    [INFO ] Installing zlib for build
    [INFO ] Installing zlib for build: done in 1.57s (at 03:54)
    [INFO ] =================================================================
    [INFO ] Installing GMP for build
    [INFO ] Installing GMP for build: done in 36.55s (at 04:31)
    [INFO ] =================================================================
    [INFO ] Installing MPFR for build
    [INFO ] Installing MPFR for build: done in 21.48s (at 04:52)
    [INFO ] =================================================================
    [INFO ] Installing ISL for build
    [INFO ] Installing ISL for build: done in 20.52s (at 05:13)
    [INFO ] =================================================================
    [INFO ] Installing MPC for build
    [INFO ] Installing MPC for build: done in 6.06s (at 05:19)
    [INFO ] =================================================================
    [INFO ] Installing ncurses for build
    [INFO ] Installing ncurses for build: done in 14.86s (at 05:34)
    [INFO ] =================================================================
    [INFO ] Installing libiconv for build
    [INFO ] Installing libiconv for build: done in 0.01s (at 05:34)
    [INFO ] =================================================================
    [INFO ] Installing gettext for build
    [INFO ] Installing gettext for build: done in 0.01s (at 05:34)
    [INFO ] =================================================================
    [INFO ] Installing binutils for build
    [INFO ] Installing binutils for build: done in 47.26s (at 06:21)
    [INFO ] =================================================================
    [INFO ] Installing zlib for host
    [INFO ] Installing zlib for host: done in 2.59s (at 06:24)
    [INFO ] =================================================================
    [INFO ] Installing GMP for host
    [INFO ] Installing GMP for host: done in 54.25s (at 07:18)
    [INFO ] =================================================================
1 Like

Hi!

It seems that I had a similar error error with ct-ng in the same configuration (2.5 image, Ubuntu 18.04 VM). However, the solution suggested by @PeterOgden did not work in my case. Here is a part of my log file:

user@matepc:~/Documents/PYNQ/sdbuild$ make BOARDS=Pynq-Z1
/opt/qemu/bin/qemu-arm-static -version | fgrep 4.0.0
qemu-arm version 4.0.0
vivado -version | fgrep 2019.1
Vivado v2019.1 (64-bit)
xsdk -version | fgrep 2019.1
****** SDK v2019.1 (64-bit)
which petalinux-config
/opt/petalinux/tools/common/petalinux/bin/petalinux-config
which arm-linux-gnueabihf-gcc
/opt/Xilinx/SDK/2019.1/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-gcc
which microblaze-xilinx-elf-gcc
/opt/petalinux/tools/xsct/gnu/microblaze/lin/bin/microblaze-xilinx-elf-gcc
which ct-ng
/opt/crosstool-ng/bin/ct-ng
which python | fgrep /usr/bin/python
/usr/bin/python
sudo -n mount > /dev/null
bash /home/user/Documents/PYNQ/sdbuild/scripts/check_env.sh
bash /home/user/Documents/PYNQ/sdbuild/scripts/check_mounts.sh
cd /home/user/Documents/PYNQ/sdbuild/build/gcc-mb && /home/user/Documents/PYNQ/sdbuild/packages/gcc-mb//build.sh arm /home/user/Documents/PYNQ/sdbuild/build/bionic.arm.stage1.img
+ ARCH=arm
+ ROOT_IMAGE=/home/user/Documents/PYNQ/sdbuild/build/bionic.arm.stage1.img
+++ dirname /home/user/Documents/PYNQ/sdbuild/packages/gcc-mb//build.sh
++ cd /home/user/Documents/PYNQ/sdbuild/packages/gcc-mb
++ pwd
+ SCRIPT_DIR=/home/user/Documents/PYNQ/sdbuild/packages/gcc-mb
+ case ${ARCH} in
+ sample=arm-linux-gnueabihf,microblazeel-xilinx-elf
+ SYSROOT_IMAGE=/home/user/Documents/PYNQ/sdbuild/build/gcc-mb/sysroot.arm.img
+ export HOST_SYSROOT=/home/user/Documents/PYNQ/sdbuild/build/gcc-mb/sysroot.arm
+ HOST_SYSROOT=/home/user/Documents/PYNQ/sdbuild/build/gcc-mb/sysroot.arm
+ mkdir -p /home/user/Documents/PYNQ/sdbuild/build/gcc-mb/sysroot.arm
+ cp --sparse=always /home/user/Documents/PYNQ/sdbuild/build/bionic.arm.stage1.img /home/user/Documents/PYNQ/sdbuild/build/gcc-mb/sysroot.arm.img
+ /home/user/Documents/PYNQ/sdbuild/scripts/mount_image.sh /home/user/Documents/PYNQ/sdbuild/build/gcc-mb/sysroot.arm.img /home/user/Documents/PYNQ/sdbuild/build/gcc-mb/sysroot.arm
loop9p1
loop9p2
+ trap unmount_delete EXIT
+ cd /home/user/Documents/PYNQ/sdbuild/build/gcc-mb/sysroot.arm
++ find -lname '/*'
find: ‘./lost+found’: Permission denied
find: ‘./var/lib/apt/lists/partial’: Permission denied
+ export -n LD_LIBRARY_PATH
+ ct-ng arm-linux-gnueabihf,microblazeel-xilinx-elf
gmake[1]: Entering directory '/home/user/Documents/PYNQ/sdbuild/build/gcc-mb'
  CONF  arm-linux-gnueabihf,microblazeel-xilinx-elf
#
# configuration written to .config
#

***********************************************************

Initially reported by: Peter Ogden
URL: 

***********************************************************

WARNING! This sample may enable experimental features.
         Please be sure to review the configuration prior
         to building and using your toolchain!
Now, you have been warned!

***********************************************************

Now configured for "arm-linux-gnueabihf,microblazeel-xilinx-elf"
gmake[1]: Leaving directory '/home/user/Documents/PYNQ/sdbuild/build/gcc-mb'
+ ct-ng build
gmake[1]: Entering directory '/home/user/Documents/PYNQ/sdbuild/build/gcc-mb'
[INFO ]  Performing some trivial sanity checks
[WARN ]  Number of open files 1024 may not be sufficient to build the toolchain; increasing to 2048
[INFO ]  Build started 20200526.085721
[INFO ]  Building environment variables
[ERROR]    collect2: error: ld returned 1 exit status
[ERROR]   
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Checking that gcc can compile a trivial program'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@376]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@611]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      https://crosstool-ng.github.io/docs/known-issues/
[ERROR]  >>
[ERROR]  >> NOTE: Your configuration includes features marked EXPERIMENTAL.
[ERROR]  >> Before submitting a bug report, try to reproduce it without enabling
[ERROR]  >> any experimental features. Otherwise, you'll need to debug it
[ERROR]  >> and present an explanation why it is a bug in crosstool-NG - or
[ERROR]  >> preferably, a fix.
[ERROR]  >>
[ERROR]  >> NOTE: You configuration uses non-default patch sets. Please
[ERROR]  >> select 'bundled' as the set of patches applied and attempt
[ERROR]  >> to reproduce this issue. Issues reported with other patch
[ERROR]  >> set selections (none, local, bundled+local) are going to be
[ERROR]  >> closed without explanation.
[ERROR]  >>
[ERROR]  >>  If you feel this is a bug in crosstool-NG, report it at:
[ERROR]  >>      https://github.com/crosstool-ng/crosstool-ng/issues/
[ERROR]  >>
[ERROR]  >>  Make sure your report includes all the information pertinent to this issue.
[ERROR]  >>  Read the bug reporting guidelines here:
[ERROR]  >>      http://crosstool-ng.github.io/support/
[ERROR]   
[ERROR]  (elapsed: 0:01.29)
[00:02] / /opt/crosstool-ng/bin/ct-ng:261: recipe for target 'build' failed
gmake[1]: *** [build] Error 1
gmake[1]: Leaving directory '/home/user/Documents/PYNQ/sdbuild/build/gcc-mb'

As far as I understand, crosstool wasn’t able to find a correct compiler…

[ERROR]  >>  Build failed in step 'Checking that gcc can compile a trivial program'
[ERROR]  >>        called in step '(top-level)'

Any suggestions ?

You’d be getting a different error message if GCC wasn’t found. The most likely issue is that the sysroot for the build isn’t being created properly which is generally the result of a failed stage one build. Can you follow the full instructions I posted above and share the complete log. The log you’ve got so far shows that the stage1.img file is already present before you called make so we need more information to work out what’s going wrong.

Peter

1 Like

I have the same issue. The above method does not work. Anyone know other ways?

Thanks and best regards,
Duy

i met this same issue . have you solved this ? would you tell me how to slove this issue ? :> thank

@DuyTrandeLion @hcap Hi guys, I think you guys should try to do what was suggested before:
reboot VM
remove build/bionic.arm.stage1.img, build/bionic.aarch64.stage1.img, build/gcc-mb
make again

hello @rock,
Yes, rebooting computer solved it. I still don’t understand the reason why…
Thanks