ZSnes compilation under linux

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

Moderator: ZSNES Mods

Post Reply
SteelWings
New Member
Posts: 3
Joined: Wed Apr 29, 2009 12:08 pm

ZSnes compilation under linux

Post by SteelWings »

Hi there, i'm trying to make and install zSnes 1.51 under linux (Slax 6.1.1).

I use:

Code: Select all

./configure
then

Code: Select all

make
and i'm getting error saying something about __tcf_1 and other (using vmware and can't post all text about error)

If anyone can help me - help me please. I'm newbie in linux and I'm trying to learn something about compiling sources. Sure, I can take compiled binary, but it will be more interesting to make it by myself.
gllt
NO VOWELS >:[
Posts: 753
Joined: Sun Aug 31, 2008 12:59 pm
Location: ALABAMA
Contact:

Post by gllt »

I'm not in nix so excuse me if this isn't correct, but assuming you have net in the vmware install, you can post the text to pastebin from a browser inside

and you can get logs, if im right, with

make > make.log
perhaps make 2>&1 > make.log

something like that..
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

got nasm installed?
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
SteelWings
New Member
Posts: 3
Joined: Wed Apr 29, 2009 12:08 pm

Post by SteelWings »

Code: Select all

root@slax:/mnt/sdb1/zMisc/__SLAX/zsnes_1_51/src# configure-for-slax
checking build system type... i486-Slackware-linux-gnu
checking host system type... i486-Slackware-linux-gnu
checking target system type... i486-Slackware-linux-gnu
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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 for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for nasm... nasm
checking for sdl-config... /usr/bin/sdl-config
checking for SDL - version >= 1.2.0... yes
checking for zlib - version >= 1.2.3... yes
checking for libpng - version >= 1.2.0... yes
checking if you want the zsnes debugger... yes
checking for initscr in -lcurses... yes
checking for initscr in -lncurses... yes
checking for initscr in -lpdcurses... no
checking if you want libao support... no
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers
checking for glGetError in -lGL... yes
checking for OpenGL... yes
checking for JMA support... yes
checking for cpu info... failed
checking if you want gdb friendly executable... no
checking which cpu architecture to optimize for... guessing i386
configure: WARNING: This is not what you want, use --target or 
force-arch
checking if you want crazy optimizations... no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
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 sys/types.h defines makedev... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h


ZSNES v1.51

SDL support                   Version 1.2.13
NASM support                  NASM version 2.03.01 compiled on Jul 10 
2008
zlib support                  Version 1.2.3
PNG support                   Yes, version 1.2.32
OpenGL support                Yes
JMA support                   Yes
ZSNES debugger                Enabled

The binary will be installed in /usr/bin

Configure complete, now type 'make' and pray.

root@slax:/mnt/sdb1/zMisc/__SLAX/zsnes_1_51/src# make
g++ -O3 -march=i486 -mtune=i686 -pipe -I. -I/usr/local/include 
-I/usr/include -D__UNIXSDL__  -I/usr/include/SDL -D_GNU_SOURCE=1 
-D_REENTRANT  -D__OPENGL__ -march=i386 -O3 -fomit-frame-pointer -s 
-fno-rtti -o tools/fileutil.o -c tools/fileutil.cpp
g++ -O3 -march=i486 -mtune=i686 -pipe -I. -I/usr/local/include 
-I/usr/include -D__UNIXSDL__  -I/usr/include/SDL -D_GNU_SOURCE=1 
-D_REENTRANT  -D__OPENGL__ -march=i386 -O3 -fomit-frame-pointer -s 
-fno-rtti -o tools/strutil.o -c tools/strutil.cpp
g++ -O3 -march=i486 -mtune=i686 -pipe -I. -I/usr/local/include 
-I/usr/include -D__UNIXSDL__  -I/usr/include/SDL -D_GNU_SOURCE=1 
-D_REENTRANT  -D__OPENGL__ -march=i386 -O3 -fomit-frame-pointer -s 
-fno-rtti -o tools/depbuild tools/depbuild.cpp tools/fileutil.o 
tools/strutil.o
/tmp/ccwDFzGa.o: In function `__tcf_4':
depbuild.cpp:(.text+0x191): undefined reference to 
`__sync_fetch_and_add_4'
/tmp/ccwDFzGa.o: In function `__tcf_3':
depbuild.cpp:(.text+0x1f1): undefined reference to 
`__sync_fetch_and_add_4'
/tmp/ccwDFzGa.o: In function `__tcf_2':
depbuild.cpp:(.text+0x251): undefined reference to 
`__sync_fetch_and_add_4'
/tmp/ccwDFzGa.o: In function `__tcf_1':
depbuild.cpp:(.text+0x2b1): undefined reference to 
`__sync_fetch_and_add_4'
/tmp/ccwDFzGa.o: In function `dependency_calculate_asm(char const*)':
depbuild.cpp:(.text+0x480): undefined reference to 
`__sync_fetch_and_add_4'
/tmp/ccwDFzGa.o:depbuild.cpp:(.text+0x497): more undefined references to 
`__sync_fetch_and_add_4' follow
collect2: ld returned 1 exit status
make: *** [tools/depbuild] Error 1

Sure, nasm installed.

Code: Select all

NASM version 2.03.01 compiled on Jul 10 2008
AamirM
Regen Developer
Regen Developer
Posts: 533
Joined: Sun Feb 17, 2008 8:01 am
Contact:

Post by AamirM »

Code: Select all

checking for cpu info... failed 
checking if you want gdb friendly executable... no 
checking which cpu architecture to optimize for... guessing i386 
configure: WARNING: This is not what you want, use --target or 
force-arch
I think the problem is here ;) . Also,

Code: Select all

g++ -O3 -march=i486 -mtune=i686 -pipe -I. -I/usr/local/include 
-I/usr/include -D__UNIXSDL__  -I/usr/include/SDL -D_GNU_SOURCE=1 
-D_REENTRANT  -D__OPENGL__ -march=i386 -O3 -fomit-frame-pointer -s 
-fno-rtti -o tools/depbuild tools/depbuild.cpp tools/fileutil.o 
Notice the two -"march" options. AFAIK, the last "-march" option specified is the one which becomes effective (-march=i386) and I don't think that "i386" is supported anymore (I could be wrong though).

Try the following:

Code: Select all

export force_arch=i686
./configure
SteelWings
New Member
Posts: 3
Joined: Wed Apr 29, 2009 12:08 pm

Post by SteelWings »

Code: Select all

root@slax:/mnt/sdb1/zMisc/__SLAX/zsnes_1_51/src# export force_arch=i686
root@slax:/mnt/sdb1/zMisc/__SLAX/zsnes_1_51/src# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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 for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for nasm... nasm
checking for sdl-config... /usr/bin/sdl-config
checking for SDL - version >= 1.2.0... yes
checking for zlib - version >= 1.2.3... yes
checking for libpng - version >= 1.2.0... yes
checking if you want the zsnes debugger... yes
checking for initscr in -lcurses... yes
checking for initscr in -lncurses... yes
checking for initscr in -lpdcurses... no
checking if you want libao support... no
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers
checking for glGetError in -lGL... yes
checking for OpenGL... yes
checking for JMA support... yes
checking for cpu info... failed
checking if you want gdb friendly executable... no
checking which cpu architecture to optimize for... forcing i686
checking if you want crazy optimizations... no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
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 sys/types.h defines makedev... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged


ZSNES v1.51

SDL support                   Version 1.2.13
NASM support                  NASM version 2.03.01 compiled on Jul 10 2008
zlib support                  Version 1.2.3
PNG support                   Yes, version 1.2.32
OpenGL support                Yes
JMA support                   Yes
ZSNES debugger                Enabled

The binary will be installed in /usr/local/bin

Configure complete, now type 'make' and pray.

root@slax:/mnt/sdb1/zMisc/__SLAX/zsnes_1_51/src# make
g++  -pipe -I. -I/usr/local/include -I/usr/include -D__UNIXSDL__  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -D__OPENGL__ -march=i686 -O3 -fomit-frame-pointer -s -fno-rtti -o tools/depbuild tools/depbuild.cpp tools/fileutil.o tools/strutil.o
tools/strutil.o: In function `Tokenize(std::basic_string<char, ci_char_traits, std::allocator<char> > const&, std::vector<std::basic_string<char, ci_char_traits, std::allocator<char> >, std::allocator<std::basic_string<char, ci_char_traits, std::allocator<char> > > >&, std::basic_string<char, ci_char_traits, std::allocator<char> > const&)':
strutil.cpp:(.text+0x551): undefined reference to `__sync_fetch_and_add_4'
strutil.cpp:(.text+0x568): undefined reference to `__sync_fetch_and_add_4'
tools/strutil.o: In function `Tokenize(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
strutil.cpp:(.text+0x70a): undefined reference to `__sync_fetch_and_add_4'
strutil.cpp:(.text+0x764): undefined reference to `__sync_fetch_and_add_4'
tools/strutil.o: In function `std::basic_string<char, ci_char_traits, std::allocator<char> >::assign(std::basic_string<char, ci_char_traits, std::allocator<char> > const&)':
strutil.cpp:(.text._ZNSbIc14ci_char_traitsSaIcEE6assignERKS1_[std::basic_string<char, ci_char_traits, std::allocator<char> >::assign(std::basic_string<char, ci_char_traits, std::allocator<char> > const&)]+0x1a2): undefined reference to `__sync_fetch_and_add_4'
tools/strutil.o:strutil.cpp:(.text._ZNSt6vectorISbIc14ci_char_traitsSaIcEESaIS2_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS2_S4_EERKS2_[std::vector<std::basic_string<char, ci_char_traits, std::allocator<char> >, std::allocator<std::basic_string<char, ci_char_traits, std::allocator<char> > > >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::basic_string<char, ci_char_traits, std::allocator<char> >*, std::vector<std::basic_string<char, ci_char_traits, std::allocator<char> >, std::allocator<std::basic_string<char, ci_char_traits, std::allocator<char> > > > >, std::basic_string<char, ci_char_traits, std::allocator<char> > const&)]+0x26d): more undefined references to `__sync_fetch_and_add_4' follow
collect2: ld returned 1 exit status
make: *** [tools/depbuild] Error 1
Still getting error.

I tried i486 too, but result is same.
odditude
Official tech support dood
Posts: 2118
Joined: Wed Jan 25, 2006 7:57 am

Post by odditude »

quick googling shows an issue in the gnu toolchain due to newer gcc.

try the source from here.
Why yes, my shift key *IS* broken.
Post Reply