Bug#1033631: papi FTBFS on ppc64el with LTO enabled
Package: papi
Version: 7.0.0-2
Severity: minor
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu lunar ubuntu-patch
Dear maintainers,
In Ubuntu we have observed that papi fails to build from source on ppc64el:
[...]
cc -I../testlib -I../validation_tests -I.. -I. -g -O3 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -Wextra -Wall -DHAVE_ROCM_SMI -DPAPI_NUM_COMP=5 -O1 exeinfo.c ../testlib/libtestlib.a ../libpapi.so.7.0.0.0 -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -Wl,--enable-new-dtags -o exeinfo
/usr/bin/ld: /tmp/ccNFJgHF.ltrans0.ltrans.o:(.rodata+0x10): undefined reference to `f08_callback_'
/usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.40 assertion fail ../../bfd/elf64-ppc.c:17380
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:151: sde_test_f08] Error 1
[...]
This error only happens when LTO is enabled. It is likely a bug in the LTO
toolchain implementation, but to work around the build failure, I have
uploaded the attached patch to Ubuntu which disables LTO on ppc64el.
This patch should presently be a safe no-op in Debian, since Debian does not
enable LTO by default. But as there are discussions to enable it by default
in the future, I am forwarding this patch to you in case it proves useful.
Thanks for considering,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
diff -Nru papi-7.0.0/debian/rules papi-7.0.0/debian/rules
--- papi-7.0.0/debian/rules 2022-11-29 05:40:48.000000000 -0800
+++ papi-7.0.0/debian/rules 2023-03-28 21:18:17.000000000 -0700
@@ -8,9 +8,14 @@
# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+include /usr/share/dpkg/architecture.mk
+
+ifeq ($(DEB_HOST_ARCH),ppc64el)
+ DEB_BUILD_MAINT_OPTIONS += optimize=-lto
+endif
+
DPKG_EXPORT_BUILDFLAGS = yes
include /usr/share/dpkg/buildflags.mk
-include /usr/share/dpkg/architecture.mk
# Upstream does not use CPPFLAGS
CFLAGS += $(CPPFLAGS)
Reply to: