diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2005-12-13 22:22:04 +0100 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2005-12-13 13:42:05 -0800 |
commit | 33030d0321e3cb23aafb4c226047a36529e981e0 (patch) | |
tree | 699bedb47bfa88c282e973580a2724ffa6758f5d | |
parent | 3ac494926e4b96b7f6b3eb82697de7ab766e18ec (diff) | |
download | klibc-33030d0321e3cb23aafb4c226047a36529e981e0.tar.gz |
Non-kbuild klibc obsoletedklibc-1.1.6
On Tue, Dec 13, 2005 at 09:48:44AM -0800, H. Peter Anvin wrote:
> Hi there,
>
> Just found a problem... the old Makefile produced e.g.
> utils/{static,shared,static.g,shared.g} with and without debugging
> turned on. This is important, since with klibc sometimes these aren't
> just the same thing as building with debugging and then stripping; that
> doesn't work too well on e.g. x86-64.
>
> Any idea how to get this back?
I took the simple approch and always do it when building
the shared / static binaries.
I assume this cover your need.
Please note one major drawback. If you delete the *.g file kbuild
will NOT notice and will not rebuild it.
Sam
kbuild: create stripped versions of programs
When building utilities always create a file.g that is the non-stripped
binary. Please note that the file.g file is created as a side effect,
so kbuild does not know about it. In other words kbuild will not rebuild
the .g file if you delete it. And it will overwrite it no matter the
timestamp on the file
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r-- | dash/Kbuild | 2 | ||||
-rw-r--r-- | gzip/Kbuild | 8 | ||||
-rw-r--r-- | scripts/Kbuild.klibc | 10 | ||||
-rw-r--r-- | usr/kinit/Kbuild | 2 |
4 files changed, 12 insertions, 10 deletions
diff --git a/dash/Kbuild b/dash/Kbuild index 25c631877a4ca..ff07cec348b32 100644 --- a/dash/Kbuild +++ b/dash/Kbuild @@ -57,7 +57,7 @@ sh.shared-y := $(sh-y) hostprogs-y := $(HELPERS) # For cleaning -targets := $(static-y) $(shared-y) $(CLEANFILES) +targets := sh sh.g sh.shared sh.shared.g $(CLEANFILES) # Generate token.h $(obj)/parser.o: $(obj)/token.h diff --git a/gzip/Kbuild b/gzip/Kbuild index c92eeea138817..214ce618dac18 100644 --- a/gzip/Kbuild +++ b/gzip/Kbuild @@ -7,7 +7,7 @@ static-y := gzip gzip-y := gzip.o util.o unzip.o inflate.o # Additional targets -always := gunzip zcat gzip.stripped +always := gunzip zcat # Optional ZIP support gzip-$(CONFIG_KLIB_ZIP) += zip.o deflate.o trees.o bits.o @@ -18,12 +18,8 @@ EXTRA_KLIBCCFLAGS := $(cflags-y) $(obj)/gunzip $(obj)/zcat: $(obj)/gzip $(call cmd,ln) -# A stripped version of gzip -$(obj)/gzip.stripped: $(obj)/gzip - $(call cmd,strip) - # Cleaning -targets := $(static-y) $(shared-y) +targets := gzip gzip.g gunzip zcat # Targets to install install-y := gzip gunzip zcat diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc index 8de9aa586097b..e54e790b02af0 100644 --- a/scripts/Kbuild.klibc +++ b/scripts/Kbuild.klibc @@ -245,7 +245,10 @@ quiet_cmd_ld-static = KLIBCLD $@ $(EXTRA_KLIBCLDFLAGS) \ $(KLIBCCRT0) \ $(link-deps) \ - $(KLIBCLIBC) $(KLIBCLIBGCC) + $(KLIBCLIBC) $(KLIBCLIBGCC); \ + cp -f $@ $@.g; \ + $(KLIBCSTRIP) $(KLIBCSTRIPFLAGS) $@ + $(static-y): $(klibc-objs) $(lib-target) FORCE $(call if_changed,ld-static) @@ -255,7 +258,10 @@ quiet_cmd_ld-shared = KLIBCLD $@ $(EXTRA_KLIBCLDFLAGS) \ $(KLIBCEMAIN) $(KLIBCCRTSHARED) \ $(link-deps) \ - -R $(KLIBCLIBCSHARED) $(KLIBCLIBGCC) + -R $(KLIBCLIBCSHARED) $(KLIBCLIBGCC);\ + cp -f $@ $@.g; \ + $(KLIBCSTRIP) $(KLIBCSTRIPFLAGS) $@ + $(shared-y): $(klibc-objs) $(lib-target) FORCE $(call if_changed,ld-shared) diff --git a/usr/kinit/Kbuild b/usr/kinit/Kbuild index a2d899ed8d907..0735da63fb01a 100644 --- a/usr/kinit/Kbuild +++ b/usr/kinit/Kbuild @@ -19,7 +19,7 @@ KLIBCCFLAGS_nfsroot.o := -I$(srctree)/$(src)/ipconfig -I$(srctree)/$(src)/nfsmou # TODO - stripped image # Cleaning -targets := $(static-y) $(shared-y) +targets := kinit kinit.g subdir- := ipconfig nfsmount |