On 10/30/2009 04:45 AM, Paul Querna wrote:
patchset online:<http://people.apache.org/~pquerna/ts/patches/portable-v1/>
17 patches, and I can get both libinkevent.a and libinktomi++.a. The
Kqueue code will definitely need a rewrite, as I did an absolutely
terrible malloc and iteration of the results, but it should be enough
for now to move on to other portability issues.
I have not tested on linux with this patchset.
proxy/* doesn't compile yet, not really started on it.
Awesome! A few questions right away:
*_Patch 1:_* Can we be sure these defines are valid for any platform
where ETIME / ENOTSUP isn't defined (I have no idea if there are such
cases)? Maybe be more defensive, and do something like
#ifndef ETIME
#ifdef ETIMEDOUT
#define ETIME ETIMEDOUT
#endif
#endif
And let it fail on platforms without ETIMEDOUT ? With this patch, I get
a warning from autoreconfig:
/usr/share/aclocal/autotrace.m4:7: warning: underquoted definition
of AM_PATH_AUTOTRACE
/usr/share/aclocal/autotrace.m4:7: run info '(automake)Extending
aclocal'
/usr/share/aclocal/autotrace.m4:7: or see
http://sources.redhat.com/automake/automake.html#Extending-aclocal
It still builds though.
*_Patch 2:_* Does this imply that we don't require BDB any more?? I
didn't think that was the case, but maybe Andrew or someone in the team
knows? As for the glibc-devel check, any way we can do that in a cross
platform way?
_*Patch 3:*_ Looks good (had some problems applying it because I backed
out patch 2).
_*Patch 4:*_ Looks complicated, but using compiler support for the
atomic stuff seems like a great idea. But, this fails on Linux for me:
gmake[1]: *** No rule to make target `ink_atomic.o', needed by
`libinktomi++.a'. Stop.
gmake[1]: Leaving directory
`/export/apache/trafficserver/traffic/trunk.pquerna/libinktomi++'
gmake: *** [all-recursive] Error 1
_*Patch 5:*_ Looks good.
*_Patch 6:_* This breaks my build on Linux, with
unused-debug-symbols -fno-strict-aliasing -Wno-invalid-offsetof
-march=pentium -MT Allocator.o -MD -MP -MF .deps/Allocator.Tpo -c -o
Allocator.o Allocator.cc
In file included from SimpleDBM.h:54,
from inktomi++.h:139,
from Allocator.cc:33:
/usr/include/db.h:142: error: conflicting declaration ‘typedef
struct __db_dbt DBT’
/usr/include/db_185.h:93: error: ‘DBT’ has a previous declaration
as ‘typedef struct DBT DBT’
/usr/include/db.h:1371: error: conflicting declaration ‘DB_BTREE’
/usr/include/db_185.h:108: error: ‘DB_BTREE’ has a previous
declaration as ‘DBTYPE DB_BTREE’
/usr/include/db.h:1372: error: conflicting declaration ‘DB_HASH’
/usr/include/db_185.h:108: error: ‘DB_HASH’ has a previous
declaration as ‘DBTYPE DB_HASH’
/usr/include/db.h:1373: error: conflicting declaration ‘DB_RECNO’
/usr/include/db_185.h:108: error: ‘DB_RECNO’ has a previous
declaration as ‘DBTYPE DB_RECNO’
/usr/include/db.h:1376: error: conflicting declaration ‘typedef
enum DBTYPE DBTYPE’
/usr/include/db_185.h:108: error: ‘DBTYPE’ has a previous
declaration as ‘typedef enum DBTYPE DBTYPE’
/usr/include/db.h:1502: error: redefinition of ‘struct __db’
/usr/include/db_185.h:111: error: previous definition of ‘struct __db’
gmake[1]: *** [Allocator.o] Error 1
gmake[1]: Leaving directory
`/export/apache/trafficserver/traffic/trunk.pquerna.test/libinktomi++'
gmake: *** [all-recursive] Error 1
_*Patch 7:*_ With this patch, the configure warning from above changes to:
build-aux/apr_network.m4:24: warning: underquoted definition of
APR_TYPE_IN_ADDR
build-aux/apr_network.m4:24: run info '(automake)Extending aclocal'
build-aux/apr_network.m4:24: or see
http://sources.redhat.com/automake/automake.html#Extending-aclocal
and the build then fails (on linux):
ink_inet.cc: In function ‘hostent* ink_gethostbyname_r(char*,
ink_gethostbyname_r_data*)’:
ink_inet.cc:62: error: cannot convert ‘int*’ to ‘hostent**’ for
argument ‘5’ to ‘int gethostbyname_r(const char*, hostent*, char*,
size_t, hostent**, int*)’
ink_inet.cc: In function ‘hostent* ink_gethostbyaddr_r(char*, int,
int, ink_gethostbyaddr_r_data*)’:
ink_inet.cc:83: error: cannot convert ‘int*’ to ‘hostent**’ for
argument ‘7’ to ‘int gethostbyaddr_r(const void*, __socklen_t, int,
hostent*, char*, size_t, hostent**, int*)’
gmake[1]: *** [ink_inet.o] Error 1
gmake[1]: Leaving directory
`/export/apache/trafficserver/traffic/trunk.pquerna.test/libinktomi++'
gmake: *** [all-recursive] Error 1
I didn't review anything past this point yet.
-- Leif