Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
howl on amd64
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
deepspace9
Apprentice
Apprentice


Joined: 29 Jan 2003
Posts: 214
Location: Netherlands

PostPosted: Tue May 11, 2004 10:58 am    Post subject: howl on amd64 Reply with quote

Emerge does not work, so, I looked at the source.

Besides this error, wich is easy to fix:

Code:
In file included from ../../include/salt/socket.h:32,
                 from socket_i.h:67,
                 from address.c:29:
../../include/salt/vtypes.h:127:4: #error "CPU unknown"



I get:

Code:
In file included from ./NotOSX/notosx_mdns.h:39,
                 from ./Posix/posix_mdns.h:34,
                 from Posix/posix_mdns.c:29:
./NotOSX/DNSServices.h:249: warning: division by zero
./NotOSX/DNSServices.h:249: error: storage size of 'dns_check_compile_time_249' isn't constant
./NotOSX/DNSServices.h:259: warning: division by zero
./NotOSX/DNSServices.h:259: error: storage size of 'dns_check_compile_time_259' isn't constant


This happens in gcc 3.3.3 and 3.4, so I guess it is amd64 specific. Anyone an idea?
Back to top
View user's profile Send private message
deepspace9
Apprentice
Apprentice


Joined: 29 Jan 2003
Posts: 214
Location: Netherlands

PostPosted: Thu May 13, 2004 10:30 am    Post subject: Reply with quote

Well, since I didn't hear anything, I got to work on it myself. After changing some (unsigned) long's to (unsigned) int's, and making sure that x86_64 is recognised, howl wil compile and install. The problem is: it still does not work...

here is the diff to get it to compile (against 0.9.5):
Code:

57a58,61
> #if defined(__x86_64__)
> typedef int                                   sw_long;
> typedef unsigned int          sw_ulong;
> #else
59a64
> #endif
123a129,130
> #       elif defined(__x86_64__)
> #             define SW_ENDIAN                1

While compiling I get the following list of warning:

Code:

gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"howl\" -DVERSION=\"0.9.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I. -I../../../include/ -I../ -g -O2 -c NotOSX/notosx_mdns.c -MT notosx_mdns.lo -MD -MP -MF .deps/notosx_mdns.TPlo  -fPIC -DPIC -o .libs/notosx_mdns.lo
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_publish_domain':
NotOSX/notosx_mdns.c:487: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_stop_publish_domain':
NotOSX/notosx_mdns.c:541: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_publish_host':
NotOSX/notosx_mdns.c:590: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_stop_publish_host':
NotOSX/notosx_mdns.c:646: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_publish':
NotOSX/notosx_mdns.c:699: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_publish_update':
NotOSX/notosx_mdns.c:764: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_stop_publish':
NotOSX/notosx_mdns.c:801: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_browse_domains':
NotOSX/notosx_mdns.c:847: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_stop_browse_domains':
NotOSX/notosx_mdns.c:899: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_browse_services':
NotOSX/notosx_mdns.c:947: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_stop_browse_services':
NotOSX/notosx_mdns.c:1001: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_resolve':
NotOSX/notosx_mdns.c:1050: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_stop_resolve':
NotOSX/notosx_mdns.c:1105: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_stub_dispatcher':
NotOSX/notosx_mdns.c:1214: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:1233: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:1252: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:1278: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:1312: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish_domain':
NotOSX/notosx_mdns.c:1546: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_stop_publish_domain':
NotOSX/notosx_mdns.c:1578: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish_host':
NotOSX/notosx_mdns.c:1639: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_stop_publish_host':
NotOSX/notosx_mdns.c:1678: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish':
NotOSX/notosx_mdns.c:1744: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish_update':
NotOSX/notosx_mdns.c:1786: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_stop_publish':
NotOSX/notosx_mdns.c:1812: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_browse_domains':
NotOSX/notosx_mdns.c:1873: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_stop_browse_domains':
NotOSX/notosx_mdns.c:1911: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_browse_services':
NotOSX/notosx_mdns.c:1970: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_stop_browse_services':
NotOSX/notosx_mdns.c:2006: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_resolve':
NotOSX/notosx_mdns.c:2066: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_stop_resolve':
NotOSX/notosx_mdns.c:2092: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish_domain_reply':
NotOSX/notosx_mdns.c:2379: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish_host_reply':
NotOSX/notosx_mdns.c:2412: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish_reply':
NotOSX/notosx_mdns.c:2445: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_browse_reply':
NotOSX/notosx_mdns.c:2484: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_resolve_reply':
NotOSX/notosx_mdns.c:2531: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish_host_callback':
NotOSX/notosx_mdns.c:2602: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_publish_callback':
NotOSX/notosx_mdns.c:2627: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2633: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2639: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2645: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_browse_callback':
NotOSX/notosx_mdns.c:2694: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2700: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2707: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2713: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2719: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2725: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2731: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c:2737: warning: cast to pointer from integer of different size
NotOSX/notosx_mdns.c: In function `sw_mdns_servant_resolve_callback':
NotOSX/notosx_mdns.c:2782: warning: cast from pointer to integer of different size
NotOSX/notosx_mdns.c:2784: warning: cast to pointer from integer of different size


Might be because void pointers are 8 bytes on x86_64... and might also be why howl does not work yet..

Could somebody help me, I realy need it to work 8O
Back to top
View user's profile Send private message
Lv
Retired Dev
Retired Dev


Joined: 22 Jun 2003
Posts: 352

PostPosted: Thu May 13, 2004 1:54 pm    Post subject: Reply with quote

this is a common problem with porting software to amd64. a pointer wont fit inside of an int on amd64, so casting a pointer to an int and the other way around wont really work. you can cast a pointer to a long... but you might not want to do that anyways. looks like you have a lot of debugging to do :)

but you seem to already know that since you already changed some ints to longs...
Back to top
View user's profile Send private message
Vzzrzzn
n00b
n00b


Joined: 20 Oct 2003
Posts: 3

PostPosted: Thu May 13, 2004 7:16 pm    Post subject: Reply with quote

The recommended way to fix (32-bit) code that casts pointers to int's and performs arithmetic, is to instead cast the pointer to a (char *)

So it's as simple as going to each of the warning-generating lines, and replacing (int) with (char *) ... after that, cross your fingers.
See this page for more:

http://www.treblig.org/articles/64bits.html
Back to top
View user's profile Send private message
Lv
Retired Dev
Retired Dev


Joined: 22 Jun 2003
Posts: 352

PostPosted: Fri May 14, 2004 8:03 pm    Post subject: Reply with quote

thanks for the link :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum