#1015518 libretro-bsnes-mercury: ftbfs with LTO (link time optimization) enabled

#1015518#5
Date:
2022-07-19 16:55:51 UTC
From:
To:
This package currently fails to build (at least on the amd64
architecture) with link time optimizations enabled.  For a background
for LTO please see

https://wiki.debian.org/ToolChain/LTO

The goal is to enable this optimization by default in an upcoming
Debian release in dpkg-buildflags for 64bit architectures.  The goal
is to get this package to build with link time optimizations, or to
explicitly disable link time optimizations for this package build.

To reproduce the build failure, enable the lto optimization in
testing/unstable by adding "optimize=+lto" to DEB_BUILD_MAINT_OPTIONS
in the debian/rules file, or if this macro is unset, just set it:

export DEB_BUILD_MAINT_OPTIONS = optimize=+lto

Please try to fix the build with lto enabled, fixing the packaging or
forwarding the issue upstream. If the issue cannot be fixed,
explicitly disallow building the package with lto by adding to your
rules file:

export DEB_BUILD_MAINT_OPTIONS = optimize=-lto

or adding that string to your existing setting of DEB_BUILD_MAINT_OPTIONS.

The full build log can be found at:
http://qa-logs.debian.net/2022/06/09/dpkglto/libretro-bsnes-mercury_094+git20160126-3_unstable_dpkglto.log
The last lines of the build log are at the end of this report.

[...]
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/superfx/superfx.cpp -o obj/sfc-superfx-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/armdsp/armdsp.cpp -o obj/sfc-armdsp-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/hitachidsp/hitachidsp.cpp -o obj/sfc-hitachidsp-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/necdsp/necdsp.cpp -o obj/sfc-necdsp-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/epsonrtc/epsonrtc.cpp -o obj/sfc-epsonrtc-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/sharprtc/sharprtc.cpp -o obj/sfc-sharprtc-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/spc7110/spc7110.cpp -o obj/sfc-spc7110-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/sdd1/sdd1.cpp -o obj/sfc-sdd1-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/obc1/obc1.cpp -o obj/sfc-obc1-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/hsu1/hsu1.cpp -o obj/sfc-hsu1-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/msu1/msu1.cpp -o obj/sfc-msu1-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/slot/satellaview/satellaview.cpp -o obj/sfc-satellaviewcart-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/slot/sufamiturbo/sufamiturbo.cpp -o obj/sfc-sufamiturbo-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/dsp1/dsp1.cpp -o obj/sfc-hledsp1-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/dsp2/dsp2.cpp -o obj/sfc-hledsp2-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/dsp3/dsp3.cpp -o obj/sfc-hledsp3-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/dsp4/dsp4.cpp -o obj/sfc-hledsp4-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/cx4/cx4.cpp -o obj/sfc-hlecx4-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/st0010/st0010.cpp -o obj/sfc-hlest0010-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c sfc/chip/sgb-external/sgb-external.cpp -o obj/sfc-sgbexternal-accuracy.o
g++ -g -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++0x -I. -O2 -fomit-frame-pointer -fPIC -D__LIBRETRO__ -DPROFILE_ACCURACY -c target-libretro/libretro.cpp -o obj/libretro-accuracy.o
target-libretro/libretro.cpp: In member function ‘virtual uint32_t Callbacks::videoColor(unsigned int, uint16_t, uint16_t, uint16_t, uint16_t)’:
target-libretro/libretro.cpp:382:3: warning: control reaches end of non-void function [-Wreturn-type]
  382 |   }
      |   ^
