Build fail with gnome extension on core22

I have a snap (x16emu) which I’m trying to update from core20 to core22, to get a new toolchain. It used to build fine on core20, but the upstream project made a change, which seems to need a newer cc65, which I’ll get in core22.

Unfortunately, moving from the core20 gnome-3-38 to core22 gnome extension causes it to build fail with a weird message:

lto1: fatal error: bytecode stream in file ‘build/x16emu/cpu/fake6502.o’ generated with LTO version 11.2 instead of the expected 11.3  

I’ve never seen this message, and can’t find much help online.

Note, if I comment out the gnome extension it builds fine. Something in the gnome extension (ld?) is borking this build. Help?

Steps to reproduce:

  1. Clone https://github.com/popey/x16emu-snap
  2. Change core20 to core22
  3. Change gnome-3-38 to gnome
  4. Use snapcraft to build

It fails:

:: g++ -o x16emu build/x16emu/cpu/fake6502.o build/x16emu/memory.o build/x16emu/disasm.o build/x16emu/video.o build/x16emu/i2c.o build/x16emu/smc.o build/x16emu/rtc.o build/x16emu/via.o build/x16emu/serial.o build/x16emu/ieee.o build/x16emu/vera_spi.o build/x16emu/audio.o build/x16emu/vera_pcm.o build/x16emu/vera_psg.o build/x16emu/sdcard.o build/x16emu/main.o build/x16emu/debugger.o build/x16emu/javascript_interface.o build/x16emu/joystick.o build/x16emu/rendertext.o build/x16emu/keyboard.o build/x16emu/icon.o build/x16emu/timing.o build/x16emu/wav_recorder.o build/x16emu/testbench.o build/x16emu/files.o build/x16emu/cartridge.o build/x16emu/iso_8859_15.o build/x16emu/ymglue.o build/x16emu/extern/ymfm/src/ymfm_opm.o -lSDL2 -lm -lz -flto            
:: lto1: fatal error: bytecode stream in file ‘build/x16emu/cpu/fake6502.o’ generated with LTO version 11.2 instead of the expected 11.3                                                     
:: compilation terminated.                                                       
:: lto-wrapper: fatal error: g++ returned 1 exit status
:: compilation terminated.
:: /snap/gnome-42-2204-sdk/current/usr/bin/ld: error: lto-wrapper failed
:: collect2: error: ld returned 1 exit status
:: make: *** [Makefile:81: x16emu] Error 1
'override-build' in part 'x16-emulator' failed with code 2. 

Comment out the extension, and it builds fine.

You can override the PATH in the build-environment to make it use ld from /usr/bin since you really don’t need anything special from the sdk snap.

I also submitted a PR for you https://github.com/popey/x16emu-snap/pull/8

1 Like