Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.


  Search this Thread
Old 03-20-2012, 01:49 AM   #1
LQ Newbie
Registered: Sep 2011
Posts: 14

Rep: Reputation: Disabled
Compiling with non primary libc

I am working in the embedded environment.I have a Cross compiler for arm architecture with eglibc as it's primary library (ie the default libc coming along with the tool chain).Now i want some of the applications to link with uClibc.So i compiled uClibc with that tool-chain.While trying to compile and link the application with uClibc,the error comes.It is getting linked with the default library of the tool-chain.I am more inclined that it is possible to have two different libc(eg eglibc, uClibc on the same machine.Am i right?

I searched on the net and came with the following


As it suggested, i did the following

$arm-unknown-linux-gnueabi-gcc -c test.c -o TEST
$arm-linux-gnueabi-gcc TEST -o dynamic_test_with_new_opts -Wl,-rpath=/home/user/UCLIBC/uClibc- -Wl,-dynamic-linker=/home/user/UCLIBC/uClibc-

In this case, it is getting linked with the default of Eglibc


As the above link suggested,i tried out the following:

$arm-unknown-linux-gnueabi-gcc -Xlinker -rpath=/home/user/UCLIBC/uClibc- -Xlinker -I/home/user/UCLIBC/uClibc- test.c -o dynamic_test_with_linker_options

In this case, also,it is getting linked with the default of Eglibc

I am confused with this,Am i making any mistake.Really i am stuck with this.please throw some light on this.

thanks and regards
Old 03-20-2012, 10:02 PM   #2
Registered: May 2003
Location: Tengiz
Distribution: Slackware64 14.1
Posts: 672

Rep: Reputation: 94
I think -isystem flag may help you.
-isystem dir
    Search dir for header files, after all directories specified by -I but before the standard system directories. Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories. If dir begins with "=", then the "=" will be replaced by the sysroot prefix; see --sysroot and -isysroot.
Old 03-21-2012, 01:47 AM   #3
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,553

Rep: Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242Reputation: 3242
I have a Cross compiler for arm architecture with eglibc
I'd guess you will have to set up a new complete tool chain for uClibc.
Your linker ld-* depends on eglibc. "arm-linux-gnueabi-gcc" too.
I don't see how you can trick those to use a different *libc.

The recommended one ( And the only one that is closely maintained )
is crosstool-ng
08 Feb 2012 : Released 1.14.1 :



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling and installing glibc [/lib/tls/] knareshkumar Programming 6 04-23-2013 09:58 AM
compiling software without libc dependency augustocv Linux - Software 4 12-10-2006 06:52 PM
Running Fedora 4 on primary master and cant acsess my xp files on primary slave roxberry1 Linux - Newbie 5 01-29-2006 11:37 AM
Dual boot primary Linspire & XP primary slave? watmonki Linspire/Freespire 5 11-01-2005 08:16 PM
boot loader, MBR, redhat9 on primary slave, winxp on primary master samik Linux - Hardware 4 10-15-2003 08:55 PM

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration