Open GoogleCodeExporter opened 8 years ago
Please try to change this lines (the __GNUC_PREREQ "#if, #else, #endif" block)
to following and report back
#if defined(__GNUC_PREREQ)
/* the original block */
#if __GNUC_PREREQ (4, 7)
# define GET_PC_THUNK_STR(reg) "__x86.get_pc_thunk." #reg
#else
# define GET_PC_THUNK_STR(reg) "__i686.get_pc_thunk." #reg
#endif
/* end of the original block */
#else
# define GET_PC_THUNK_STR(reg) "__i686.get_pc_thunk." #reg
#endif
Also test if it works (please remove the previously mentioned change) when you
add following line before the statement
#include <features.h>
I don't have a OpenBSD installed at the moment to check these things. Getting
feedback would help a lot to find an acceptable fix for OpenBSD
Original comment by s...@narfation.org
on 9 Jan 2014 at 7:36
OpenBSD doesn’t have features.h.
The change that you described fixes the build here, thanks. Now that core
works, though, it reveals that glide64 runs out of registers:
c++ -fvisibility-inlines-hidden -O2 -pipe -g -Wall -ffast-math
-fno-strict-aliasing -fvisibility=hidden -I../../src -I../../src/wrapper -DGCC
-msse -fno-PIC -I/usr/X11R6/include -I/usr/include/dev/pci/drm
-I/usr/local/include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
-I/usr/X11R6/include -DXTHREADS "-I/usrlocal/include/mupen64plus" -MD -c -o
_obj/TexCache.o ../../src/TexCache.cpp
../../src/TexLoad4b.h: In function 'DWORD Load4bCI(unsigned char*, unsigned
char*, int, int, int, int, int)':
../../src/TexLoad4b.h:748: error: can't find a register in class 'GENERAL_REGS'
while reloading 'asm'
../../src/TexLoad4b.h:1451: error: can't find a register in class
'GENERAL_REGS' while reloading 'asm'
../../src/TexLoad4b.h:748: error: 'asm' operand has impossible constraints
../../src/TexLoad4b.h:1451: error: 'asm' operand has impossible constraints
Makefile:395: recipe for target '_obj/TexCache.o' failed
I can think of a few places to go from here…
* Use -fomit-frame-pointer on i386/PIE
* On i386/PIE, skip asm altogether and fall back to C code
* Investigate why this doesn’t happen on glide64mk2
Thoughts? I’m leaning toward the second option, since i386 is so
register-starved it is going to be a pain with PIE no matter what.
Original comment by anth...@cathet.us
on 9 Jan 2014 at 8:27
It doesn't happen with glide64mk2 because I've removed the asm stuff and
replaced it with C versions. And just disabling ASM for glide64 is not an
option because no one added pure C versions of these functions.
It really seems to be a big hassle to use GCC 4.2 (I can build a i386 PIC/PIE
version of m64p with GCC 4.8). Is OpenBSD now also trying to switch to LLVM?
Because it is probably a better idea to just use/port the stuff to clang/clang++
Just tried to use it with
make -C projects/unix CC=clang CXX=clang++ OPTFLAGS="-O2" V=1 all
(-O2 was used because I don't have the working goldplugin for link-time
optimization installed). Many components seem to build quite fine with it. You
may have to replace things like __builtin_ia32_loadups(...) with
#include <xmmintrin.h>
_mm_loadu_ps(...)
Here is an example
https://github.com/ecsv/mupen64plus-video-glide64/commit/96f51afcf4fa02405fa860e
03031f8ce97abc5d9
Original comment by s...@narfation.org
on 9 Jan 2014 at 9:40
It is not that difficult for me to switch the package to LLVM or GCC 4.6. But
really, this kind of thing should not be compiler dependent; there should at
least be a C fallback for the asm. I would be willing to look into porting the
C over from glide64mk2...
Original comment by anth...@cathet.us
on 9 Jan 2014 at 3:57
I have started with it in
https://github.com/ecsv/mupen64plus-video-glide64/tree/noasm
Please pick it up, continue + test it
Original comment by s...@narfation.org
on 11 Jan 2014 at 1:42
Original issue reported on code.google.com by
anth...@cathet.us
on 9 Jan 2014 at 4:39