[klibc] Shared versus static linked executables - and strip

Sam Ravnborg sam at ravnborg.org
Sun Jul 31 11:48:34 PDT 2005


I'm still pondering with kbuild and klibc.
Next in line was to get ipconfig support in the kernel (build wise).

A little challenge that is bigger than anticipated was to create
a shared executable. This required a far bigger rewrite of Kbuild.klibc
than originally planned. The good part is that I now managed to treat
linking of objects with single and multiple .o files almost the same.

I've introduced a new syntax:

static-y := foo
shared-y := bar

The old user-progs is gone and dead. Well almost before it was alive
anyway.

I expect to have this part ready in a few days (delayed by work-work).
But then I wonder about the strip and install part.
The way stripped targets are handled are different from gzip and
ipconfig.
In the gzip case a gzip.stripped is made.
In the ipconfig case a ipconfig.g is made that is unstripped.

So far my preferred approach is that is one wants a stripped target they
can do it using:

$(obj)/target: $(obj)/target-unstripped
	$(call cmd,strip)

The stripped target is only usefull when we install the executable
(create the fs or what it is used for).
So using the --strip option to install would do the trick.
But so far I do not see how to use the install target in the kernel.
I foresee that whan one selects the gzip executable in the kernel,
then it would added to the initramfs automatically, in a stripped
version.
I just do not see how this is going to work for now.
Ideas are welcome!

I will not bore you with a half-done patch for now.
But I like you to reply on your thought about stripped targets, install and
shared versus static linked targets.

	Sam



More information about the klibc mailing list