[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Problem compiling on amd64

From: annonygmouse
Subject: [Gnash-dev] Problem compiling on amd64
Date: Wed, 02 Aug 2006 00:41:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; ca-AD; rv:1.7.13) Gecko/20060621 Debian/1.7.13-0.2


My machine is an amd64 and today gnash from CVS does not compile anymore.
The problem is in "libamf/amf.cpp", there are to places where a
char* is casted to an int.
I supose you already know, but on 64bits architectures in linux the data model used is LP64 [1], that means that
    * ints are 32-bit
    * longs are 64-bit
    * long-longs are also 64-bit
    * pointers are 64-bit
and when doing :
char *x = something;

return (int)x-(int)strchr(x,SOMECHAR);

each casting looses information as gcc informs:
amf.cpp:467: error: cast from 'char*' to 'int' loses precision

I attach a patch (two lines) to solve this issue.
NOTE: With this patch it compiles, but I can't assure you it will work!

After solving this two-liner the linking doesn't seem to work:

(cd .libs && rm -f && ln -s ../
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I. -I../server -I../libbase -I/usr/include/libxml2 -DQT_THREAD_SUPPORT -D_REENTRANT -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -I/usr/include/SDL -I.. -I. -I../server -I../libbase -I/usr/include/libxml2 -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -MT amftest.o -MD -MP -MF ".deps/amftest.Tpo" -c -o amftest.o amftest.cpp; \ then mv -f ".deps/amftest.Tpo" ".deps/amftest.Po"; else rm -f ".deps/amftest.Tpo"; exit 1; fi /bin/sh ../libtool --tag=CXX --mode=link g++ -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -I/usr/include/SDL -I.. -I. -I../server -I../libbase -I/usr/include/libxml2 -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type ../libbase/ -lGL -lGLU -lSDL -L/usr/lib64 -lSDL_mixer -L/usr/lib -ljpeg -lpng -lxml2 -logg -o amftest amftest.o ../libbase/ -lGL -lGLU -lSDL -L/usr/lib64 -lSDL_mixer -L/usr/lib -ljpeg -lpng -lxml2 -logg -lSDL_mixer -lrt -lX11 -lXi g++ -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -I/usr/include/SDL -I.. -I. -I../server -I../libbase -I/usr/include/libxml2 -g -O2 -W -Wall -Wcast-align -Wcast-qual -Wpointer-arith -Wreturn-type -o .libs/amftest amftest.o -L/usr/lib64 -L/usr/lib ../libbase/.libs/ /usr/lib/ /usr/lib/ /usr/lib/ /usr/lib/ ./.libs/ /usr/lib/ -L/usr/share/qt3/lib -L/usr/X11R6/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv -lssl -lcrypto -lGL -lGLU -lz -lvga -lpng -lrt -lXi -ldl -laudio -lXt -lXext -lncurses -lslang -lX11 -lpthread -Wl,--rpath -Wl,/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.0.4/../../../../lib64/crt1.o: In function `_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
collect2: ld returned 1 exit status
make[2]: *** [amftest] Error 1
make[2]: Leaving directory `/home/jo/gnash/libamf'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jo/gnash'
make: *** [all] Error 2

Is this some problem of my machine or does it happen to someone else?


PS: AFAIK amd64 is a supported architecture for gnash, isn't it?
? .libs
? amf.loT
? amf_cast_to_int_does_not_work_amd64.patch
? rtmp.lo
Index: amf.cpp
RCS file: /sources/gnash/gnash/libamf/amf.cpp,v
retrieving revision 1.5
diff -u -r1.5 amf.cpp
--- amf.cpp     1 Aug 2006 20:09:00 -0000       1.5
+++ amf.cpp     1 Aug 2006 22:40:37 -0000
@@ -436,7 +436,7 @@
           log_msg("Reference unimplemented");
       case ECMAArray:
-          return (int)x - (int)strchr(x, TERMINATOR);
+          return (long int)x - (long int)strchr(x, TERMINATOR);
       case ObjectEnd:
           return -1;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]