Package: debug-me
Severity: important
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu mantic ubuntu-patch

Dear Maintainer,

building on ppc64el with LTO fails in Launchpad.

Cf. 
https://launchpadlibrarian.net/684538812/buildlog_ubuntu-mantic-ppc64el.debug-me_1.20221231-1_BUILDING.txt.gz

Linking dist/build/debug-me/debug-me ...
/usr/bin/ld.gold: internal error in set_xindex, at ../../gold/object.h:1050
collect2: error: ld returned 1 exit status
`powerpc64le-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1)

In Ubuntu, the attached patch was applied to achieve the following:

  * Disable LTO on the ppc64el architecture (LP: #2033639)

Thanks for considering the patch.


-- System Information:
Debian Release: trixie/sid
  APT prefers mantic
  APT policy: (500, 'mantic')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.5.0-5-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru debug-me-1.20221231/debian/rules debug-me-1.20221231/debian/rules
--- debug-me-1.20221231/debian/rules    2023-07-04 17:38:00.000000000 +0200
+++ debug-me-1.20221231/debian/rules    2023-09-18 15:51:21.000000000 +0200
@@ -1,9 +1,18 @@
 #!/usr/bin/make -f
 
+DPKG_EXPORT_BUILDFLAGS := 1
+include /usr/share/dpkg/architecture.mk
+
 # Debian's ghc cannot compile anything with -fPIC at present, so we
 # have to disable PIE hardening to avoid build failures on archs like
 # amd64.  See discussion on debian-hask...@lists.debian.org
-export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
+DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
+
+# Building with LTO failed on ppc64el (LP: #2033639)
+ifeq ("$(DEB_BUILD_ARCH)", "ppc64el")
+       DEB_BUILD_MAINT_OPTIONS += optimize=-lto
+endif
+export DEB_BUILD_MAINT_OPTIONS
 
 # cabal likes to write to $HOME, so use Setup.hs directly
 export BUILDER = ./Setup

Reply via email to