简体   繁体   English

apache2交叉构建失败了

[英]apache2 cross-build failed for arm

On cross-building apache2 2.4.12 I get the following Error during complitation: 在交叉构建apache2 2.4.12时,我在complitation期间遇到以下错误:

    ptxdist/platform/build-target/httpd-2.4.12/modules/mappers  -prefer-non-pic -static -c exports.c && touch exports.lo
    exports.c:4117:55: error: 'apr_hash_this_key' undeclared here (not in a function)
    exports.c:4121:59: error: 'apr_hash_this_key_len' undeclared here (not in a function)
    exports.c:4125:55: error: 'apr_hash_this_val' undeclared here (not in a function)
    exports.c:4568:62: error: 'apr_sockaddr_is_wildcard' undeclared here (not in a function)
    exports.c:5307:55: error: 'apr_shm_create_ex' undeclared here (not in a function)
    exports.c:5323:55: error: 'apr_shm_attach_ex' undeclared here (not in a function)

It seems that there is a dirty hack that generate httpd-2.4.12/server/exports.c during compile time from file make_exports.awk 似乎有一个脏的hack在编译期间从文件make_exports.awk生成httpd-2.4.12 / server / exports.c

How do I adjust this make_exports.awk file to get a working cross-build for arm? 如何调整此make_exports.awk文件以获得arm的交叉构建?

The solution was to create a patch for apr-1.5.1 which disable apr_hash_this_key, apr_hash_this_key_len and so on. 解决方案是为apr-1.5.1创建一个补丁,禁用apr_hash_this_key,apr_hash_this_key_len等等。 Then recompile apr, apr-util and apache 2.4.12. 然后重新编译apr,apr-util和apache 2.4.12。

diff -rupN AY/include/apr_hash.h AZ/include/apr_hash.h
--- AY/include/apr_hash.h   2015-02-27 10:35:07.436548295 +0100
+++ AZ/include/apr_hash.h   2015-02-27 10:33:30.038497258 +0100
@@ -171,21 +171,21 @@ APR_DECLARE(void) apr_hash_this(apr_hash
  * @param hi The iteration state
  * @return The pointer to the key
  */
-APR_DECLARE(const void*) apr_hash_this_key(apr_hash_index_t *hi);
+//APR_DECLARE(const void*) apr_hash_this_key(apr_hash_index_t *hi);

 /**
  * Get the current entry's key length from the iteration state.
  * @param hi The iteration state
  * @return The key length
  */
-APR_DECLARE(apr_ssize_t) apr_hash_this_key_len(apr_hash_index_t *hi);
+//APR_DECLARE(apr_ssize_t) apr_hash_this_key_len(apr_hash_index_t *hi);

 /**
  * Get the current entry's value from the iteration state.
  * @param hi The iteration state
  * @return The pointer to the value
  */
-APR_DECLARE(void*) apr_hash_this_val(apr_hash_index_t *hi);
+//APR_DECLARE(void*) apr_hash_this_val(apr_hash_index_t *hi);

 /**
  * Get the number of key/value pairs in the hash table.
diff -rupN AY/include/apr_network_io.h AZ/include/apr_network_io.h
--- AY/include/apr_network_io.h 2013-12-06 18:10:34.000000000 +0100
+++ AZ/include/apr_network_io.h 2015-02-27 11:50:10.847966181 +0100
@@ -730,7 +730,7 @@ APR_DECLARE(int) apr_sockaddr_equal(cons
  * @remark The return value will be non-zero if the address is
  * initialized and is the wildcard address.
  */
-APR_DECLARE(int) apr_sockaddr_is_wildcard(const apr_sockaddr_t *addr);
+//APR_DECLARE(int) apr_sockaddr_is_wildcard(const apr_sockaddr_t *addr);

 /**
 * Return the type of the socket.
diff -rupN AY/include/apr_shm.h AZ/include/apr_shm.h
--- AY/include/apr_shm.h    2015-02-27 12:00:01.119541200 +0100
+++ AZ/include/apr_shm.h    2015-02-27 12:02:01.294089137 +0100
@@ -111,12 +111,12 @@ APR_DECLARE(apr_status_t) apr_shm_create
  *         function will return the first usable byte of memory.
  * 
  */
-APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m,
+/*APR_DECLARE(apr_status_t) apr_shm_create_ex(apr_shm_t **m,
                                             apr_size_t reqsize,
                                             const char *filename,
                                             apr_pool_t *pool,
                                             apr_int32_t flags);
-
+*/
 /**
  * Remove named resource associated with a shared memory segment,
  * preventing attachments to the resource, but not destroying it.
@@ -164,11 +164,11 @@ APR_DECLARE(apr_status_t) apr_shm_attach
  *        structure for this process.
  * @param flags mask of APR_SHM_* (defined above)
  */
-APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m,
+/*APR_DECLARE(apr_status_t) apr_shm_attach_ex(apr_shm_t **m,
                                             const char *filename,
                                             apr_pool_t *pool,
                                             apr_int32_t flags);
-
+*/
 /**
  * Detach from a shared memory segment without destroying it.
  * @param m The shared memory structure representing the segment
diff -rupN AY/Makefile.in AZ/Makefile.in
--- AY/Makefile.in  2015-02-27 10:17:32.817392979 +0100
+++ AZ/Makefile.in  2015-02-27 10:17:44.075619396 +0100
@@ -113,7 +113,7 @@ apr.exp: exports.c export_vars.c
    @echo "#! lib@APR_LIBNAME@.so" > $@
    @echo "* This file was AUTOGENERATED at build time." >> $@
    @echo "* Please do not edit by hand." >> $@
-   $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
+   #$(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/\1/' >> $@
    $(CPP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$$/d' >> $@

 dox:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM