This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: Building my own C library


bd satish <bdsatish@gmail.com> writes:

> I was trying to compile my own Standard C Library  (for ex, I want to
> use my version of malloc instead of the one included in libc ). What
> command line options should I use to compile & link this code with my
> test case ?  The code is compiling fine (with option -nostdinc) but I
> think linking is my problem. For one, I noticed  -nostdlib and
> -nodefaultlibs  but these are giving errors.
>
> I have my version of  the C headers in /home/bds/include. It seems
> like, my version of malloc is  clashing with the one coming with gcc.
> Now I'm not sure which one did the test case trying to pick up.
>
> Any help appreciated.

You need to tell us what is actually going wrong.

-nostdinc and -nostdlib should do the job.  You will then have to
explicitly list your library and startup files when linking.

Ian


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