LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2012, 10:08 AM   #1
embeddedlinux
LQ Newbie
 
Registered: Mar 2012
Posts: 10

Rep: Reputation: Disabled
using libc file in bare metal arm gcc compile


Hi all,
I have been working on driver development on bare metal arm processor of cortex 15 family.
I want to use printf for debugging purpose when the code is running on target.
For that to compile the code I am using code sourcery lite edition arm-gcc-none-eabi.
I know that I have to include libc file in order to use stdio library function. I have included the path in the makefile and did other settings but when I compile the code I get following errors :


libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c.text+0x18): undefined reference to `_sbrk'
libc.a(lib_a-writer.o): In function `_write_r':
writer.c.text+0x20): undefined reference to `_write'
libc.a(lib_a-closer.o): In function `_close_r':
closer.c.text+0x18): undefined reference to `_close'
libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c.text+0x1c): undefined reference to `_fstat'
libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c.text+0x18): undefined reference to `_isatty'
libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c.text+0x20): undefined reference to `_lseek'


I have doubt whether the code sourcery comes with newlib which includes the libc files or do I have to compile it?

Please help me solve the problem.

Thanks
 
Old 10-10-2012, 08:25 PM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
Hi,
Quote:
Originally Posted by embeddedlinux View Post
Hi all,
I have been working on driver development on bare metal arm processor of cortex 15 family.
I want to use printf for debugging purpose when the code is running on target.
For that to compile the code I am using code sourcery lite edition arm-gcc-none-eabi.
I know that I have to include libc file in order to use stdio library function. I have included the path in the makefile and did other settings but when I compile the code I get following errors :


Thanks
Maybe you should take a look at the file printk.h in the include/linux directory.
IIRC the kernel implements its own print functions, so it isn't dependent of libc.
 
  


Reply


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
Personal PC as a Bare Metal Hypervisor dman777 Linux - Virtualization and Cloud 5 12-31-2010 07:03 AM
VMware ESXi without bare metal vinaytp Linux - Newbie 4 08-27-2010 05:22 PM
bare metal backup for HP-UX 11i v3? h@foorsa.biz Other *NIX 2 04-15-2010 06:40 PM
Compile the linux2.6.14.1 for arm must ues the arm-linux-gcc-3.4.4? frankyue Linux - Embedded & Single-board computer 2 12-20-2008 08:28 AM
Can I do a Bare Metal Restore? bob151 Linux - Software 1 04-14-2005 07:41 PM


All times are GMT -5. The time now is 12:37 PM.

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