Cross-compiling ActiveMQ for ARM
Disclaimer: I'm new here, I've done my best to follow the shipping guidelines, so please let me know if you need more information. I am also relatively new to Linux development.
Background: I am in the process of building a library using ActiveMQ-cpp on Linux. I built and ran it successfully on an Ubuntu machine, but trying to cross-compile it for an ARM based target machine creates some very clever errors.
The first step involves creating an APR ( http://apr.apache.org/ ) using the arm-linux-gcc compiler. After some research, the following command runs the script configuration with few issues:
CC=/usr/local/arm-linux/bin/arm-linux-gcc ./configure --prefix=/root/apr-arm --host=arm-linux cross_compiling=yes ac_cv_file__dev_zero=no ac_cv_func_setpgrp_void=no apr_cv_tcp_nodelay_with_cork=no apr_cv_process_shared_works=no
This allows you to take the next step - run the makefile.
Current problem: Typing make on the command line completes abruptly on the following line:
[...]
/root/.local/share/Trash/files/apr-1.5.1/build/mkdir.sh include/private
tools/gen_test_char > include/private/apr)escape_test_char.h
/bin/bash: tools/gen_test_char: cannot execute binary file
make[1]: *** [include/private/apr_escape_test_char.h] Error 126
make[1]: Leaving directory `/root/.local/share/Trash/files/apr-1.5.1'
make: *** [all-recursive] Error 1
Attempted correction: The solution to the next question posted by the appellant did not work. It is possible that I did not execute the correct process ( Apache Cross compilation error./gen_test_char: Unable to execute binary )
In the same thread, I tried to temporarily remove the problem gen_test_char program from my directory, but a clever script just rebuilds it.
My goal is to either avoid this error, or continue with the build process on Ubuntu, or perhaps consider other ways to build the library. I built it without issue in VS2013 on Windows, so if it is possible to cross-compile this project for ARM architectures, I would happily continue that.
source to share
APR requires gen_test_char to compile the system off hand, why did you end up with " bin / bash: tools / gen_test_char: unable to execute binary " because the make program is going to execute gen_test_char on your system, and if you cross compilation then every time you will get this error.
To avoid this error, follow these steps:
1) Cross compile APR which is going to fail
2) compile APR for system and copy gen_test_char to cross compiled APR directory.
3) Again cross compile
After following the above steps, you should not receive the "unable to execute binary" error.
source to share