[klibc] klibc wrapper

paul w mainargv at yahoo.com
Fri Feb 25 05:28:04 PST 2005


I've managed to compile klibc 0.198 and run the hello world program.
How can I compile my own program? 
Can someone give an example or provide a simple wrapper program for doing this?
like uclibc did with their earlier versions.

I looked at the make process and did a bit reading and figure out this much:

gcc -Wp,[preprocessor options] -MT,[target_name_I_think] tests/hello.o,
                               -MD,[include dependency] tests/.hello.o.d
    -mregparm=3 -DREGPARM=3 [Control how many registers are used to pass integer arguments]  
    -march=i386 [arch] -Os [optimization] -g [debug info] 
    -falign-functions=0 -falign-jumps=0 -falign-loops=0 [I think they are to optimize for size]
    -nostdinc -iwithprefix [include dir prefix] include -D__KLIBC__ -DBITSIZE=32 
    -I -I ... -DWITH_ERRLIST 
    -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline -c -o tests/hello.o 
                   crt0.o tests/hello.o libc.a /usr/lib/gcc/i686-pc-linux-gnu/3.4.1/libgcc.a
ld  -o tests/hello crt0.o tests/hello.o libc.a /usr/lib/gcc/i686-pc-linux-gnu/3.4.1/libgcc.a

I guess I need to do a few things here:
1. copy libc.a crt0.o     somewhere fixed
2. copy klibc include dir somewhere fixed
3. figure out how to instruct gcc to search for klibc includes 
4. figure out how to instruct gcc to search for system libc 

Please help with 3 and 4. Thanks

Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.

More information about the klibc mailing list