libretro / libretro-super

Super repo for other libretro projects. Fetches, builds and installs.
MIT License
406 stars 284 forks source link

OSX ppc: Gambatte, nxengine, tgbdual and tyrquake can't compile, incorrectly detects arch. #551

Open snigel opened 7 years ago

snigel commented 7 years ago

osx 10.5 ppc. Identical issues with gambatte, tgbdual, tyrquake and nxengine.

Trying to compile with Apple gcc 4.2 gives loads of "Flag option -o has already been seen!" and the compilation fails. So lets switch to gcc 4.7 from macports.

Now the build gets a bit further, but still fails, since gcc 4.7 from macports does not support the arch flag. But looking at the build, it's not only that arch is being used, it's the wrong arch as well. c++ -c -olibgambatte/src/bootloader.o libgambatte/src/bootloader.cpp -O2 -DNDEBUG -fno-exceptions -fno-rtti -std=c++98 -DHAVE_STDINT_H -fPIC -D__LIBRETRO__ -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DINLINE=inline -DVIDEO_RGB565 -DHAVE_NETWORK -arch i386 -arch x86_64 -Ilibgambatte/src -Ilibgambatte/src/../include -Ilibgambatte/src/../../common -Ilibgambatte/src/../../common/resample -Ilibgambatte/src/../libretro -Ilibgambatte/src/../libretro-common/include

From Makefile.libretro:

ifeq ($(ARCHFLAGS),)
   ifeq ($(archs),ppc)
      ARCHFLAGS = -arch ppc -arch ppc64
   else
      #ARCHFLAGS = -arch i386 -arch x86_64
   endif
endif

For a quick test I just commented out the line. A proper check should detect ppc and omit the arch flag. After these tweaks gambatte and tyrquake builds!

Nxengine comes further but fails at:

Assertion failed: (target->definition() != ld::Atom::definitionProxy), function addClassicRelocs, file src/ld/OutputFile.cpp, line 2937.
0  0xc930  _mh_execute_header + 47408
1  0x2918c  _mh_execute_header + 164236
2  0x2a898  _mh_execute_header + 170136
3  0x2de94  _mh_execute_header + 183956
4  0xdae8  _mh_execute_header + 51944
5  0x36a0  _mh_execute_header + 9888
collect2: error: ld returned 1 exit status

tgb dual also comes further but fails

Undefined symbols for architecture ppc:
  "vtable for __cxxabiv1::__si_class_type_info", referenced from:
      typeinfo for apu_snd in apu.o
      typeinfo for dmy_renderer in dmy_renderer.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "___cxa_pure_virtual", referenced from:
      vtable for sound_renderer in apu.o
      vtable for renderer in dmy_renderer.o
  "vtable for __cxxabiv1::__class_type_info", referenced from:
      typeinfo for sound_renderer in apu.o
      typeinfo for renderer in dmy_renderer.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "___cxa_guard_release", referenced from:
      apu::write(unsigned short, unsigned char, int) in apu.o
  "operator new(unsigned long)", referenced from:
      apu::apu(gb*)   in apu.o
      apu::apu(gb*)   in apu.o
      cheat::add_cheat(cheat_dat*)     in cheat.o
      cheat::load(__sFILE*)     in cheat.o
      gb::gb(renderer*, bool, bool) in gb.o
      gb::gb(renderer*, bool, bool) in gb.o
      _retro_load_game in libretro.o
      ...
  "___cxa_guard_acquire", referenced from:
      apu::write(unsigned short, unsigned char, int) in apu.o
  "std::__detail::_List_node_base::_M_unhook()", referenced from:
      cheat::delete_cheat(char*)  in cheat.o
  "std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)", referenced from:
      cheat::add_cheat(cheat_dat*)     in cheat.o
  "operator delete(void*)", referenced from:
      cheat::delete_cheat(char*)  in cheat.o
      std::_List_base<cheat_dat, std::allocator<cheat_dat> >::_M_clear() in cheat.o
      gb::~gb()   in gb.o
      gb::~gb()   in gb.o
      gb::gb(renderer*, bool, bool) in gb.o
      gb::gb(renderer*, bool, bool) in gb.o
      dmy_renderer::~dmy_renderer() in dmy_renderer.o
      ...
  "___gxx_personality_v0", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in gb.o
      Dwarf Exception Unwind Info (__eh_frame) in libretro.o
      Dwarf Exception Unwind Info (__eh_frame) in gb.o
      Dwarf Exception Unwind Info (__eh_frame) in libretro.o
  "__Unwind_Resume", referenced from:
      gb::gb(renderer*, bool, bool) in gb.o
      gb::gb(renderer*, bool, bool) in gb.o
      _retro_load_game in libretro.o
      _retro_load_game_special in libretro.o
ld: symbol(s) not found for architecture ppc
collect2: error: ld returned 1 exit status

What's needed here is a fix that detects ppc and if so, omits the arch flag so the macports compiler can be used.

orbea commented 6 years ago

@snigel

Are these still problems? If so can you report them in the correct repos?

https://github.com/libretro/gambatte-libretro https://github.com/libretro/nxengine-libretro https://github.com/libretro/tgbdual-libretro https://github.com/libretro/tyrquake