cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Not able to cross-compile curl for ARM uClinux

From: Bernard Evensrud <bevensrud_at_gmail.com>
Date: Tue, 18 Dec 2012 21:25:34 +0100

2012/12/15 Bernard Evensrud <bevensrud_at_gmail.com>:
> 2012/12/15 Bernard Evensrud <bevensrud_at_gmail.com>:
>> 2012/12/14 Daniel Stenberg <daniel_at_haxx.se>:
>>> On Fri, 14 Dec 2012, Bernard Evensrud wrote:
>>>
>>>> Also tried to compile some other small programs, both C and C++ (adding
>>>> the -lstdc++ parameter of course). Compiles and runs. These programs is
>>>> compiled with make, and do not have any configure scripts.
>>>
>>>
>>> So save a C source file as main.c that does printf("hello world\n"); in its
>>> main() function. Use only plain C. A fine compiler (in this context) should
>>> then be able to do this:
>>>
>>> $ arm-elf-gcc main.c
>>>
>>> ... and there should be no warnings at all, and there should be an "a.out"
>>> file created that is the executable you can execute on target.
>>>
>>> Compilers named "arm-elf-gcc" usually imply that they are more bare-bones
>>> and won't work as simple as that (and the config.log test failure seems to
>>> prove that). Does your gcc?
>>>
>>> --
>>>
>>> / daniel.haxx.se
>>>
>>> -------------------------------------------------------------------
>>> List admin: http://cool.haxx.se/list/listinfo/curl-library
>>> Etiquette: http://curl.haxx.se/mail/etiquette.html
>>
>> Thanks to your help maybe I have found something. Using an example
>> 'Hello World' application in plain c, when compiling without other
>> options than "-Wl,--elf2flt" it does make a working executable. But if
>> I do not specify a filename it will be called "-r" and not "a.out" ?!?
>> Normally when I have compiled my software I have always been using the
>> -o option to set my own output filename.
>> Now the error makes sense, as it is checking default compiler file
>> name before it stops executing.
>>
>> This confirms that there really is problems with my toolchain?
>>
>> Bernard E.
>
> I have manually changed the linker script provided in the toolchain, I
> set default output filename as a.out. This string was empty!
> Lazy people at MOXA supplying this toolchain.
>
> I am happy I managed to cross this step. I do have some new errors.
> Hoping to sort them out tomorrow :)
>
> Bernard E.

Thank you all for your kind help! I finally managed to compile it
successfully. I set the linker options directly in the linker script,
then it compiled just fine (under 32-bit Fedora 14). Under 64-bit
Ubuntu 12.10 I got an error, but when I removed the parts and
protocols I did not use it compiled fine there as well.

This proves that libcurl really can be used on uClinux and without
MMU. For other people facing the same problems with the toolchain from
Moxa, check the linker script's default file name, and make all files
elf2flt. Also make sure to install IA32-Libs or compile on a 32-bit
system.

Bernard E.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-12-18