cai567890 / pcsx2

Automatically exported from code.google.com/p/pcsx2
1 stars 0 forks source link

Minor coding issues + other errors when trying to compile on Linux x64 #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.sh build.sh all
2.
3.

What is the expected output? What do you see instead?

Should successfully compile but does not.

Two things:

1.replace __forceinline with simply inline in zerogs.cpp (__forceinline is
not exactly gcc compliant)
2.in zeropad.cpp move #include <sys/stat.h> to the top of header files, it
should be unqualified.
3. gcc -DPACKAGE_NAME=\"ZeroSPU2\" -DPACKAGE_TARNAME=\"zerospu2\"
-DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"ZeroSPU2\ 0.1\"
-DPACKAGE_BUGREPORT=\"zerofrog@gmail.com\" -DPACKAGE=\"ZeroSPU2\"
-DVERSION=\"0.1\" -DNDEBUG=1 -D__x86_64__=1 -I. -I./../../common/include
-I./../../3rdparty  -O3 -fomit-frame-pointer -fPIC -Wall  -Wno-unused-value
 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/include/freetype2
-I/usr/include/libpng12 -I/usr/include/pixman-1   -fPIC -O3
-fomit-frame-pointer -fPIC -Wall  -Wno-unused-value  -MT
libZeroSPU2_a-Linux.o -MD -MP -MF .deps/libZeroSPU2_a-Linux.Tpo -c -o
libZeroSPU2_a-Linux.o `test -f 'Linux/Linux.cpp' || echo './'`Linux/Linux.cpp
In file included from ./zerospu2.h:31,
                 from Linux/Linux.cpp:29:
