sebastianbiallas / pearpc

PearPC - PowerPC Architecture Emulator
GNU General Public License v2.0
389 stars 70 forks source link

Some errors trying to build with x86_64 #9

Closed stuaxo closed 9 years ago

stuaxo commented 9 years ago

Hi, just trying to build on 64 bit with jit on Ubuntu 15.04 and getting some casting errors:

./configure --enable-cpu=jitc_x86_64 && make
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
*** GNU, building POSIX version. we need pthread and rt.
*** x86_64 target system
checking for ranlib... ranlib
checking for gmake... no
checking for make... /usr/bin/make
checking whether /usr/bin/make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by /usr/bin/make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C preprocessor... gcc -E
checking dependency style of gcc... gcc3
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for bison... bison -y
checking for ar... /usr/bin/ar
checking for gar... (cached) /usr/bin/ar
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for clock_settime in -lrt... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking for X... libraries , headers 
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for XOpenDisplay in -lX11... yes
checking for gettimeofday... yes
checking for memset... yes
checking for setenv... yes
checking for log2... no
checking for log2 in math.h... yes
checking for exp2... no
checking for exp2 in math.h... yes
checking for ANSI C header files... (cached) yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking asm/types.h usability... yes
checking asm/types.h presence... yes
checking for asm/types.h... yes
checking for stdint.h... (cached) yes
checking for asm/types.h... (cached) yes
checking for linux/netlink.h... yes
checking for an ANSI C-conforming const... yes
checking size of char... 1
checking size of short... 2
checking size of int... 4
checking size of long int... 8
checking size of long long... 8
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating scripts/Makefile
config.status: creating src/Makefile
config.status: creating src/cpu/Makefile
config.status: creating src/cpu/cpu_generic/Makefile
config.status: creating src/cpu/cpu_jitc_x86/Makefile
config.status: creating src/cpu/cpu_jitc_x86_64/Makefile
config.status: creating src/debug/Makefile
config.status: creating src/io/Makefile
config.status: creating src/io/3c90x/Makefile
config.status: creating src/io/ide/Makefile
config.status: creating src/io/graphic/Makefile
config.status: creating src/io/rtl8139/Makefile
config.status: creating src/io/prom/Makefile
config.status: creating src/io/prom/fs/Makefile
config.status: creating src/io/prom/fs/hfs/Makefile
config.status: creating src/io/prom/fs/hfsplus/Makefile
config.status: creating src/io/cuda/Makefile
config.status: creating src/io/pci/Makefile
config.status: creating src/io/pic/Makefile
config.status: creating src/io/macio/Makefile
config.status: creating src/io/nvram/Makefile
config.status: creating src/io/usb/Makefile
config.status: creating src/io/serial/Makefile
config.status: creating src/system/Makefile
config.status: creating src/system/arch/Makefile
config.status: creating src/system/arch/x86/Makefile
config.status: creating src/system/arch/x86_64/Makefile
config.status: creating src/system/arch/generic/Makefile
config.status: creating src/system/osapi/Makefile
config.status: creating src/system/osapi/beos/Makefile
config.status: creating src/system/osapi/posix/Makefile
config.status: creating src/system/osapi/win32/Makefile
config.status: creating src/system/ui/Makefile
config.status: creating src/system/ui/beos/Makefile
config.status: creating src/system/ui/gtk/Makefile
config.status: creating src/system/ui/qt/Makefile
config.status: creating src/system/ui/sdl/Makefile
config.status: creating src/system/ui/win32/Makefile
config.status: creating src/system/ui/x11/Makefile
config.status: creating src/tools/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

./configure successful.

================================================================================
                             Configuration summary
================================================================================

cpu emulation method:                cpu_jitc_x86
compiled for architecture:           x86_64
compiled for OS-API:                 posix
compiled for UI system:              x11
enable debug:                        yes
enable profiling:                    no
make release build:                  yes
omit frame pointer:                  yes
final C compiler flags:               -Wundef -Wall -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -pthread -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe
final C++ compiler flags:             -Wundef -Wall -Woverloaded-virtual -std=c++11 -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -pthread -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe
final linker flags:                   
final linker add:                     -lpthread -lrt -lrt -lX11

================================================================================
/usr/bin/make  all-recursive
make[1]: Entering directory '/mnt/data/home/stu/projects/external/pearpc'
Making all in doc
make[2]: Entering directory '/mnt/data/home/stu/projects/external/pearpc/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/mnt/data/home/stu/projects/external/pearpc/doc'
Making all in src
make[2]: Entering directory '/mnt/data/home/stu/projects/external/pearpc/src'
Making all in cpu
make[3]: Entering directory '/mnt/data/home/stu/projects/external/pearpc/src/cpu'
Making all in cpu_jitc_x86
make[4]: Entering directory '/mnt/data/home/stu/projects/external/pearpc/src/cpu/cpu_jitc_x86'
g++ -DHAVE_CONFIG_H -I. -I../../..  -I ../..   -Wundef -Wall -Woverloaded-virtual -std=c++11 -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -pthread -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_alu.o -MD -MP -MF .deps/ppc_alu.Tpo -c -o ppc_alu.o ppc_alu.cc
In file included from jitc.h:25:0,
                 from ppc_alu.cc:29:
