You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2017/03/15 10:18:52 UTC

[Bug 50146] cross compiling apr error: redefinition of 'struct iovec'

https://bz.apache.org/bugzilla/show_bug.cgi?id=50146

--- Comment #7 from Dennis Herbrich <ko...@veloxis.de> ---
I have encountered this problem recently in my attempt to cross-compile APR
1.5.2 for an x86 platform, with no option to "just compile it natively". The
essential workaround I used, after tracing the configure script and include
files, was defining APR_IOVEC_DEFINED in the CPPFLAGS passed in the environment
of my ./configure call. See the excerpt of the apr_want.h include file below.

sha256sum of source tarball:
7d03ed29c22a7152be45b8e50431063736df9e1daa1ddf93f6a547ba7a28f67a

File apr-1.5.2/include/apr_want.h:80 in apr-1.5.2.tar.bz2:
/* --------------------------------------------------------------------- */

#ifdef APR_WANT_IOVEC

#if APR_HAVE_IOVEC

#if APR_HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif

#else

#ifndef APR_IOVEC_DEFINED
#define APR_IOVEC_DEFINED
struct iovec
{
    void *iov_base;
    size_t iov_len;
};
#endif /* !APR_IOVEC_DEFINED */

#endif /* APR_HAVE_IOVEC */

#undef APR_WANT_IOVEC
#endif

/* --------------------------------------------------------------------- */

Naturally, I also needed a bunch of ac_cv_ and apr_cv_ variables to give hints
to the configure script. These may be different for your target. To sum it up,
my ./configure call essentially looked like this:

ac_cv_file__dev_zero=yes \
ac_cv_sizeof_size_t=4 \
ac_cv_sizeof_ssize_t=4 \
ac_cv_struct_rlimit=yes \
apr_cv_mutex_robust_shared=no \
apr_cv_process_shared_works=yes \
apr_cv_pthreads_lib="-lpthread" \
apr_cv_tcp_nodelay_with_cork=yes \
CPPFLAGS="-DAPR_IOVEC_DEFINED" ./configure <irrelevant options>

Good luck. May these problems in the Apache *PORTABLE* Runtime library be fixed
one glorious day.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org