[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patches] Static compilation of Eglibc



On Sat, Jan 28, 2012 at 4:48 AM, mayur priyan <mayurapriyan123@xxxxxxxxx> wrote:
> Hello expert,
>  Forgive me for raising my doubt over here.I did not find any location to
> ask.
>
> I wanted to statically link eglibc to my application on ARM architecture.I
> learned that only static libraries(having .a file extension) can be
> statically linked.I wanted to know how to statically cross compile Eglibc..I
> am using Linaro cross compiler.

Hi mayur.  This list is about the development of eglibc instead of
problems with it.  I'm afraid I don't know the best place to ask.  If
you have any further questions, feel free to email me off-list.

The short story is you don't need to recompile EGLIBC.  Add '-static'
to the GCC command line to make GCC use static instead of dynamic
libraries:

michaelh@crucis:~/tmp$ arm-linux-gnueabi-gcc -o hello hello.c

michaelh@crucis:~/tmp$ file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically
linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

michaelh@crucis:~/tmp$ arm-linux-gnueabi-gcc -static -o hello hello.c

michaelh@crucis:~/tmp$ file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically
linked, for GNU/Linux 2.6.16, not stripped

-- Michael
_______________________________________________
Patches mailing list
Patches@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/patches