From: <ar...@cs...> - 2006-11-15 12:22:19
|
Wed Nov 15 13:10:06 CET 2006 Arie Middelkoop <ar...@cs...> * Added the -fPIC compiler flag to CXX options in the makefile. = Apparantly, my platform (gentoo x86_64 linux) required that .o files are = "relocatable" when there = are linked into a dynamic library. = (It might be an idea to use libtool to hide this kind of platform-specifi= c details) = Wed Nov 15 13:14:08 CET 2006 Arie Middelkoop <ar...@cs...> * Compiling wxHaskell on a 64bits platform fails, because there are some assumptions in the code that assume that integers are 32bits. For example, there are a couple of assignments of a pointer to an int. = This patch fixes these problems. Sometimes, after assigning a pointer to an integer, the int was used as a boolean value. In those cases, instead of returning a pointer p, I changed the code to return p !=3D NULL. In two other cases, a pointer is stored inside the int and in these cases I changed the type of the int to intptr_t, of which it is guaranteed that a pointer can be assigned to it and recovered from it (requires <inttypes.h>, i'm not sure if it is available of windows platforms though). |
From: Arie M. <ami...@cs...> - 2006-11-15 12:32:20
|
Hi wxhaskell-users mailinglist, Uuhm, I didn't know that 'darcs send' directly transmits the email :o (and apparantly, the mailer on my machine doesn't know my email address) The reason I send these patches is as follows: I tried to compile wxHaskell on x86_64 gentoo linux, but that failed. With these patches I can build, install and run wxHaskell (although I have to configure with --with-opengl otherwise ghc complains about missing symbols when run with -package wx). I encountered two problems: (1) I had to add the -fPIC option to the CXX flags in the make file, otherwise during linking, the "make" (wxcore) fails, as it requires locatable .o files to produce a dynamic library. (2) Made a few fixes in the code with respect to 64bit compatiblity. I hope I didn't make changes in generated C-code... Hope you can do something with it... All the best, Arie On Wed, 2006-11-15 at 13:22 +0100, ar...@cs... wrote: > Wed Nov 15 13:10:06 CET 2006 Arie Middelkoop <ar...@cs...> > * Added the -fPIC compiler flag to CXX options in the makefile. > =20 > Apparantly, my platform (gentoo x86_64 linux) required that .o files ar= e "relocatable" when there=20 > are linked into a dynamic library. > =20 > (It might be an idea to use libtool to hide this kind of platform-speci= fic details) > =20 >=20 > Wed Nov 15 13:14:08 CET 2006 Arie Middelkoop <ar...@cs...> > * Compiling wxHaskell on a 64bits platform fails, because there > are some assumptions in the code that assume that integers are > 32bits. For example, there are a couple of assignments of a > pointer to an int. > =20 > This patch fixes these problems. Sometimes, after assigning a > pointer to an integer, the int was used as a boolean value. In > those cases, instead of returning a pointer p, I changed the > code to return p !=3D NULL. In two other cases, a pointer is stored > inside the int and in these cases I changed the type of the > int to intptr_t, of which it is guaranteed that a pointer can be > assigned to it and recovered from it (requires <inttypes.h>, i'm > not sure if it is available of windows platforms though). > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ wxhaskell-users mailing l= ist wxh...@li... https://lists.sourceforge.net/lis= ts/listinfo/wxhaskell-users |
From: Eric Y. K. <eri...@gm...> - 2006-11-15 12:54:44
|
Thanks! I'm not really knowledgeable enough to review these patches. Does anyone else have comments? Otherwise, I'll see what I can learn and likely push it in if it doesn't break anything on my end. Note that you can do darcs send --edit-description, which will open a file in your editor where you can type in a general description for the patch bundle. On Wed, Nov 15, 2006 at 13:22:29 +0100, ar...@cs... wrote: > Wed Nov 15 13:10:06 CET 2006 Arie Middelkoop <ar...@cs...> > * Added the -fPIC compiler flag to CXX options in the makefile. >=20 > Wed Nov 15 13:14:08 CET 2006 Arie Middelkoop <ar...@cs...> > * Compiling wxHaskell on a 64bits platform fails, because there Note: that first line should probably be standalone if possible, e.g., Use intptr_t instead of int. It serves as a short patch name. --=20 Eric Kow http://www.loria.fr/~kow PGP Key ID: 08AC04F9 Merci de corriger mon fran=E7ais. |
From: Eric Y. K. <eri...@gm...> - 2006-11-25 13:59:17
|
Hi, I'm going to push a slightly modified version of this patch in. The only modification is in the description. Arie, you'll want to obliterate your version of the patch so that it does not conflict with the one I push in. The patch seems to make sense (although I must point out I haven't done any C coding since the late 90s and can't really claim to know what I'm talking about). I found this bit of explanation on the web helpful: Any valid pointer to an object (the original C99 text speaks of "any valid pointer to void") can be converted to this type, and then converted back safely to void *. The result must compare equal to the original pointer. In other words, intptr_t legalizes a popular yet non-portable tradition of converting data pointers to integral types, and vice versa. --=20 Eric Kow http://www.loria.fr/~kow PGP Key ID: 08AC04F9 Merci de corriger mon fran=E7ais. |