g++ -o out/bsnes_mercury_accuracy_libretro.so -shared obj/libco.o obj/processor-arm.o obj/processor-gsu.o obj/processor-hg51b.o obj/processor-lr35902.o obj/processor-r65816.o obj/processor-spc700.o obj/processor-upd96050.o obj/gb-interface.o obj/gb-system.o obj/gb-scheduler.o obj/gb-memory.o obj/gb-cartridge.o obj/gb-cpu.o obj/gb-ppu.o obj/gb-apu.o obj/gb-cheat.o obj/gb-video.o obj/sfc-interface-accuracy.o obj/sfc-system-accuracy.o obj/sfc-controller-accuracy.o obj/sfc-cartridge-accuracy.o obj/sfc-cheat-accuracy.o obj/sfc-memory-accuracy.o obj/sfc-cpu-accuracy.o obj/sfc-smp-accuracy.o obj/sfc-dsp-accuracy.o obj/sfc-ppu-accuracy.o obj/sfc-satellaviewbase-accuracy.o obj/sfc-icd2-accuracy.o obj/sfc-bsx-accuracy.o obj/sfc-nss-accuracy.o obj/sfc-event-accuracy.o obj/sfc-sa1-accuracy.o obj/sfc-superfx-accuracy.o obj/sfc-armdsp-accuracy.o obj/sfc-hitachidsp-accuracy.o obj/sfc-necdsp-accuracy.o obj/sfc-epsonrtc-accuracy.o obj/sfc-sharprtc-accuracy.o obj/sfc-spc7110-accuracy.o obj/sfc-sdd1-accuracy.o obj/sfc-obc1-accuracy.o obj/sfc-hsu1-accuracy.o obj/sfc-msu1-accuracy.o obj/sfc-satellaviewcart-accuracy.o obj/sfc-sufamiturbo-accuracy.o obj/sfc-hledsp1-accuracy.o obj/sfc-hledsp2-accuracy.o obj/sfc-hledsp3-accuracy.o obj/sfc-hledsp4-accuracy.o obj/sfc-hlecx4-accuracy.o obj/sfc-hlest0010-accuracy.o obj/sfc-sgbexternal-accuracy.o obj/libretro-accuracy.o -ldl -Wl,--no-undefined -Wl,--version-script=target-libretro/link.T  -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,--no-undefined
./sfc/memory/memory.hpp:50:8: warning: type ‘struct Bus’ violates the C++ One Definition Rule [-Wodr]
   50 | struct Bus {
      |        ^
./sfc/memory/memory.hpp:50:8: note: a different type is defined in another translation unit
   50 | struct Bus {
      |        ^
./sfc/memory/memory.hpp:80:35: note: the first difference of corresponding definitions is field ‘libretro_mem_map’
   80 |   vector<retro_memory_descriptor> libretro_mem_map;
      |                                   ^
./sfc/memory/memory.hpp:80:35: note: a field of same name but different type is defined in another translation unit
   80 |   vector<retro_memory_descriptor> libretro_mem_map;
      |                                   ^
./nall/vector.hpp:15:29: note: type name ‘nall::vector<SuperFamicom::retro_memory_descriptor>’ should match type name ‘nall::vector<retro_memory_descriptor>’
   15 | template<typename T> struct vector {
      |                             ^
./sfc/memory/memory.hpp:87:12: warning: ‘bus’ violates the C++ One Definition Rule [-Wodr]
   87 | extern Bus bus;
      |            ^
./sfc/memory/memory.hpp:50:8: note: type ‘struct Bus’ itself violates the C++ One Definition Rule
   50 | struct Bus {
      |        ^
sfc/memory/memory.cpp:7:5: note: ‘bus’ was previously declared here
    7 | Bus bus;
      |     ^
./processor/r65816/memory.hpp: In function ‘Enter’:
sfc/chip/sa1/memory/memory.cpp:116:7: error: inlining failed in call to ‘always_inline’ ‘op_read’: function not considered for inlining
  116 | uint8 SA1::op_read(unsigned addr) {
      |       ^
./processor/r65816/memory.hpp:2:17: note: called from here
    2 |   return op_read((regs.pc.b << 16) + regs.pc.w++);
      |                 ^
make[3]: *** [/tmp/ccETyLlK.mk:41: /tmp/ccLMqj8t.ltrans13.ltrans.o] Error 1
make[3]: *** Waiting for unfinished jobs....
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[2]: *** [target-libretro/Makefile:42: build] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
dh_auto_build: error: make -j8 "INSTALL=install --strip-program=true" profile=accuracy ui=target-libretro compiler=\$\(CXX\) returned exit code 2
make[1]: *** [debian/rules:18: override_dh_auto_build] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:15: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

#1015518#16
Date:
2026-06-27 15:10:37 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
libretro-bsnes-mercury, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1015518@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Fabian Greffrath <fabian@debian.org> (supplier of updated libretro-bsnes-mercury package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sat, 27 Jun 2026 16:41:35 +0200
Source: libretro-bsnes-mercury
Architecture: source
Version: 094+git20220807-9
Distribution: unstable
Urgency: medium
Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
Changed-By: Fabian Greffrath <fabian@debian.org>
Closes: 1015518 1045446 1136521
Changes:
 libretro-bsnes-mercury (094+git20220807-9) unstable; urgency=medium
 .
   * Team upload.
   * Explicitly disable LTO in DEB_BUILD_MAINT_OPTIONS (Closes: #1015518)
   * Properly remove shared object files in clean rule (Closes: #1045446)
   * Add Depends: procps to binary packages (Closes: #1136521)
   * Fix old-fsf-address-in-copyright-file
   * Fix debian-rules-uses-as-needed-linker-flag
   * Fix redundant-priority-optional-field
   * Run wrap-and-sort -ast
Checksums-Sha1:
 e9a55122f4792df7fd43eab44f756dbc41507e9b 3050 libretro-bsnes-mercury_094+git20220807-9.dsc
 24e4f65a665fbd6561c27ac1a599b08719f89bfa 10016 libretro-bsnes-mercury_094+git20220807-9.debian.tar.xz
 ce2760203f970bd3a5811071c1eda1945ce74416 9132 libretro-bsnes-mercury_094+git20220807-9_amd64.buildinfo
Checksums-Sha256:
 2077f71da11cc321937feb4e03281d3fea9daab5fb2c9c7cf494384cc8a448ca 3050 libretro-bsnes-mercury_094+git20220807-9.dsc
 8c83d5fbe18880ceac7814c9f56457cd59b4f509574c9cac855840d35d5d0b74 10016 libretro-bsnes-mercury_094+git20220807-9.debian.tar.xz
 632d3f6f5cf21972a857ba1759db8aa4f8276520137bb510ce3099ac9e1b3a63 9132 libretro-bsnes-mercury_094+git20220807-9_amd64.buildinfo
Files:
 89e5992eb5446dff8ba9d08627265a9c 3050 games optional libretro-bsnes-mercury_094+git20220807-9.dsc
 3f5cf7bac5dc738834fd8e28e83d6ba6 10016 games optional libretro-bsnes-mercury_094+git20220807-9.debian.tar.xz
 656de0b92a73a7c3aee27612d7284fbc 9132 games optional libretro-bsnes-mercury_094+git20220807-9_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEIsF2SKlSa4TfGRyWy+qOlwzNWd8FAmo/4mMSHGZhYmlhbkBk
ZWJpYW4ub3JnAAoJEMvqjpcMzVnf8kgQAOfG54XxBCIzMmhKsrd+oqvHulNsBaUZ
AmZUSHYjNyHvNcZTRQTFOWbgARdx8rZPjnWawnZ/BVEHzDfRaepmb5p/a0AnllcA
lXeXH3oEdBueVCvHi3MHQa7cTOjxyk+uvodDPe/ucYwM0EPJhF/2zVNprcMLw+Kz
php01SaN2V159IIcsf02GForQyuhkS43lPdlEzdSkm2sRGdpK9qxj4wogSpEHyZj
BtwL9G9jiqStp5u33Wwgd6z8s+aiqd75RmxzkW4sdu/HIYf0xpjakDVmXhFMS8FL
3ueoVOOoRHzCkphtI6640yRefJqWKeTAY7/WsgXQueRBLul6NdJHj/xp3DKpbdFn
PC/SdTS/jEbMUxyIm2HWDG/Q/NTuvlE/lJwlpgfd6Q+P8sA+QEbjOjchVbrGXlAl
nIlqXNUFGo7lM9ojPYLXOAUK2KZUZOFrchnlwSO7E2T0KwRTx/SXBG6SY725bPXP
V3MRB+Nl9GUsCij5CDaOxb+kvSzVDqzuXrAFZ/IUoprbI9f2TUN84runCOPhjui3
WOqTgx+jzn7pJ9nuS02jU7CqkttWjy5viVFejH655X7QiY+k3W38+NSE5qLsjHcc
47cvCA9UDw/XTDVwpM5IHZN9gmDj3kl3AwWDLqNkpyaZL60K9YyKqQj+4yJNysUl
lTSl+ge0L+T+
=n4lA
-----END PGP SIGNATURE-----