./reg.h:182:7: warning: no newline at end of file
In file included from Linux/Linux.cpp:30:
Linux/Linux.h:75:22: warning: no newline at end of file
./misc.h: In function 'long int InterlockedExchangeAdd(volatile long int*,
long int)':
./misc.h:130: warning: no return statement in function returning non-void
/usr/include/gentoo-multilib/amd64/libintl.h: At global scope:
/usr/include/gentoo-multilib/amd64/libintl.h:40: error: expected
unqualified-id before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:40: error: expected `)' before
'const'
/usr/include/gentoo-multilib/amd64/libintl.h:40: error: expected
initializer before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:45: error: expected
unqualified-id before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:45: error: expected `)' before
'const'
/usr/include/gentoo-multilib/amd64/libintl.h:45: error: expected
initializer before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:52: error: expected
unqualified-id before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:52: error: expected `)' before
'const'
/usr/include/gentoo-multilib/amd64/libintl.h:52: error: expected
initializer before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:83: error: expected
unqualified-id before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:83: error: expected `)' before
'const'
/usr/include/gentoo-multilib/amd64/libintl.h:83: error: expected
initializer before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:87: error: expected
unqualified-id before 'const'
/usr/include/gentoo-multilib/amd64/libintl.h:87: error: expected `)' before
'const'
/usr/include/gentoo-multilib/amd64/libintl.h:87: error: expected
initializer before 'const'
/usr/include/gentoo-multilib/amd64/bits/stat.h:103: error: expected
unqualified-id before '[' token
/usr/include/gentoo-multilib/amd64/bits/stat.h:164: error: expected
unqualified-id before '[' token
make: *** [libZeroSPU2_a-Linux.o] Error 1
Error with building plugins

What version of the product are you using? On what operating system?

rev 621

Please provide any additional information below.

Original issue reported on code.google.com by rak...@gmail.com on 27 Feb 2009 at 3:24

GoogleCodeExporter commented 9 years ago

Original comment by gigaherz on 27 Feb 2009 at 3:30

GoogleCodeExporter commented 9 years ago
As far as forceinlines, you may have missed that __forceinline is redefined in 
PS2Etypes:
#define __forceinline __attribute__((always_inline,unused))

I can move the stat.h include, though I haven't really had any issues with it.

As far as the latter goes, I think I see the issue. The pcsx2 team, as a whole,
decided to remove x64 support from Linux a while back, and judging from the gcc
output you quoted, you're compiling on a 64 bit platform.

The 64 bit code in the plugins has never been removed, but by the same token 
hasn't
been tested on a 64 bit platform since. My reccommendation would be to set up a 
32
bit chroot, and compile and run pcsx2 from in there.

This guide may help:
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=2

Though you are probably better off using stage files from here:
http://www.funtoo.org/

Original comment by arcum42@gmail.com on 27 Feb 2009 at 4:07

GoogleCodeExporter commented 9 years ago
Hi arcum,

I resolved the last one (#3) wasn't a 64 bit issue. But rather was
zerospu2/Linux/Linux.cpp I had to move Linux.h near the top. I think the 
problem is
mainly differences in versions of gcc as some required weird shuffling. I'm now 
stuck
at soundtouch.

Also, if it __forceinline has been redefined, i wonder why my compiler didn't 
catch it.

Original comment by rak...@gmail.com on 27 Feb 2009 at 4:13

GoogleCodeExporter commented 9 years ago
You are using the build.sh file, right (sh build.sh all)? With the 
rearrangement of
the build system, I actually was having a lot of trouble with SoundTouch, and
ultimately, set the build.sh file to build SoundTouch, then manually copy the
libSoundTouch.a file into the zerospu2 folder.

I'm still looking for a better solution then that, but it seems to work.

And I'm not sure on why your compiler didn't catch that. I'm using gcc 4.3.3.

There is, however, one function that it inlined that won't inline in ZeroGS. 
That
might be part of it. I'll fix that at least, and rearrange headers a bit.

Original comment by arcum42@gmail.com on 27 Feb 2009 at 4:24

GoogleCodeExporter commented 9 years ago
Correct, I am using sh build.sh all

I'm using gcc 4.1.2 (4.3.3 is still experimental in portage). Let me set up my 
32bit
chroot and i'll get back to you guys. 

Original comment by rak...@gmail.com on 27 Feb 2009 at 5:07

GoogleCodeExporter commented 9 years ago
Do you guys notice any difference between gcc 4.3 with -march=core2 and 
-msse4.1 ?
ie. will the core 2 duo optimizations and sse4.1 optimizations make a signifcant
difference in performance?

Original comment by rak...@gmail.com on 27 Feb 2009 at 4:09

GoogleCodeExporter commented 9 years ago
Hi, you guys still need to move the headers in zerospu2/Linux/Linux.cpp (mainly 
move
Linux.h include to the top)

Also, I'm getting stuck here:

 gcc -DPACKAGE_NAME=\"pcsx2\" -DPACKAGE_TARNAME=\"pcsx2\" -DPACKAGE_VERSION=\"0.9.5\"
-DPACKAGE_STRING=\"pcsx2\ 0.9.5\" -DPACKAGE_BUGREPORT=\"zerofrog@gmail.com\"
-DPACKAGE=\"pcsx2\" -DVERSION=\"0.9.5\" -DSVN_REV=\"Revision:\ 627\" -DNDEBUG=1
-DPCSX2_FORCESSE3=1 -DPCSX2_FORCESSE4=1 -DENABLE_NLS=1 -I. -I./.. -I./../../  
-I./../../../common/include -I./../../../3rdparty    -pipe -msse -O3 
-fno-guess-branch-probability -fno-dse -fno-tree-dse  -fpermissive -Xlinker 
-zmuldefs
 -MT ix86_tools.o -MD -MP -MF .deps/ix86_tools.Tpo -c -o ix86_tools.o ix86_tools.cpp
cc1plus: error: unrecognized command line option "-fno-dse"
make[2]: *** [ix86_tools.o] Error 1
make[2]: Leaving directory `/home/pcsx2/pcsx2-read-only/pcsx2/x86/ix86'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/pcsx2/pcsx2-read-only/pcsx2/x86'
make: *** [install-recursive] Error 1
Error with building pcsx2

Original comment by rak...@gmail.com on 27 Feb 2009 at 8:03