3

I want to know how i can cross compile a library for ARM architecture. Suppose i have libcurl library for Intel architecture and now i want to run the application in ARM architecture using this library. What are the steps i need to perform for this cross compilation. I am using Ubuntu 32-bit machine. I have gone through the basic steps like

./configure --host= ...
make 
make install 

but could not get the complete idea. Please provide some useful link or if anybody can explain the things. Any help would be greatly appreciated.

I know there is a post in SO for this already "http://stackoverflow.com/questions/5832734/cross-compiling-a-library-from-intel-to-arm" , but i did not get the things clarified by this.

Platform : linux , gcc compiler

2
  • make install? Check: you are aware this does not make your arm binary run on intel? Commented May 17, 2012 at 6:25
  • You probably want to add DESTDIR to make install. gnu.org/prep/standards/html_node/DESTDIR.html Commented Jul 17, 2012 at 2:25

1 Answer 1

2

You need to give toolchain for your architecture the host parameter, for example for arm-1808 which basically has an arm architecture, the host parameter would be arm-none-linux. I used the following configure command for my architecture, and it compiled successfully, and I am able to run the application on my arm board.

0.

If tool chain is not in your PATH, then you can include it with a command like this:

 export PATH=/home/user/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH

1.

./configure --host=arm-none-linux-gnueabi --build=i686-linux CFLAGS='-Os' --with-ssl=/usr/bin/openssl --enable-smtp

2.

make

3.

sudo make install  

4. Now its time to build your application.

  arm-none-linux-gnueabi-gcc -o email smtp-multi.c -I/usr/local/include -L/usr/local/lib -lcurl

Basically you need to give CPP and CF flags while compiling your application, to find out the CF and CPP flags you can use the following commands respectively:

curl-config --cflags  

curl-config --libs

If above commands do not work then try:

arm-none-linux-gnueabi-gcc -o email smtp-multi.c -lcurl
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.