[Unbound-users] Compilation error, unbound 1.5.1

W.C.A. Wijngaards wouter at nlnetlabs.nl
Mon Mar 16 11:31:16 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Bob,

On 14/03/15 12:00, Bob Bitdiddle wrote:
> When using mingw32 inside cygwin on PC, I get a compilation error:
> 
> *./libtool --tag=CC --mode=compile i686-pc-mingw32-gcc -I. 
> -I/usr/local/ssl/include -g -O2 -flto -pthread -o net_help.lo -c 
> util/net_help.c libtool: compile:  i686-pc-mingw32-gcc -I.
> -I/usr/local/ssl/include -g -O2 -flto -pthread -c util/net_help.c
> -DDLL_EXPORT -DPIC -o .libs/net_help.o util/net_help.c: In function
> 'ub_crypto_id_cb': util/net_help.c:768:2: error: aggregate value
> used where an integer was expected*
> 
> This is because it appears unbound assumes pthread_t will fit
> inside an unsigned long, but mingw32 defines it thusly:

Fixed in the code repository.  It uses unbound's internal thread
numbers (0,1,2..).

Best regards,
   Wouter

> * /* * Generic handle type - intended to extend uniqueness beyond *
> that available with a simple pointer. It should scale for either *
> IA-32 or IA-64. */ typedef struct { void * p;                   /*
> Pointer to actual object */ unsigned int x;             /* Extra
> information - reuse count etc */ } ptw32_handle_t;
> 
> typedef ptw32_handle_t pthread_t;*
> 
> So the*void CRYPTO_set_id_callback(unsigned long (*func)(void));*
> API provided by openssl doesn't seem to work here.  However, in the
> crypto.h header file provided by openssl I also see the following
> APIs:
> 
> */* Don't use this structure directly. */ typedef struct
> crypto_threadid_st { void *ptr; unsigned long val; }
> CRYPTO_THREADID; /* Only use
> CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ void
> CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long
> val); void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void
> *ptr); int CRYPTO_THREADID_set_callback(void
> (*threadid_func)(CRYPTO_THREADID *)); void
> (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *); void
> CRYPTO_THREADID_current(CRYPTO_THREADID *id); int
> CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID
> *b); void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const
> CRYPTO_THREADID *src); unsigned long CRYPTO_THREADID_hash(const
> CRYPTO_THREADID *id);*
> 
> Presumably these could be used to rewrite the code path that's 
> apparently assuming an unsigned long at the moment.  Should unbound
> be converted over to use these APIs?
> 
> 
> _______________________________________________ Unbound-users
> mailing list Unbound-users at unbound.net 
> http://unbound.nlnetlabs.nl/mailman/listinfo/unbound-users
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVBr8DAAoJEJ9vHC1+BF+NFs8P/1svqAdZH+ap7h3y0ge9yCYO
YSgFyfw6Zx8ScU+z0qWvCCoyY83xf9G6Bt4lIxmTChB5TUnTnylS7eZaAMTN34mD
mCVSp3G3FpsKJ0ybzuxOOq5BVAfh6aL/kbA18iJYxwjMvgo0U37jF4NXW5AjAihm
nurQPHMqDH/aPpqPfWfvIOfb5TbVyGvoLbXUplZegIUg7zRF3mPSgHI0s0Hi7pdn
N+nK9XacaDCodoCB0y0+/HVAO7KJBQ7Xn+ie4lf08k2egDwrhHWMzqxDkSVvsHEN
AzA0WyyCy6ARDOrcflS8Vk7Nk1ODBoW0FCAX0a3IZSQtq78VPeqs07+Xsqie6S1y
+mGR49Xt3iWtFhkz6mZYNGEVt7Rv0ypqJSCI7/Hi/v2ZazlNaqfalae4zAdnhCdH
A1KDt9EDBc4zn65pJZEFxGv+f1hDRH58443IkTZmLxmbuIChPyMO4L/BV11xUfgn
OK6oP5UCjWa+MzWepVBIVA409+anDYe5HyGw0U0e8KhApKsh9CaHx8WITtKy5AN+
m5NFS3yqx661QXQ0Hi3ny5VYX+yhmkb8vdebbi0xXEueGi8w03eFa5yWrWuRk+DJ
7WHoe9XdEoFDQH0eiBxZXpYiuoVQcjCthZ2RJVsf40pPAEtuIvPaA405t7sLUvlm
n07mhvREFNb7pjfuJY+V
=bJAL
-----END PGP SIGNATURE-----



More information about the Unbound-users mailing list