ZDoom / ZMusic

GZDoom's music system as a standalone library
https://forum.zdoom.org/index.php
61 stars 32 forks source link

Build fails with LTO #56

Closed eli-schwartz closed 7 months ago

eli-schwartz commented 7 months ago

I tried to build with the following *FLAGS to optimize the build: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing

Note the -Werror=* flags are used to help detect cases where the compiler tries to optimize by assuming UB cannot exist in the source code -- if it does exist, ordinarily the code would be miscompiled, and this says to make the miscompilation a fatal error.

I got this error:

FAILED: source/libzmusic.so.1.1.12 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -fPIC -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security  -Wl,-O1 -Wl,--as-needed -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wl,--defsym=__gentoo_check_ldflags__=0 -shared -Wl,-soname,libzmusic.so.1 -o source/libzmusic.so.1.1.12 thirdparty/dumb/CMakeFiles/dumb.dir/src/core/unload.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/rendsig.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/rendduh.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/register.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/readduh.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/rawsig.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/makeduh.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/loadduh.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/dumbfile.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/duhtag.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/duhlen.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/core/atexit.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/stdfile.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/silence.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/sampbuf.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/riff.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/resample.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/memfile.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/clickrem.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/barray.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/xmeffect.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readxm2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readxm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readstm2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readstm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/reads3m2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/reads3m.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readriff.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readptm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readpsm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readoldpsm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readokt2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readokt.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readmtm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readmod2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readmod.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readdsmf.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readasy.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readamf2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readamf.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readam.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/read6692.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/read669.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/ptmeffect.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadxm2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadxm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadstm2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadstm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loads3m2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loads3m.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadriff2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadriff.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadptm2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadptm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadpsm2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadpsm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadoldpsm2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadoldpsm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadokt2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadokt.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadmtm2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadmtm.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadmod2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadmod.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadasy2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadasy.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadamf2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadamf.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/load6692.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/load669.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/itunload.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/itrender.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/itread2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/itread.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/itorder.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/itmisc.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/itload2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/itload.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readany.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadany2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/loadany.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/it/readany2.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/resampler.c.o thirdparty/dumb/CMakeFiles/dumb.dir/src/helpers/lpc.c.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Blip_Buffer.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Classic_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Data_Reader.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Dual_Resampler.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Effects_Buffer.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Fir_Resampler.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/gme.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Gme_File.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/M3u_Playlist.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Multi_Buffer.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Music_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Ay_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Ym2612_Nuked.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Sms_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Ay_Cpu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Ay_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Gb_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Gb_Cpu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Gb_Oscs.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Gbs_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Gym_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Hes_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Hes_Cpu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Hes_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Kss_Cpu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Kss_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Kss_Scc_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Nes_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Nes_Cpu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Nes_Fme7_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Nes_Namco_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Nes_Oscs.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Nes_Vrc6_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Nsf_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Nsfe_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Sap_Apu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Sap_Cpu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Sap_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Snes_Spc.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Spc_Cpu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Spc_Dsp.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Spc_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Spc_Filter.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Vgm_Emu.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Vgm_Emu_Impl.cpp.o thirdparty/game-music-emu/gme/CMakeFiles/gme.dir/Ym2413_Emu.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/adlmidi_midiplay.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/adlmidi_opl3.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/adlmidi_private.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/adlmidi.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/adlmidi_load.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/inst_db.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/chips/opal_opl3.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/chips/dosbox/dbopl.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/chips/nuked_opl3_v174.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/chips/java_opl3.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/chips/dosbox_opl3.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/chips/nuked_opl3.cpp.o thirdparty/adlmidi/CMakeFiles/adl.dir/chips/nuked/nukedopl3_174.c.o thirdparty/adlmidi/CMakeFiles/adl.dir/chips/nuked/nukedopl3.c.o thirdparty/adlmidi/CMakeFiles/adl.dir/wopl/wopl_file.c.o thirdparty/oplsynth/CMakeFiles/oplsynth.dir/fmopl.cpp.o thirdparty/oplsynth/CMakeFiles/oplsynth.dir/musicblock.cpp.o thirdparty/oplsynth/CMakeFiles/oplsynth.dir/nukedopl3.cpp.o thirdparty/oplsynth/CMakeFiles/oplsynth.dir/opl_mus_player.cpp.o thirdparty/oplsynth/CMakeFiles/oplsynth.dir/OPL3.cpp.o thirdparty/oplsynth/CMakeFiles/oplsynth.dir/oplio.cpp.o thirdparty/oplsynth/CMakeFiles/oplsynth.dir/dosbox/opl.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/opnmidi_load.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/opnmidi_private.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/opnmidi.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/opnmidi_midiplay.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/opnmidi_opn2.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/np2/fmgen_fmgen.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/np2/fmgen_opna.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/np2/fmgen_fmtimer.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/np2/fmgen_file.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/np2/fmgen_psg.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/mame_opn2.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/gens_opn2.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/mame_opna.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/np2_opna.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/mamefm/ymdeltat.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/mamefm/resampler.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/mamefm/fm.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/nuked_opn2.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/gens/Ym2612.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/gx_opn2.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/pmdwin_opna.cpp.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/nuked/ym3438.c.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/gx/gx_ym2612.c.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/pmdwin/opna.c.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/pmdwin/psg.c.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/pmdwin/rhythmdata.c.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/mamefm/emu2149.c.o thirdparty/opnmidi/CMakeFiles/opn.dir/chips/mame/mame_ym2612fm.c.o thirdparty/opnmidi/CMakeFiles/opn.dir/wopn/wopn_file.c.o thirdparty/timidity/CMakeFiles/timidity.dir/common.cpp.o thirdparty/timidity/CMakeFiles/timidity.dir/instrum.cpp.o thirdparty/timidity/CMakeFiles/timidity.dir/instrum_dls.cpp.o thirdparty/timidity/CMakeFiles/timidity.dir/instrum_font.cpp.o thirdparty/timidity/CMakeFiles/timidity.dir/instrum_sf2.cpp.o thirdparty/timidity/CMakeFiles/timidity.dir/mix.cpp.o thirdparty/timidity/CMakeFiles/timidity.dir/playmidi.cpp.o thirdparty/timidity/CMakeFiles/timidity.dir/resample.cpp.o thirdparty/timidity/CMakeFiles/timidity.dir/timidity.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/fft4g.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/reverb.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/common.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/configfile.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/effect.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/filter.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/freq.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/instrum.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/mblock.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/mix.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/playmidi.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/quantity.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/readmidic.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/recache.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/resample.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/sbkconv.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/sffile.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/sfitem.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/smplfile.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/sndfont.cpp.o thirdparty/timidityplus/CMakeFiles/timidityplus.dir/tables.cpp.o thirdparty/wildmidi/CMakeFiles/wildmidi.dir/file_io.cpp.o thirdparty/wildmidi/CMakeFiles/wildmidi.dir/gus_pat.cpp.o thirdparty/wildmidi/CMakeFiles/wildmidi.dir/reverb.cpp.o thirdparty/wildmidi/CMakeFiles/wildmidi.dir/wildmidi_lib.cpp.o thirdparty/wildmidi/CMakeFiles/wildmidi.dir/wm_error.cpp.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/utils/fluid_conv.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/utils/fluid_hash.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/utils/fluid_list.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/utils/fluid_ringbuffer.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/utils/fluid_settings.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/utils/fluid_sys.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/sfloader/fluid_defsfont.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/sfloader/fluid_sfont.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/sfloader/fluid_sffile.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/sfloader/fluid_samplecache.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_adsr_env.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_chorus.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_iir_filter.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_lfo.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_rvoice.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_rvoice_dsp.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_rvoice_event.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_rvoice_mixer.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/rvoice/fluid_rev.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/synth/fluid_chan.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/synth/fluid_event.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/synth/fluid_gen.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/synth/fluid_mod.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/synth/fluid_synth.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/synth/fluid_synth_monopoly.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/synth/fluid_tuning.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/synth/fluid_voice.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/midi/fluid_midi.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/midi/fluid_midi_router.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/midi/fluid_seqbind.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/midi/fluid_seqbind_notes.cpp.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/midi/fluid_seq.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/midi/fluid_seq_queue.cpp.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/drivers/fluid_adriver.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/drivers/fluid_mdriver.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/bindings/fluid_filerenderer.c.o thirdparty/fluidsynth/src/CMakeFiles/fluidsynth.dir/bindings/fluid_ladspa.c.o source/CMakeFiles/zmusic.dir/loader/i_module.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_base_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_adlmidi_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_opl_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_opnmidi_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_timiditypp_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_fluidsynth_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_softsynth_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_timidity_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_wildmidi_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_wavewriter_mididevice.cpp.o source/CMakeFiles/zmusic.dir/midisources/midisource.cpp.o source/CMakeFiles/zmusic.dir/midisources/midisource_mus.cpp.o source/CMakeFiles/zmusic.dir/midisources/midisource_smf.cpp.o source/CMakeFiles/zmusic.dir/midisources/midisource_hmi.cpp.o source/CMakeFiles/zmusic.dir/midisources/midisource_xmi.cpp.o source/CMakeFiles/zmusic.dir/midisources/midisource_mids.cpp.o source/CMakeFiles/zmusic.dir/streamsources/music_dumb.cpp.o source/CMakeFiles/zmusic.dir/streamsources/music_gme.cpp.o source/CMakeFiles/zmusic.dir/streamsources/music_libsndfile.cpp.o source/CMakeFiles/zmusic.dir/streamsources/music_opl.cpp.o source/CMakeFiles/zmusic.dir/streamsources/music_xa.cpp.o source/CMakeFiles/zmusic.dir/musicformats/music_stream.cpp.o source/CMakeFiles/zmusic.dir/musicformats/music_midi.cpp.o source/CMakeFiles/zmusic.dir/musicformats/music_cd.cpp.o source/CMakeFiles/zmusic.dir/decoder/sounddecoder.cpp.o source/CMakeFiles/zmusic.dir/decoder/sndfile_decoder.cpp.o source/CMakeFiles/zmusic.dir/decoder/mpg123_decoder.cpp.o source/CMakeFiles/zmusic.dir/zmusic/configuration.cpp.o source/CMakeFiles/zmusic.dir/zmusic/zmusic.cpp.o source/CMakeFiles/zmusic.dir/zmusic/critsec.cpp.o source/CMakeFiles/zmusic.dir/loader/test.c.o source/CMakeFiles/zmusic.dir/mididevices/music_alsa_mididevice.cpp.o source/CMakeFiles/zmusic.dir/mididevices/music_alsa_state.cpp.o  /usr/lib64/libsndfile.so  /usr/lib64/libasound.so  /usr/lib64/libz.so  -ldl  /usr/lib64/libglib-2.0.so && :
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3_174.h:59:8: error: type ‘struct _opl3_slot’ violates the C++ One Definition Rule [-Werror=odr]
   59 | struct _opl3_slot {
      |        ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3.h:62:8: note: a different type is defined in another translation unit
   62 | struct _opl3_slot {
      |        ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3_174.h:85:12: note: the first difference of corresponding definitions is field ‘pg_phase’
   85 |     Bit32u pg_phase;
      |            ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3.h:88:12: note: a field with different name is defined in another translation unit
   88 |     Bit32u pg_reset;
      |            ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3_174.h:93:8: error: type ‘struct _opl3_channel’ violates the C++ One Definition Rule [-Werror=odr]
   93 | struct _opl3_channel {
      |        ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3.h:100:8: note: a different type is defined in another translation unit
  100 | struct _opl3_channel {
      |        ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3.h:114:11: note: the first difference of corresponding definitions is field ‘ch_num’
  114 |     Bit8u ch_num;
      |           ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3.h:100:8: note: a type with different number of fields is defined in another translation unit
  100 | struct _opl3_channel {
      |        ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3_174.h:115:8: error: type ‘struct _opl3_chip’ violates the C++ One Definition Rule [-Werror=odr]
  115 | struct _opl3_chip {
      |        ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3.h:123:8: note: a different type is defined in another translation unit
  123 | struct _opl3_chip {
      |        ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3_174.h:117:15: note: the first difference of corresponding definitions is field ‘chipslot’
  117 |     opl3_slot chipslot[36];
      |               ^
/var/tmp/portage/media-libs/zmusic-1.1.12/work/ZMusic-1.1.12/thirdparty/adlmidi/chips/nuked/nukedopl3.h:125:15: note: a field with different name is defined in another translation unit
  125 |     opl3_slot slot[36];
      |               ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Downstream report: https://bugs.gentoo.org/860117 Full build log: build.log

eli-schwartz commented 7 months ago

Note: the original gentoo bug was for zmusic 1.1.4, but I locally tested updating to 1.1.12 and it still manifested.

Gentoo has not updated to 1.1.12 and I don't plan to submit the version bump I tried because it is not packageable quality -- the version update started to bundle a bunch more system libraries which I would have to disentangle first. It was okay for a reproducer.

coelckers commented 7 months ago

You have to build with less strict error settings. ZMusic contains several third party modules which may clash. This is something we won't change because the resulting problems will be far, far worse.