public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Modifying the std C libraries
@ 2008-03-17 22:50 Rick Mann
  2008-03-17 22:58 ` Brian Dessent
  0 siblings, 1 reply; 2+ messages in thread
From: Rick Mann @ 2008-03-17 22:50 UTC (permalink / raw)
  To: gcc-help

We've got an xscale-elf cross compiler built using binutils, gcc 4,  
and newlib. It all seems to work reasonably well. Now we've reached a  
point where we must strip out all uncalled source code from newlib,  
and rebuild that.

I tried the experiment of building a new newlib with the xscale-elf  
tools, which worked fine, and then making a simple test program that  
linked against printf(), then removing printf() and rebuilding newlib  
and relinking. I would expect it to fail, but it doesn't.

I wonder if GCC is implicitly linking against the newlib that was  
built with it, rather than my new newlib (even though i specify -I and  
-L and -lc).

How can I get GCC to ignore the stuff it would normally implicitly  
link against and instead link against a very specific version of the  
runtime libs?

TIA,
-- 
Rick

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Modifying the std C libraries
  2008-03-17 22:50 Modifying the std C libraries Rick Mann
@ 2008-03-17 22:58 ` Brian Dessent
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dessent @ 2008-03-17 22:58 UTC (permalink / raw)
  To: Rick Mann; +Cc: gcc-help

Rick Mann wrote:

> How can I get GCC to ignore the stuff it would normally implicitly
> link against and instead link against a very specific version of the
> runtime libs?

Use '-nodefaultlibs' if you don't want the standard libs,
'-nostartfiles' if you don't want the standard startup files, and
'-nostdlib' if you don't want either.   Note the blurb in the manual
about -lgcc if you use these.

Brian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-17 22:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-17 22:50 Modifying the std C libraries Rick Mann
2008-03-17 22:58 ` Brian Dessent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).