ZSNES 1.4 refuses to compile (now Illegal Instruction!!??)

General area for talk about ZSNES. The best place to ask for related questions as well as troubleshooting.

Moderator: ZSNES Mods

Post Reply
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

ZSNES 1.4 refuses to compile (now Illegal Instruction!!??)

Post by kyo-KUSANAGI »

Just like to thank everyone on the ZSNES team for making a non-Christmas-present receiver happy on Christmas day, but I am sorry to report that it just refuses to compile on Gentoo 2004.2 (doesn't mean much, updated almost every package already). I can run ZSNES 1.36 already on my system (2.6.9-gentoo-r9), compiling ZSNES 1.40 gives me this:

Code: Select all

bash-2.05b# cd zsnes_1_40/
bash-2.05b# ls
docs  icons  src
bash-2.05b# cd src
bash-2.05b# make -f makefile.dos
gcc -O3 -march=i586 -fno-exceptions -ffast-math -fomit-frame-pointer -fno-unroll-loops -Wall -Wno-unused -D__MSDOS__ -o dos/zfile.o -c dos/zfile.c
SNIPSNIPSNIPSNIPSNIP
dos/zfile.c:22:17: dos.h: No such file or directory
dos/zfile.c:24:19: share.h: No such file or directory
dos/zfile.c: In function `ZFileGetFTime':
dos/zfile.c:234: warning: implicit declaration of function `_dos_open'
dos/zfile.c:235: warning: implicit declaration of function `_dos_getftime'
dos/zfile.c:236: warning: implicit declaration of function `_dos_close'
dos/zfile.c: In function `ZFileFindFirst':
dos/zfile.c:278: warning: implicit declaration of function `_dos_findfirst'
dos/zfile.c: In function `ZFileFindNext':
dos/zfile.c:285: warning: implicit declaration of function `_dos_findnext'
make: *** [dos/zfile.o] Error 1
bash-2.05b#
yeah. Is this supposed to happen or what, cause I don't see many people complaining about this.
Last edited by kyo-KUSANAGI on Sun Dec 26, 2004 10:00 am, edited 1 time in total.
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

SORRY! looks like I was following instructions on the DOS part of the install.txt.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Look in the docs directory for instructions on what your supposed to do.

Trying to compile the DOS port under Linux is not what you should be doing to build a working Linux binary.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

thanks for the pointer, nach, however, I ran into another obstacle:

Code: Select all

bash-2.05b# zsnes

ZSNES v1.40 (c) 1997-2004, ZSNES Team

Be sure to check http://www.zsnes.com/ for the latest version.
Please report crashes to zsnes-devel@lists.sourceforge.net.

ZSNES is written by the ZSNES Team (See AUTHORS.TXT)
ZSNES comes with ABSOLUTELY NO WARRANTY.  This is free software,
and you are welcome to redistribute it under certain conditions;
please read 'LICENSE' thoroughly before using it.

Use ZSNES -? for command line definitions.

MMX support found and enabled.

ZSNES could not find any joysticks.
Illegal instruction
The window appears for a while, but when I type something, or move my mouse within it's boundaries, it terminates with the "Illegal instruction" error. No other messages to work on.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

It sounds like you compiled for an architecture your PC doesn't support. Like Pentium4 optimizations, but you only have a PIII.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

I have a VIA C3 (Ezra).
I didn't tell the compiler anything funky. Just typed in sh ./autogen.sh && gmake && gmake install. Anything specific I should do for this processor?
ADD: you know, while browsing through config.status, I came across an instance of "-march=pentiumpro". I replaced that with -march=c3, but that didn't work, because later on, while it was compiling, I found a lot of "pentium" strings showing up. Might that be it? Probably your scripts are assuming that my processor is a C3.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Which -march did you compile with?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

As I said, I didn't specify any march (but I did try changing the one in config.status to a "c3" from a "pentiumpro"). However, in my /etc/make.conf (it's a gentoo distro) I specified a CFLAG as -march=c3, but because I didn't use portage to emerge this, that CFLAG probably went unused.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

kyo-KUSANAGI wrote:As I said, I didn't specify any march (but I did try changing the one in config.status to a "c3" from a "pentiumpro"). However, in my /etc/make.conf (it's a gentoo distro) I specified a CFLAG as -march=c3, but because I didn't use portage to emerge this, that CFLAG probably went unused.
To be honest, I have no idea what you're talking about.

When you run make in your source directory now, you should see something like this:

Code: Select all

gcc  -pipe -I. -Wall -I/usr/local/include -I/usr/include -D__LINUX__  -I/usr/include/SDL -D_REENTRANT  -D__OPENGL__ -O3 -ffast-math -fomit-frame-pointer -fexpensive-optimizations -s -march=pentiumpro -o version.o -c version.c
I'm not sure which -marchs your proccessor is compatible with, but one specific for your proccesor or i686 should work fine.
Change it by editing Makefile, then do
make clean
make
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
kyo-KUSANAGI
Rookie
Posts: 27
Joined: Sun Dec 26, 2004 9:07 am

Post by kyo-KUSANAGI »

/etc/make.conf has global options for gcc inside it. So, for instance, if you put CFLAG= -m3dnow, simply typing gcc would mean to the computer "gcc -m3dnow". I think :)
Last point of clarification: there are a lot of makefiles in the zsnes_140/src directory. Which one do you mean?
bash-2.05b# ls makefile*
makefile.dos makefile.mingw makefile.win
bash-2.05b# ls Makefile*
Makefile.check Makefile.in
bash-2.05b#
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

I mean the one called "Makefile", it should be created after running autogen.sh
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Aerdan
Winter Knight
Posts: 467
Joined: Mon Aug 16, 2004 10:16 pm
Contact:

Post by Aerdan »

Tip.

CFLAGS="-march=c3" ./autogen.sh

I did that with gentoo, and...it works. :p
Post Reply