Patchwork [2/3] apr: fix cross compiling failed

login
register
mail settings
Submitter Hongxu Jia
Date May 30, 2014, 3:27 a.m.
Message ID <ee6d9dd0ee2502eda9964a5249d7ee438383344d.1401420117.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/72991/
State New
Headers show

Comments

Hongxu Jia - May 30, 2014, 3:27 a.m.
The do_compile failed:
| tools/gen_test_char > include/private/apr_escape_test_char.h
| /bin/sh: tools/gen_test_char: No such file or directory
| make[1]: *** [include/private/apr_escape_test_char.h] Error 127

The tools/gen_test_char was invoked at build time, and it didn't
work for the cross compiling, so we built it with $BUILD_CC.

To make sure there was no side effect on the change, not adding this
patch, I did the test:

1. Built the native tools/gen_test_char on x86-64 host, and invoke
   it on that host;

2. Built the target tools/gen_test_char which arch was arm, and invoke
   it on the qemuarm;

3. Comparing the results, they were total the same;
...
/* this file is automatically generated by gen_test_char, do not edit. "make include/private/apr_escape_test_char.h" to regenerate. */

static const unsigned char test_char_table[256] = {
    32,30,30,30,30,30,30,30,30,30,31,30,30,30,30,30,30,30,30,30,
    30,30,30,30,30,30,30,30,30,30,30,30,6,16,63,22,17,22,49,17,
    17,17,1,16,16,0,0,18,0,0,0,0,0,0,0,0,0,0,16,23,
    55,16,55,23,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,23,31,23,23,0,23,0,0,0,
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    0,0,0,23,23,23,17,30,30,30,30,30,30,30,30,30,30,30,30,30,
    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
    30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30
};
...

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../apr/apr/fix-cross-compiling-failed.patch       | 41 ++++++++++++++++++++++
 meta/recipes-support/apr/apr_1.5.1.bb              |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-support/apr/apr/fix-cross-compiling-failed.patch
Ross Burton - May 30, 2014, 11:22 a.m.
To help future bisecting this should be merged with the upgrade patch
into a single upgrade-and-fix patch.

Apart from that the patch looks good, thanks.

Ross

On 30 May 2014 04:27, Hongxu Jia <hongxu.jia@windriver.com> wrote:
> The do_compile failed:
> | tools/gen_test_char > include/private/apr_escape_test_char.h
> | /bin/sh: tools/gen_test_char: No such file or directory
> | make[1]: *** [include/private/apr_escape_test_char.h] Error 127
>
> The tools/gen_test_char was invoked at build time, and it didn't
> work for the cross compiling, so we built it with $BUILD_CC.
>
> To make sure there was no side effect on the change, not adding this
> patch, I did the test:
>
> 1. Built the native tools/gen_test_char on x86-64 host, and invoke
>    it on that host;
>
> 2. Built the target tools/gen_test_char which arch was arm, and invoke
>    it on the qemuarm;
>
> 3. Comparing the results, they were total the same;
> ...
> /* this file is automatically generated by gen_test_char, do not edit. "make include/private/apr_escape_test_char.h" to regenerate. */
>
> static const unsigned char test_char_table[256] = {
>     32,30,30,30,30,30,30,30,30,30,31,30,30,30,30,30,30,30,30,30,
>     30,30,30,30,30,30,30,30,30,30,30,30,6,16,63,22,17,22,49,17,
>     17,17,1,16,16,0,0,18,0,0,0,0,0,0,0,0,0,0,16,23,
>     55,16,55,23,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
>     0,0,0,0,0,0,0,0,0,0,0,23,31,23,23,0,23,0,0,0,
>     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
>     0,0,0,23,23,23,17,30,30,30,30,30,30,30,30,30,30,30,30,30,
>     30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
>     30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
>     30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
>     30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
>     30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,
>     30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30
> };
> ...
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  .../apr/apr/fix-cross-compiling-failed.patch       | 41 ++++++++++++++++++++++
>  meta/recipes-support/apr/apr_1.5.1.bb              |  1 +
>  2 files changed, 42 insertions(+)
>  create mode 100644 meta/recipes-support/apr/apr/fix-cross-compiling-failed.patch
>
> diff --git a/meta/recipes-support/apr/apr/fix-cross-compiling-failed.patch b/meta/recipes-support/apr/apr/fix-cross-compiling-failed.patch
> new file mode 100644
> index 0000000..9c909ec
> --- /dev/null
> +++ b/meta/recipes-support/apr/apr/fix-cross-compiling-failed.patch
> @@ -0,0 +1,41 @@
> +Makefile.in: fix cross compiling failed
> +
> +The tools/gen_test_char was invoked at build time,
> +and it didn't work for the cross compiling, so we
> +compile it with $BUILD_CC.
> +
> +Upstream-Status: inappropriate [oe specific]
> +
> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> +---
> + Makefile.in | 8 +++-----
> + 1 file changed, 3 insertions(+), 5 deletions(-)
> +
> +diff --git a/Makefile.in b/Makefile.in
> +--- a/Makefile.in
> ++++ b/Makefile.in
> +@@ -46,7 +46,6 @@ LT_VERSION = @LT_VERSION@
> +
> + CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
> +       build/apr_rules.out tools/gen_test_char@EXEEXT@ \
> +-      tools/gen_test_char.o tools/gen_test_char.lo \
> +       include/private/apr_escape_test_char.h
> + DISTCLEAN_TARGETS = config.cache config.log config.status \
> +       include/apr.h include/arch/unix/apr_private.h \
> +@@ -132,10 +131,9 @@ etags:
> + make_tools_dir:
> +       $(APR_MKDIR) tools
> +
> +-OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
> +-tools/gen_test_char.lo: make_tools_dir
> +-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
> +-      $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
> ++tools/gen_test_char@EXEEXT@: make_tools_dir
> ++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c
> ++      $(BUILD_CC) $(CFLAGS_FOR_BUILD) $< -o $@
> +
> + include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
> +       $(APR_MKDIR) include/private
> +--
> +1.8.1.2
> +
> diff --git a/meta/recipes-support/apr/apr_1.5.1.bb b/meta/recipes-support/apr/apr_1.5.1.bb
> index 7f2d2ca..95c11d5 100644
> --- a/meta/recipes-support/apr/apr_1.5.1.bb
> +++ b/meta/recipes-support/apr/apr_1.5.1.bb
> @@ -14,6 +14,7 @@ SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
>             file://cleanup.patch \
>             file://configfix.patch \
>             file://run-ptest \
> +           file://fix-cross-compiling-failed.patch \
>  "
>
>  SRC_URI[md5sum] = "5486180ec5a23efb5cae6d4292b300ab"
> --
> 1.8.1.2
>

Patch

diff --git a/meta/recipes-support/apr/apr/fix-cross-compiling-failed.patch b/meta/recipes-support/apr/apr/fix-cross-compiling-failed.patch
new file mode 100644
index 0000000..9c909ec
--- /dev/null
+++ b/meta/recipes-support/apr/apr/fix-cross-compiling-failed.patch
@@ -0,0 +1,41 @@ 
+Makefile.in: fix cross compiling failed
+
+The tools/gen_test_char was invoked at build time,
+and it didn't work for the cross compiling, so we
+compile it with $BUILD_CC.
+
+Upstream-Status: inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -46,7 +46,6 @@ LT_VERSION = @LT_VERSION@
+ 
+ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
+ 	build/apr_rules.out tools/gen_test_char@EXEEXT@ \
+-	tools/gen_test_char.o tools/gen_test_char.lo \
+ 	include/private/apr_escape_test_char.h
+ DISTCLEAN_TARGETS = config.cache config.log config.status \
+ 	include/apr.h include/arch/unix/apr_private.h \
+@@ -132,10 +131,9 @@ etags:
+ make_tools_dir:
+ 	$(APR_MKDIR) tools
+ 
+-OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
+-tools/gen_test_char.lo: make_tools_dir
+-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
+-	$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
++tools/gen_test_char@EXEEXT@: make_tools_dir
++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c
++	$(BUILD_CC) $(CFLAGS_FOR_BUILD) $< -o $@
+ 
+ include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
+ 	$(APR_MKDIR) include/private
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-support/apr/apr_1.5.1.bb b/meta/recipes-support/apr/apr_1.5.1.bb
index 7f2d2ca..95c11d5 100644
--- a/meta/recipes-support/apr/apr_1.5.1.bb
+++ b/meta/recipes-support/apr/apr_1.5.1.bb
@@ -14,6 +14,7 @@  SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
            file://cleanup.patch \
            file://configfix.patch \
            file://run-ptest \
+           file://fix-cross-compiling-failed.patch \
 "
 
 SRC_URI[md5sum] = "5486180ec5a23efb5cae6d4292b300ab"