EmbDev.net

Forum: ARM programming with GCC/GNU tools custom board libc.a - how to link in?


von Sledge H. (sledge)


Rate this post
useful
not useful
Hello,

I have got here an ARM custom board, with only rootfs available (no 
source code..)

Trying to cross-compile vncviewer for it with CodeSourcery's G++ Lite.

libc.a in G++Lite shouts errors such as:
1
...
2
.../CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-eabi/4.4.1
3
/../../../../arm-none-eabi/lib/libc.a(lib_a-isattyr.o):
4
In function `_isatty_r': 
5
isattyr.c:(.text+0x18): undefined reference to `_isatty'
6
...
7
 (_write, _fstat, _exit etc)
8
collect2: ld returned 1 exit status

The answer I got from this link 
(http://www.embeddedrelated.com/groups/lpc2000/show/48415.php) says:
--
You would normally provide application specific versions of these
functions yourself. If you don't need the functions then they can be
stubbed out.
--

vnc obviously needs those functions, and I found their implementations 
in that custom board's /usr/lib/libc.a

Is there a way to merge nicely the implemented functions in 
.../custom-board/rootfs/usr/lib/libc.a and CodeSourcery's libc.a ?

Since I am a noob in autoconf -- how to modify vnc's autoconf config 
files to enable this?


What I tried so far:

1.Overwriting custom libc.a over the G++Lite's one, then I would get 
errors about unresolved _impure_ptr exports (means those residing only 
in the CodeSourcery..)
2.Then I renamed the custom libc.a into libcustomc.a and manually 
performed collect2 (ld) on a skeleton project - it worked! But how to 
integrate this into autoconf (settings LIBS = -lcustomc in configure.in 
did not help)?
And this "rename named conflicts" is by far not elegant anyhow...

So, there must be the way to gently compile complementary functions (and 
./configure with CROSS_COMPILE kernel's-working approach, too, but 
that's another topic) for us embedded folks out there..

Thanks heaps!

-- 
sledge

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.