Skip to content

Some binaries in the toolchain tarball are huge

Affected images versions

Type Arch v2021 v2022 v2023dev2
toolchain armhf 20220509.0117
toolchain arm64 20220509.0117

Unaffected images versions

  • v2021

Steps to reproduce

$ tar xf apertis-aarch64-linux-gnu-toolchain.tar.xz apertis-aarch64-linux-gnu-toolchain/usr/lib/gcc-cross/arm-linux-gnueabihf/10/cc1plus
$ ls -lh apertis-aarch64-linux-gnu-toolchain/usr/lib/gcc-cross/arm-linux-gnueabihf/10/cc1plus
-rwxr-xr-x 1 root root 196M Aug  5  2021 apertis-aarch64-linux-gnu-toolchain/usr/lib/gcc-cross/arm-linux-gnueabihf/10/cc1plus
$ file apertis-aarch64-linux-gnu-toolchain/usr/lib/gcc-cross/arm-linux-gnueabihf/10/cc1plus
apertis-aarch64-linux-gnu-toolchain/usr/lib/gcc-cross/arm-linux-gnueabihf/10/cc1plus: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=6e57057a519bc64abe62c7d889ff1714081321b5, for GNU/Linux 3.2.0, with debug_info, not stripped

Expected result

The cc1plus binary should be an order or magnitude smaller. For reference, here's what registry.gitlab.apertis.org/infrastructure/apertis-docker-images/v2023dev2-package-source-builder@sha256:78bd9baa3fc4 ships:

$ ls -lh /usr/lib/gcc/x86_64-linux-gnu/10/cc1plus
-rwxr-xr-x. 1 root root 26M Jan 21 19:07 /usr/lib/gcc/x86_64-linux-gnu/10/cc1plus

The binary should be stripped, dropping the debug information.

Actual result

  • the binary ships with debug symbols enabled
  • size is ten times the expected one

Reproducibility

How often the issue is hit when repeating the test and changing nothing (same device, same image, etc.)?

  1. always
  2. often, but not always
  3. rarely

Impact of bug

Minor, just some wasted storage and bandwidth.

Attachments

Add further information about the environment in the form of attachments here. Attach plain text files from log output (from journalctl, systemctl, …) or long backtraces as inlined paste objects. Screenshots and videos are usually useful for graphic issues.

Root cause

The apertis-toolchain is likely missing some steps to strip the binaries it builds.

Outcomes

TBD

Management data

This section is for management only, it should be the last one in the description.

Phabricator link: https://phabricator.apertis.org/T8887

Edited by Apertis CI robot