stefan-gr / abendbrot

Desktop oriented overlay for various ebuilds and the occasional gamer
19 stars 13 forks source link

bnes-libretro fails to build on gentoo #34

Closed lucasmr closed 8 years ago

lucasmr commented 8 years ago

Using ~amd64, with gcc 5.3.0:

In file included from nes/cartridge/board/board.cpp:9:0, from nes/cartridge/cartridge.cpp:7: nes/cartridge/board/nes-fxrom.cpp: In member function ‘unsigned int NES::NES_FxROM::ciram_addr(unsigned int) const’: nes/cartridge/board/nes-fxrom.cpp:37:16: warning: switch condition has type bool [-Wswitch-bool] switch(mirror) { ^ In file included from nes/cartridge/board/board.cpp:12:0, from nes/cartridge/cartridge.cpp:7: nes/cartridge/board/nes-pxrom.cpp: In member function ‘unsigned int NES::NES_PxROM::ciram_addr(unsigned int) const’: nes/cartridge/board/nes-pxrom.cpp:43:16: warning: switch condition has type bool [-Wswitch-bool] switch(mirror) { ^ In file included from ./nall/array.hpp:10:0, from ./nes/nes.hpp:22, from nes/cartridge/cartridge.cpp:1: ./nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 2]’: ./nall/varint.hpp:19:78: required from ‘unsigned int nall::uint_t::operator=(unsigned int) [with unsigned int bits = 2u]’ nes/cartridge/chip/mmc1.cpp:80:16: required from here ./nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 2]’ not a return-statement } ^ ./nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 5]’: ./nall/varint.hpp:19:78: required from ‘unsigned int nall::uint_t::operator=(unsigned int) [with unsigned int bits = 5u]’ nes/cartridge/chip/mmc1.cpp:84:21: required from here ./nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 5]’ not a return-statement ./nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 4]’: ./nall/varint.hpp:19:78: required from ‘unsigned int nall::uint_t::operator=(unsigned int) [with unsigned int bits = 4u]’ nes/cartridge/chip/mmc1.cpp:93:18: required from here ./nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 4]’ not a return-statement ./nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 3]’: ./nall/varint.hpp:19:78: required from ‘unsigned int nall::uint_t::operator=(unsigned int) [with unsigned int bits = 3u]’ nes/cartridge/chip/mmc3.cpp:98:15: required from here ./nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 3]’ not a return-statement ./nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 10]’: ./nall/varint.hpp:19:78: required from ‘unsigned int nall::uint_t::operator=(unsigned int) [with unsigned int bits = 10u]’ nes/cartridge/chip/mmc5.cpp:203:35: required from here ./nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 10]’ not a return-statement ./nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 12]’: ./nall/varint.hpp:18:62: required from ‘unsigned int nall::uint_t::operator--() [with unsigned int bits = 12u]’ nes/cartridge/chip/vrc6.cpp:27:10: required from here ./nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 12]’ not a return-statement ./nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 1]’: ./nall/varint.hpp:17:62: required from ‘unsigned int nall::uint_t::operator++() [with unsigned int bits = 1u]’ nes/cartridge/chip/vrc6.cpp:63:12: required from here ./nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 1]’ not a return-statement ./nall/bit.hpp: In instantiation of ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 6]’: ./nall/varint.hpp:19:78: required from ‘unsigned int nall::uint_t::operator=(unsigned int) [with unsigned int bits = 6u]’ nes/cartridge/chip/vrc6.cpp:195:19: required from here ./nall/bit.hpp:13:3: error: body of constexpr function ‘constexpr unsigned int nall::uclip(unsigned int) [with int bits = 6]’ not a return-statement x86_64-pc-linux-gnu-g++ -std=gnu++0x -O3 -fomit-frame-pointer -fno-tree-vectorize -I. -fPIC -c nes/memory/memory.cpp -o obj/nes-memory.o Makefile:72: recipe for target 'obj/nes-cartridge.o' failed make: *\ [obj/nes-cartridge.o] Error 1

stefan-gr commented 8 years ago

Thanks for the report, seems like the fork needs to be updated to gcc 5; see: libretro/bnes-libretro#7 I'm no good with c/c++. I will drop this core as default and let the users know to make gcc <4.9 active if someone needs it. Let's see, I guess nestopia is popular enough to replace it.

If someone is interested in fixing that they should take a look at: https://github.com/libretro/bsnes-libretro/blob/libretro/nall/bit.hpp It seems to be almost the same but i don't know enough to adapt it.

orbea commented 8 years ago

Does this now build for you? https://github.com/libretro/bnes-libretro/commit/0bfc2d17de14ecf66b7520a14f11134736d05716

stefan-gr commented 8 years ago

@orbea Thanks for the fix, It builds now. I removed the <=gcc4.9 requirement for the live and all future ebuilds.