Subject: Re: remove default of STRIPFLAG=-s ?
To: NetBSD Toolchain Technical Discussion List <tech-toolchain@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: tech-toolchain
Date: 02/14/2004 17:17:59
[ On Wednesday, February 11, 2004 at 22:02:32 (+0000), David Laight wrote: ]
> Subject: Re: remove default of STRIPFLAG=-s ?
>
> But only because we don't have #ident lines in all the header files.
Yes, which is too bad...
> Do that and 'mcs -c' is your friend.
Indeed!
> IMHO we should build without removing any symbols, then strip for
> installation. The assumption then is that the build tree has the
> symbols in it - maybe the unstripped binaries should be available
> for the release CDs?
Yes, this is what I've been doing (along with static linking too, of
course).
I do a full "build.sh" run with STRIPFLAG clear and with '-g' on
everything.
Then I do additional installs into a new DESTDIR and RELEASEDIR with
STRIPFLAG="'-sS -g'". Here's how the last part works in the snip-it
from my "mybuild.sh" script that wraps it all together neatly, including
for /usr/xsrc:
${TOOLDIR}/bin/nbmake-${TARGET_MACHINE} STRIPFLAG="'-sS -g'" UNPRIVED=yes UPDATE=yes DESTDIR=${DESTDIR}-no-g RELEASEDIR=${RELEASEDIR}-no-g do-distrib-dirs
${TOOLDIR}/bin/nbmake-${TARGET_MACHINE} STRIPFLAG="'-sS -g'" UNPRIVED=yes UPDATE=yes DESTDIR=${DESTDIR}-no-g RELEASEDIR=${RELEASEDIR}-no-g includes
${TOOLDIR}/bin/nbmake-${TARGET_MACHINE} STRIPFLAG="'-sS -g'" UNPRIVED=yes UPDATE=yes DESTDIR=${DESTDIR}-no-g RELEASEDIR=${RELEASEDIR}-no-g BUILD_tool=no install
${TOOLDIR}/bin/nbmake-${TARGET_MACHINE} STRIPFLAG="'-sS -g'" UNPRIVED=yes UPDATE=yes DESTDIR=${DESTDIR}-no-g RELEASEDIR=${RELEASEDIR}-no-g BUILD_tool=no BUILD_lib=no BUILD_DONE=yes release
${TOOLDIR}/bin/nbmake-${TARGET_MACHINE} STRIPFLAG="'-sS -g'" UNPRIVED=yes UPDATE=yes DESTDIR=${DESTDIR}-no-g RELEASEDIR=${RELEASEDIR}-no-g BUILD_tool=no BUILD_lib=no BUILD_DONE=yes src-sets
Caveat: I'm working with the netbsd-1-6 branch.
This of course requires quite a lot of space for $OBJDIR (-M),
especially when statically linking everything with "-g" symbols (just
over 6GB on alpha with an extra kernel or two and the final ISO), but I
think the result is well worthwhile.
> I have had to rebuild programs because they get stripped during build.
> That is bad news. Also removing local symbols can give apparrantly
> incorrect stack back-traces, so isn't particularly useful.
yes, that happens quite often to me as well.
> It it also possible to do a reasonable amount of debugging with just
> the standard symbol table - after all the most usable feature of gdb is
> the 'bt' command on a core dump.
Indeed. I consider the standard symbol table to be mandatory, and the
'-g' table is only a desirable bonus, but certainly not necessary.
--
Greg A. Woods
+1 416 218-0098 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com> Secrets of the Weird <woods@weird.com>