From owner-freebsd-hackers Sun Oct 15 15:52:37 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id PAA13333 for hackers-outgoing; Sun, 15 Oct 1995 15:52:37 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id PAA13328 for ; Sun, 15 Oct 1995 15:52:34 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id IAA32542; Mon, 16 Oct 1995 08:52:00 +1000 Date: Mon, 16 Oct 1995 08:52:00 +1000 From: Bruce Evans Message-Id: <199510152252.IAA32542@godzilla.zeta.org.au> To: ache@astral.msk.su, j@uriah.heep.sax.de Subject: Re: A couple problems in FreeBSD 2.1.0-950922-SNAP Cc: hackers@freefall.freebsd.org, kaleb@x.org Sender: owner-hackers@FreeBSD.org Precedence: bulk >> Did you setenv ENABLE_STARTUP_LOCALE before calling ls? >> See environ(7) (-current). >IMHO, the base utilities that use should properly initialize >the locale instead of relying on that hack. (The hack is useful to >force programs that don't like to handle locale's, but base utilities >of the system are expected to do it right theirselves.) BTW, this hack adds 24K to the size of a minimal statically linked program `main() {}' and defeats the point of most of the specially named routines in crt0.c. E.g., there is a special version of getenv() named _getenv() to avoid the namespace pollution and bloat from getenv(), but the hack calls getenv() anyway; there are special versions of read() and write(), but _startup_setlocale() references things in stdio that reference read() and write(). atexit() support adds another 28K. Less for real programs of course. The bloat is really in libc, where almost everything references too many other things. Bruce echo 'main() {}' >z0.c echo 'main() {} getenv() {} _startup_setlocale() {}' >z1.c echo 'main() {} getenv() {} _startup_setlocale() {} atexit() {}' >z2.c for i in 0 1 2; do cc -O -o z$i z$i.c -static -s; done ls -l z0 z1 z2