libretro / snes9x

Snes9x - Portable Super Nintendo Entertainment System (TM) emulator
http://www.snes9x.com
Other
47 stars 56 forks source link

Build error with symlinked gcc/g++ rather than CC/CXX flags #231

Closed Sanaki closed 4 years ago

Sanaki commented 4 years ago

For some reason I'm not clear on, I can successfully build by exporting CC=gcc-9 and CXX=g++-9, but if I attempt to build with gcc/g++ symlinked in ~/bin/ to gcc-9/g++-9, it errors out. This seems like a bug in snes9x. I tried various things before realizing the flags fixed it, including recloning the repo, updating and rebuilding boost (just in case it was to blame), etc.

Build error with symlinked gcc/g++ in ~/bin/:

cc -I../libretro -I../libretro/libretro-common/include -I.. -I../apu/ -I../apu/bapu   -DGIT_VERSION=\"" 6db918c"\" -flto -O3 -DNDEBUG -fomit-frame-pointer -Wall -W -Wno-unused-parameter -Wno-missing-field-initializers -fPIC -DRIGHTSHIFT_IS_SAR -D__LIBRETRO__ -DALLOW_CPU_OVERCLOCK -DHAVE_STDINT_H -c -o../filter/snes_ntsc.o ../filter/snes_ntsc.c
g++ -fPIC -shared -Wl,--version-script=link.T -Wl,-z,defs -o snes9x_libretro.so ../apu/apu.o ../apu/bapu/dsp/sdsp.o ../apu/bapu/smp/smp.o ../apu/bapu/smp/smp_state.o ../bsx.o ../c4.o ../c4emu.o ../cheats.o ../cheats2.o ../clip.o ../conffile.o ../controls.o ../cpu.o ../cpuexec.o ../cpuops.o ../crosshairs.o ../dma.o ../dsp.o ../dsp1.o ../dsp2.o ../dsp3.o ../dsp4.o ../fxinst.o ../fxemu.o ../gfx.o ../globals.o ../logger.o ../memmap.o ../obc1.o ../msu1.o ../ppu.o ../stream.o ../sa1.o ../sa1cpu.o ../screenshot.o ../sdd1.o ../sdd1emu.o ../seta.o ../seta010.o ../seta011.o ../seta018.o ../snapshot.o ../snes9x.o ../spc7110.o ../srtc.o ../tile.o ../tileimpl-n1x1.o ../tileimpl-n2x1.o ../tileimpl-h2x1.o ../sha256.o ../bml.o ../movie.o ../libretro/libretro.o ../filter/snes_ntsc.o -flto  -lm
lto1: fatal error: bytecode stream in file '../filter/snes_ntsc.o' generated with LTO version 6.2 instead of the expected 8.1
compilation terminated.
Sanaki commented 4 years ago

Closing this. Seems it was a result of having cc and c++ still pointing at gcc/g++ 7.5. Added symlinks for those to gcc and g++ so they'll update with the other two. It's probably still erroneous behavior, but it's unlikely to actually warrant a fix.