This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Need to make customized newlib


Rick:
 
This is more a compiler (technically, linker) question than a library
question.
 
To answer your questions:
 
Yes, it is possible.  I don't know what gcc version you have, but the
linking stuff is pretty static, so this ought to apply:
http://gcc.gnu.org/onlinedocs/gcc-4.2.3/gcc/Link-Options.html#Link-Optio
ns
You'll want to try the -nostdlib or -nodefaultlibs options (and maybe
-nostartfiles).  (A slighty different approach would be to have a gcc
install directory just for your special application where you went in
and
removed the supplied libraries or replaced them with your own.  See
below
for how to know where they might be.)
 
To know where things come from, examine the map file.  (If you are not
already generating one during the link, add "-Wl,Map -Wl,BASENAME.map"
to
the gcc command that does the final linking, where BASENAME is
appropriate
to you, of course.  (And of course you can also use whatever file
extension
that you want.  The file made is plain text, so if you're Windows-based
you
might want something like map.txt rather than my something.map.)  If you
are directly invoking ld rather than gcc for linking, then it would be
"-Map BASENAME.map".)   It tells for each function linked the file that
it came from, among other things.
 
Craig

-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
On Behalf Of Rick Mann
Sent: Monday, March 17, 2008 2:07 AM
To: newlib@sourceware.org
Subject: Need to make customized newlib

Hi. I need to start working on making a pared-down version of newlib.  
I've got a build of binutils/GCC/newlib that work for our Xscale  
target, but FAA regs require that we actually strip from all source  
code any unused functions. So, I was hoping I could just build a  
separate newlib, and link our application against that, in lieu of the  
newlib that exists with the GCC installation.

Is this possible? I tried building newlib with ./configure -- 
target=xscale-elf, and then I built a test program that includes  
<stdio.h> and links against printf. Then I found the printf.c and  
commented out the implementation, and rebuilt, hoping that I'd get a  
link error with my test program now. But I don't.

How can I ensure that I'm linking against my second newlib? Is it even  
possible?

Does anyone have any other suggestions on how to approach this?

TIA,
-- 
Rick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]