x86asm.h: In function ‘void asmALU32(X86ALUopc, const void*, uint32)’:
x86asm.h:237:35: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmALU32(opc, REG_NO, uint32(mem), imm);
                                   ^
x86asm.h: In function ‘void asmALU32(X86ALUopc, const void*, NativeReg)’:
x86asm.h:242:35: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmALU32(opc, REG_NO, uint32(mem), reg);
                                   ^
x86asm.h: In function ‘void asmALU32(X86ALUopc, NativeReg, const void*)’:
x86asm.h:247:40: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmALU32(opc, reg, REG_NO, uint32(mem));
                                        ^
x86asm.h: In function ‘void asmALU8(X86ALUopc, const void*, uint8)’:
x86asm.h:264:34: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmALU8(opc, REG_NO, uint32(mem), imm);
                                  ^
x86asm.h: In function ‘void asmALU8(X86ALUopc, NativeReg8, const void*)’:
x86asm.h:269:40: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmALU8(opc, reg1, REG_NO, uint32(mem));
                                        ^
x86asm.h: In function ‘void asmALU8(X86ALUopc, const void*, NativeReg8)’:
x86asm.h:274:34: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmALU8(opc, REG_NO, uint32(mem), reg1);
                                  ^
x86asm.h: In function ‘void asmAND32(const void*, uint32)’:
x86asm.h:280:30: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmAND32(REG_NO, uint32(mem), imm);
                              ^
x86asm.h: In function ‘void asmOR32(const void*, uint32)’:
x86asm.h:286:29: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmOR32(REG_NO, uint32(mem), imm);
                             ^
x86asm.h: In function ‘void asmTEST32(const void*, uint32)’:
x86asm.h:292:31: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmTEST32(REG_NO, uint32(mem), imm);
                               ^
x86asm.h: In function ‘void asmCMOV32(X86FlagTest, NativeReg, const void*)’:
x86asm.h:299:44: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmCMOV32(flags, reg1, REG_NO, uint32(mem));
                                            ^
x86asm.h: In function ‘void asmSET8(X86FlagTest, const void*)’:
x86asm.h:306:36: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
   asmSET8(flags, REG_NO, uint32(mem));
                                    ^
In file included from jitc.h:25:0,
                 from ppc_alu.cc:29:
x86asm.h: In function ‘void asmALUPS(X86ALUPSopc, NativeVectorReg, const void*)’:
x86asm.h:598:40: error: cast from ‘const void*’ to ‘uint32 {aka unsigned int}’ loses precision [-fpermissive]
  asmALUPS(opc, reg1, REG_NO, uint32(mem));
                                        ^
Makefile:400: recipe for target 'ppc_alu.o' failed
make[4]: *** [ppc_alu.o] Error 1
make[4]: Leaving directory '/mnt/data/home/stu/projects/external/pearpc/src/cpu/cpu_jitc_x86'
Makefile:351: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/mnt/data/home/stu/projects/external/pearpc/src/cpu'
Makefile:502: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/mnt/data/home/stu/projects/external/pearpc/src'
Makefile:389: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/mnt/data/home/stu/projects/external/pearpc'
Makefile:329: recipe for target 'all' failed
make: *** [all] Error 2
sebastianbiallas commented 9 years ago

This is strage, you somehow build the wrong directory (x86 instead of x86_64). I think the build script is just broken.

sebastianbiallas commented 9 years ago

Fix via d6c2385dd3c03e415d8a7f7f1b8e80d46ce57cda

mascondante commented 7 years ago

This fix got me further but it still fails at make. Autogen: https://ghostbin.com/paste/2ofj5 Configure: https://ghostbin.com/paste/89myk Make: https://ghostbin.com/paste/zgbzo

Using Ubuntu on Windows (the new Linux subsystem for Win10). Version: Trusty

If you need me to open this as a separate issue I can do that. Thank you for all your work.

stuaxo commented 7 years ago

A very late confirmation that things seemed to build for me with this fix - so the Windows 10 thing might be worth opening a separate ticket for.

mascondante commented 7 years ago

14 is where I'm at trying to compile now.

mascondante commented 7 years ago

13 was my mistake trying to use the Linux subsystem thinking it could compile for Windows because it lives in Windows without using some cross-compile magic.