Comment 1 for bug 2016471

Revision history for this message
Lukas Märdian (slyon) wrote :

As Graham stated, disabling LTO make the build/tests (mostly) pass, but fails for the "OMPT_ARCHS" (amd64 arm64 i386 ppc64el riscv64), as defined in d/rules.

This can be done via lto-disabled-list or d/rules:
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto

I tried a few different things in eztrace to make the toolchain mimic the Debian build (which passes):
* Switch to clang-14:
  CC=clang-14 in d/rules and clang-14 & libomp-14-dev B-Ds in d/control
* Strip Ubuntu's -Bsymbolic-functions optimization from the linker flags
  export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions in d/rules

But didn't have any success with the above changes.

Then I noticed bug #1899199, which indicates the root-cause being in the libomp5 dependency instead of eztrace itself, i.e. llvm-toolchain-* (or libomp.so.5 specifically) needs to be build without the -Wl,-Bsymbolic-functions LDFLAGS optimization. This seems to be the case!

After downloading relevant binaries from Debian (https://packages.debian.org/source/sid/llvm-toolchain-15), I was able to build eztrace successfully (with just LTO disabled, but no other changes):

sbuild --extra-package ../libomp5-15_15.0.7-4_amd64.deb --extra-package ../libomp-15-dev_15.0.7-4_amd64.deb -dlunar .

So IMO this is something for the Foundations toolchain people to look into, fixing our llvm-toolchain (libomp) build.