Bug#1015518: libretro-bsnes-mercury: ftbfs with LTO (link time optimization) enabled
Matthias Klose
doko at debian.org
Tue Jul 19 17:55:51 BST 2022
Package: src:libretro-bsnes-mercury
Version: 094+git20160126-3
Severity: minor
Tags: sid bookworm
User: debian-gcc at lists.debian.org
Usertags: ftbfs-lto
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
More information about the Pkg-games-devel
mailing list