libg.a Vs libc.a

Rohit Arul Raj
Sun Dec 18 18:41:00 GMT 2011

Hello All,

While building newlib, i had expected the following libraries to be
generated: libc.a, libg.a (a debugging-enabled libc), and libm.a.
But if seems there is no difference between 'libc.a' and 'libg.a'.
Based on the flags, either both are generated with debug info or both
without debug info.

Also, looking the build logs and makefile, it seems 'libg.a' is a copy
of 'libc.a'.

libc.a: libc/libc.a libm.a
	rm -rf libc.a libg.a tmp
	mkdir tmp
	cd tmp; \
	 $(AR) x ../libm.a $(MATHOBJS_IN_LIBC) ; \
	 $(AR) x ../libc/libc.a ; \
	 $(AR) $(AR_FLAGS) ../$@ *.o
	$(RANLIB) libc.a
	ln libc.a libg.a >/dev/null 2>/dev/null || cp libc.a libg.a
	rm -rf tmp

My requirement is to build libc.a [without debug info] and libg.a
[with debug info] and update the gcc spec [#define LIB_SPEC] file to
choose the required libraries automatically.

Any suggestions?


More information about the Newlib mailing list